Flow Designer parallel tasks closed skipped if specific question is answered no
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Good morning,
I have a flow that I have 6 tasks that are worked in parallel. There is a select question on each task that has 3 options, Yes, yes with comments and no with comments.
the field names are
approved_by_ops
| approved_by_it_infrastructure |
approved_by_asset_management
approved_risk_mgmt
approved_by_grc
| approved_by_is_security |
If any one of the above questions answer no with comments. I need the remaining open tasks to automatically close skipped.
I cant come up with a good solution to make this happen. Any thoughts would be greatly appreciated.
- 724 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Darlene York ,
You can use Trigger
Table: sc_task
Conditions: Any of the six variables is No with comments
Than in the actions you can use the Lookup Get Records on sc_task with:
request_item = Trigger.current.request_item
sys_id != Trigger.current.sys_id
state NOT IN Closed Complete, Closed Incomplete, Closed Skipped
For Each result:
Update Record: set state = Closed Skipped, set close_notes with a reason.
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You,
Sujit Jadhav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Jadhav,
Thank you for your response. Do I put your solution at the end of my parallel loop or in each task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Yes, you can add at the end of the loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
The challenge with parallel branches in Flow Designer is that they are "isolated" by default. Branch A doesn't naturally know what is happening in Branch B until they all converge at the end. To make one branch "kill" the others, you need a shared listener.
The best approach is to use a Wait for Condition combined with a Flow Variable.
The Strategy: "The Kill Switch"
You should not put the solution only at the end of the loop, nor is it a simple setting inside each task. Instead, you wrap your parallel tasks in a logic flow that monitors a "Master Status" variable.
1. Define a Flow Variable
Create a Flow Variable (e.g., va_termination_triggered) and initialize it to False.
2. The Task Wrapper (Apply to each of the 6 branches)
In each of your 6 parallel branches, you need to structure the task like this:
Create Task: Standard setup.
If "No with comments": * Set the Flow Variable va_termination_triggered to True.
Note: This acts as the signal for everyone else.
Wait for Condition (On the Task Record):
This is the "Listener." You want this step to proceed if the task is completed OR if the va_termination_triggered variable becomes True.
The "Auto-Close" Mechanism
Since Flow Designer doesn't have a native "Cancel other branches" action, you need a small Subflow or Inline Script to handle the cleanup.
Here is the logic flow for each branch:
Parallel Block starts.
In Branch 1:
Action: Create Catalog Task (IT Infrastructure).
Action: Wait for Condition (Wait until Task 1 is Closed OR va_termination_triggered is True).
Decision: If va_termination_triggered is True AND Task 1 is still Open:
Action: Update Task 1 record -> State = Closed Skipped.
Repeat for all 6 branches.
Why this works
By using a Flow Variable, you create a "Global" state within that specific flow execution.
As soon as the Asset Management person selects "No with comments," the variable flips.
The "Wait for Condition" steps in the other 5 branches will immediately re-evaluate.
They will see the variable is now True, proceed to the next step, see that their specific task is still open, and flip it to Closed Skipped.
Where to put the solution?
You put this logic inside each branch of the parallel flow, immediately following each task creation.
An Alternative: The "Subflow" approach
If you want a cleaner looking Flow:
Create a Subflow called "Manage Parallel Approval Task."
Pass the Task Details (Group, Question name) as inputs.
Inside the subflow, handle the "Wait" and "Close Skipped" logic.
In your main flow, simply call this Subflow 6 times in parallel. This keeps your main canvas from becoming a "spaghetti" of 30+ steps.
