How to Cancel the Existing Execution in the Sub Flow to keep only one Active Execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi Community! I am having a concern in cancelling the existing flow executions to keep only one execution run for the same record. My requirement is, In CSM, I need to call the Sub flow from the After BR when a field changes in the Account Record. I am passing Account data as inputs to the Sub flow. So whenever the sub flow triggers, it should check if there are any flow contexts are running to cancel them and keep the existing flow execution. I am giving conditions as below:
Action: Look Up Records
Table: sys_flow_context
Under the conditions,
Name: [MY_FLOW_NAME],
state: Waiting,
Source Table: sys_script
Source Record: [BR_SYS_ID]
Created By: [INPUTS_logged_In_user]
By this I am able to cancel the Flow executions which are created by the logged in user. But If any other user created for the same account, I am not able to cancel them so that I can keep only one execution in the wait condition. Else if I remove the Created By condition, it is cancelling all the flow executions created by Script. Or If I keep the created by condition, it is cancelling all the flow executions created by the user no matter for which account it is? So I want to add condition based on Account so that I can filter if there are any ongoing executions to cancel them and can keep the latest execution in waiting state. Can you please help me how to add the Account condition or filter to the sys_flow_context table/or to my existing conditions? Thank you.