How to stop the current execution and restart the flow again if the state is reverted back?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Community,
For the enhancement record, the issue is that when the revert to draft process is triggered even though the approvals are marked as no longer required the previous approval flow context does not end when the demand is set to draft again. This is because the approval action is still waiting for it to be approved or rejected. As the flow is set to only trigger if not already running, the new approvals do not trigger again.
To resolve this added a parallel wait condition to end the enhancement approval flow when the state changes to draft.
Please see the screenshots below:
Added parallel wait for condition (step 2-5):
Modified Run trigger : Every update:
Wait for condition step:
So when I reverted back the state to draft the flow didn't end (it got cancelled) and when state changed to Technical review , flow execution didn't start. The parallel step isn't working as it should be. Please help me on this:
Example:
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Root Cause: Ask For Approval is outside the Parallel block
Looking at the flow structure, the "Ask For Approval" is step 1 and the "Do the following in Parallel" starts at step 2. This means the flow blocks at step 1 waiting for the approval to be approved or rejected — the parallel block (steps 2–5) never even executes until after the approval resolves. That's why in the execution details, steps 2–5 all show "Not Run."
The Fix
Move the "Ask For Approval" action inside the Parallel block as one of the two parallel branches:
- Branch 1: Ask For Approval on Enhancement
- Branch 2: Wait For Condition (State is Draft) → End Flow
This way both branches run simultaneously. If the state reverts to Draft while the approval is still pending, Branch 2 catches it and terminates the flow. The approval in Branch 1 gets cancelled gracefully as part of the flow ending.
Why the flow didn't re-trigger
The execution shows "Cancelled" at 530ms — the flow likely cancelled because the state was already changing away from Technical Review before the flow fully initialized. Once the cancelled flow context record exists tied to that Enhancement record, the platform may not re-trigger even with "For every update" if it sees a lingering context. After implementing the fix above, this should resolve naturally since the flow will end cleanly via the End Flow action in Branch 2 rather than getting externally cancelled. If it still doesn't re-trigger, check for orphaned flow context records (sys_flow_context) tied to that Enhancement record and cancel/delete them.
