The two types of workflows which exist out of the box in Visual Studio are:
- Sequential Workflow
- State Machine Workflow
Below, find the differences between them, so that when you are thinking of implementing a workflow, you would use the one that fits the most:
State-Machine workflows:
- State-machine workflows are workflows which are driven by particular events. Example:
- OnTaskChanged
- OnTaskCreated
- OnTaskDeleted
- OnWorkflowActivated etc
- In order to move to another event, the workflow needs to meet another state.
- If a task is created, the workflow stays on that event until another even is called, for example the user decides to edit the task (on task changed)
- The control of the workflow is decided by the user, according to what events he calls, the workflow will execute.
- The workflow doesn't really have to end. It can stay in the same state for weeks for example.
Sequential workflows:
- Sequential workflow is known to be very predictable. It works like a flowchart - Example:
- The workflow works until the user approves or denies the file in order to continue. When ALL users approve/deny it will go to the next time
- This kind of workflow is used when there is only one way to complete the task.
- The workflow controls the processes of what happens throughout the workflow.