How Sequencing Works
Sequencing of workflows is implemented to ensure:
- If there are dependencies between workflows, workflows are run one after the other.
- Sequenced workflows are in an order - in most cases, based on the date/time of the received message, webservice or UI operation.
If workflows do not have overlapping data, sequencing does not apply. Workflows which have already completed, suspended waiting for user input, or system events (process is in WAIT status) are not considered and do not influence sequencing.
Sequencing is done before a workflow starts execution and workflows which are either executing or about to execute are checked for dependency. Workflows that have already started execution are not stopped or re-sequenced.
When a dependency between workflows is detected, one of the workflows (survivor) is selected to run. All other dependant workflows are queued up. When the survivor workflow completes, suspends, or its status is changed to indicate that dependant workflows are allowed to run, queued up workflows are evaluated and another workflow is selected to run. This process continues till all the queued workflows are allowed to run.
Dependency between workflows is detected based on one or more registration keys. Each workflow may have any number of keys. A workflows is considered dependant as long as it has one key common with other workflows.