What happens when we trigger the SWF Flows @Execute method multiple times?

118 views Asked by At

We have a usecase where we start a workflow (by invoking @Execute method) and the we schedule a timer for a subsequent activity. Now, this triggering of workflow is based on API call which can be triggered multiple times by a client.

  1. Wanted to know how SWF flow handled the multiple invocations of @Execute method.
  2. Does it create multiple executions ?
  3. or would there be multiple timer clocks scheduled for same workflow execution ?
1

There are 1 answers

0
Maxim Fateev On BEST ANSWER

SWF allows only one open workflow execution per ID. So if the workflow is still running calling the Execute method again is going to return WorkflowExecutionAlreadyStartedFault.

Note that if a workflow is completed the new workflow is going to start even for the same ID.

The temporal.io which is an open source version of SWF has an additional WorkflowIdReusePolicy which specifies what should be done if there are already completed workflows.