- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 07:46 AM - edited 09-07-2023 07:47 AM
Hello,
I am working on a Flow for a HRSD Process. I have an lifecycle event which has an HR service configured to go through a process. The HR service is configured to just create a new Case and the Flow will take it from there. Once the case is created, the Flow is supposed to be triggered base on the HR Service that created that case. and it should run the actions I will add. I have configured my flow to trigger on a created, with the condition of the HR service being the one in the lifecycle event. When I test the Flow in the designer, it seems to reach the case and goes through the actions. When I activate the flow it it not triggered at all.
Some Trouble Shooting: I noticed that when I pick a case that does not meet the condition, the flow also excutes which is making me wonder if my trigger is not setup correctly.
Please see pictures and advise how I can solve this issue.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 10:24 AM - edited 09-10-2023 10:27 AM
@mlamin Since your flow is not triggering on the case creation on its own, there is a workaround to fix this issue which can be applied.
1. As a part of the first step, you can create a business rule on HR Core case table (sn_hr_core_case) and it should be onAfter Insert business rule. Add a condition where HR Service is <Your HR Service Name> this will make the business rule to trigger only when the HR Service is the Service where you would like to trigger the flow.
2. In step 2, before moving on to the Advanced tab, open the flow designer in a separate tab and open your flow.
3. Open the context menu and choose Create code snippet option.
Put this code in advanced tab of the business rule created in step 1.
Since you need to provide the current record as input in the flow, make the following changes in the script.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
(function() {
try {
// Start Asynchronously: Uncomment to run in background.
// sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow').inBackground().run();
// Execute Synchronously: Run in foreground.
var inputs = {};
inputs['current'] = current; // GlideRecord of table:
inputs['table_name'] = current.getTableName();
sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow',inputs).inForeground().run();
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
})(current, previous);
Make sure to replace flow name in the following line here it is mentioned as sample_flow
sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow',inputs).inForeground().run();
Save the BR and create another case to see if the flow triggers.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 12:06 PM
@mlamin The flow as an activity will make the call to trigger the flow. Are you not seeing the flow get engaged after you have it as the fulfillment?
Regards,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 12:42 PM
@michaelj_sherid No I am not seeing the flow get engaged. I have an activity, which is a HR service and I have the HR Service as a fulfillment which is where I have the flow. Please advise if that is correct.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 10:24 AM - edited 09-10-2023 10:27 AM
@mlamin Since your flow is not triggering on the case creation on its own, there is a workaround to fix this issue which can be applied.
1. As a part of the first step, you can create a business rule on HR Core case table (sn_hr_core_case) and it should be onAfter Insert business rule. Add a condition where HR Service is <Your HR Service Name> this will make the business rule to trigger only when the HR Service is the Service where you would like to trigger the flow.
2. In step 2, before moving on to the Advanced tab, open the flow designer in a separate tab and open your flow.
3. Open the context menu and choose Create code snippet option.
Put this code in advanced tab of the business rule created in step 1.
Since you need to provide the current record as input in the flow, make the following changes in the script.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
(function() {
try {
// Start Asynchronously: Uncomment to run in background.
// sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow').inBackground().run();
// Execute Synchronously: Run in foreground.
var inputs = {};
inputs['current'] = current; // GlideRecord of table:
inputs['table_name'] = current.getTableName();
sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow',inputs).inForeground().run();
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
})(current, previous);
Make sure to replace flow name in the following line here it is mentioned as sample_flow
sn_fd.FlowAPI.getRunner().flow('sn_hr_core.sample_flow',inputs).inForeground().run();
Save the BR and create another case to see if the flow triggers.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 07:22 AM - edited 09-11-2023 07:23 AM
@Sandeep Rajput Thank you for the assistance! That was the issue and I was able to trigger my flow with the BR setup. I was not aware of the code snippet. Thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 07:29 AM
Glad it worked for you, also don't forget to upvote my answers, it encourages me to write such descriptive answers.