Our team has been discussing how state works in Workflows and this is our understanding: If at any

Our team has been discussing how state works in Workflows and this is our understanding:

If at any point, a workflow step fails, our understanding is that it restarts the entire workflow from the beginning. HOWEVER, any functions that are run with steps.do pulls the data from a cache that Cloudflare has set up.

Therefore if you do the following:

const a = fna()
const b = step.do("fnb", fnb())
const c = fnc(b)
const d = step.do("fnd", fnd(a,b,c))


If fnd fails, the following will happen:
  • fna and fnc will both rerun. They better be idempotent.
  • fnb will not rerun because it was pulled from the workflow cache.
  • fnd will still have access to a, b, and c but a and c are fresh data whereas b was pulled from cache.
I think this has confused a lot of people I've spoken with so, I want to make sure my understanding is right, and it would be amazing to include some examples where functions are NOT running in steps inside of workflows so that other people can grasp this concept as well. Thanks.
Was this page helpful?