What happens when a workflow restarts after a worker crash

Activity 1 - fetches something from a server

Say i have a workflow that does the following

  1. Workflow executes Activity 1 which calls an external server and fetches some info in a local variable
  2. Workflow generates ID for the child workflow based on returned info from external server in 1
  3. Workflow executes Activity 2 which reports the workflow IDs created above to the external server
  4. Workflow executes child workflows for all the IDs generated in 2.

Say worker crashes after step 3 - would the workflow be re-run from the beginning or restart at 4, spawning only the child workflow based on the IDs generated in 2?

I saw a post about how workflows maintain the local variable states, but what if the Activity 1 in step 1 returns a different set if values once step 2 have been executed, would the value returned by activity 1 persist on re-run?

The workflow doesn’t “restart”; it keeps running as if the worker crash had never happened. Activities are not reexecuted after they return results to the service.

1 Like