Reevaluation in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 03:25 PM
Here is my use case: I'm trying to create a flow that generates three tasks for a case in this order:
- The flow creates a case.
- The flow creates Task1.
- The flow checks a true/false field in the case form. If the user selects "yes," the flow creates Task2.
- The flow waits for Task1 to complete, and also for Task2 to complete if it exists (i.e., if the user selected "yes" and Task2 was generated). Then, the flow generates Task3.
The challenge is how to monitor the yes/no field value for the creation of Task2. If I use a wait-for condition, the flow will stop at that wait step and will wait for the condition to be met, meaning it will never trigger Task3 if the user doesn't select "yes". Alternatively, using an If logic instead of a wait action. Since the flow is sequential, after creating Task1, the flow will immediately evaluate the If condition. If the user hasn't selected "yes" by that time, the flow will skip the creation of Task2 and only wait for the completion of Task1 to create Task3.
How can I overcome this challenge? Specifically, how can I create Task1, monitor the yes/no field for the creation of Task2 (at lease for the period of time that task1 is still open), and then create Task3 whenever Task1 is completed and Task2 is completed if it exists?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 04:46 PM
In theory it should work to create a Flow Variable that is the list of task created (Task 1 and Task 2 sys_ids), and have two parallel branches:
- 1 on which Task 1 is created and its sys_id is added to the list of tasks to watch and
- 2 on which the flag is watched and Task 2 is created and its sys_id is added to the list of tasks to watch.
Task 1 would be created without waiting so that it can reach a look in which a lookup and a watch is done for one of the tasks in the list.
Each time the currently watched task is closed, the loop is re-evaluated and if there are no more tasks, the flow continues.
But this depends on what should happen if the flag is flipped after Task 1 is closed and Task 3 has been created?
Or even after Task 3 is closed?
Should Task 2 still be created?
Should Task 3 be re-opened/re-created?
In any case here's a demo:
Notice that Task 2 - in this setup - would be created even if the flag is flipped to Yes after Task 3 is created (so Task 1 is closed).
If that is not desired, the condition @ 6 should be augmented to include an additional check (beside Trigger Record -> active = true).
This flag should be set when Task 1 is closed (so before Task 3 is created).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 05:54 PM
Thanks @-O- , to clarify and answer your questions:
After Task 1 is closed, if the flag is "no", only Task 3 should be created. However, if the flag flips to "yes" while Task 1 is still open, the flow should first create Task 2, and then only create Task 3 after both Task 1 and Task 2 are completed. So, after the creation of Task 3, flipping the flag shouldn’t trigger Task 2. In this scenario, the order flow is: Case, Task 1, and Task 3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 12:48 AM
That can be solved by introducing a 2nd Flow (flag) variable which will control whether Task 2 should still be created or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2024 08:50 PM
@-O- I tried the flow but I get the error "No Record Found" on step 11 (Look up). This error stops the flow to move forward.