The 3 rules of flow
Understanding the 3 rules of flow will enable you to design complex and non-linear workflows.
We’ll be looking at the “Request for leave” workflow as example to explain the flow. Refer to its recipe for more details.
Rule # 1
A workflow has a natural flow from top to bottom.
When you start a new workflow, the ‘flow’ finds the 1st task in the 1st level of the workflow (Apply for leave - form) and ‘activates’ it. If the 1st task is a form then it is shown to the person.
On successful completion of the form, the ‘flow’ restarts from the top of the workflow. It checks the status of the 1st task in the 1st level and, since it is the only task on that level and has already been completed, the ‘flow’ proceeds to the next level and finds the 2nd level’s task(s) (Notify manager of leave - email). Sending an email is an automated task and Kotive sends the email and ‘completes’ the task.
In order for the ‘flow’ to proceed to the next level, rules 2 & 3 need to be met:
Rule # 2
For each level at least 1 task in that level must have been 'completed'.
Rule # 3
For each level all 'activated' tasks need to have been 'completed'.
The ‘flow’ restarts from the top of the workflow, does the appropriate checks on level 1, then proceeds to level 2. It does the same checks on level 2 and since the email is the only task on that level and has already been completed, the ‘flow’ proceeds to the 3rd level. Here it finds the “Review leave request” form and the “Contingency plan” sub-workflow.
The form has no conditions that prevents it from being activated and is shown to the person. The sub-workflow has a condition that only activates it when a contingency plan is requested. The contingency plan has not been requested yet so it is not activated.
The person reviews the request for leave and ticks the “A contigency plan is needed” checkbox in the form.
On successful completion of the “Review leave request” form, the ‘flow’ restarts from the top of the workflow, checks and passes level 1, proceeds to level 2, checks and passes level 2 and proceeds to level 3. At least 1 task in this level has been ‘completed’ (rule #2) BUT, because the person requested a contingency plan in the “Review leave request” form, the previously mentioned condition is met and the “Contingency plan” sub-workflow is activated. The result is that the flow remains in level 3 since all activated tasks on a level need to have been completed before proceeding to the next level. (rule #3)
The ‘flow’ now enters the sub-workflow and finds the 1st task in the 1st level and sends the “Notify of contingency” email.
The ‘flow’ restarts from the top of the main workflow, performs its checks on every level and finds the incomplete “Contingency plan” sub-workflow in level 3. It enters the sub-workflow, checks and passes its 1st level, proceeds to level 2 and displays the “Contingency plan” form.
This ‘flow from the top’ is repeated until the last task in the main workflow has successfully been completed. 😀 The workflow itself is then ‘complete’.
This repeated ‘flow from the top’ makes complex non-linear and adaptive workflows possible. Watch the video below to learn more…