- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2020 01:35 PM
Can flow designer detect a change in field value for the purposes of restarting the entire flow? We have a requirement that any time the Due Date value changes on our record, the flow should restart so that it can re-evaluate which state it should be in based on a script. I currently have the Flow designed to trigger any time a record is created or updated, and the Due Date changes and isn't empty. My fear is that the Flow will create a new instance of Flow each time the record is updated, without cancelling the old flow.
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 05:41 PM
hi
One approach is to have your main flow to trigger 'Only if not currently running'.
Then have a before business rule to trigger when the 'Due Date' changes. The BR script will cancel the existing workflow(s).
Your main workflow will then trigger again as it is not currently running:
example:
before business rule calls a flow designer action on Due Date change (code grabbed from flow designer code snippet):
(function executeRule(current, previous /*null when async*/ ) {
try {
var inputs = {};
inputs['sourcerecord'] = current; // String
// Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.
var result = sn_fd.FlowAPI.getRunner().action('global.cancel_flow').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();
// Current action has no outputs defined.
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})(current, previous);
Flow designer action looks up records on the sys_flow_context table that matches incident record:
For each record run the script to cancel:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2020 09:45 AM
thanks but I ended up figuring it out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 11:53 AM
Can you describe your soultion?
I have some of the same issues with waiting for a condition before continuing the flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2020 02:25 PM
I ended up creating a subflow to look up all the catalog tasks on that RITM. Then did a wait for condition on them all to be State Is Closed Complete or Skipped or Incomplete. Then finish the subflow. That would then move to my next condition and review all the tasks one last time. Its ugly, but works for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 11:07 AM
Hey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 08:26 PM
I ended up creating a subflow to look up all the catalog tasks on that RITM. Then did a wait for condition on them all to be State Is Closed Complete or Skipped or Incomplete.