How to stop the current execution and restart the flow again if the state is reverted back?

Ankita Kolhe
Tera Contributor

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):

AnkitaKolhe_0-1776229588592.png

 

Modified Run trigger : Every update:

AnkitaKolhe_1-1776229662558.png

 

Wait for condition step:

AnkitaKolhe_2-1776229755226.png

 

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:

AnkitaKolhe_3-1776229993019.png

 

 

Thanks,

Ankita

 

 

 

1 REPLY 1

Naveen20
ServiceNow Employee

 

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.