Question

We're moving over to Amazon Simple Workflow Service from various cron-based processes. A lot of these won't need to run at certain times any more, and would just be triggered when needed. However, for certain workflows, we need to guarantee that the workflow (or rather, all the activities within the workflow), don't occur in parallel and there is only ever one running at any time. Once it's finished, it is then fine for it to run again however.

Would there be any problems, or is it somehow bad design, to depend on the uniqueness of the workflowId? If so, what would be the problems, and how can the system be designed to ensure that certain workflows aren't started when they should't be.

Was it helpful?

Solution

Depending on SWF and using workflowId for unique execution as a state persistence and arbitration layer (whichever comes in second gets rejected) is definitely not bad design - that's exactly what the service is for.

Yes, both workflowId and activityId are enough to ensure unique execution.

Now, for activities within the workflow, the activityId does not necessarily have to be unique, as it is up to the decider to schedule work in a task-by-task fashion. See boto SWF tutorial for examples of serial and parallel workflow executions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top