- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 05:31 AM
Hi All,
I want to trigger sub-workflow using script.
Example: I have Workflow A and Workflow B
1. Workflow A is currently running and there is one run script activity in the Workflow A
2. I want to trigger the Workflow B from the Workflow A run script
Please guide me on how to do that or please provide any script to active this
Thanks
Ramesh R
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 05:38 AM
Hi,
This is the sample script to trigger workflow from script
var inc = new GlideRecord('incident');
inc.get('number', 'INC001');
var wf1 = new Workflow();
wf1.startFlow(wf1.getWorkflowFromName('give the workflow name'), inc, 'update');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 05:38 AM
Hi,
This is the sample script to trigger workflow from script
var inc = new GlideRecord('incident');
inc.get('number', 'INC001');
var wf1 = new Workflow();
wf1.startFlow(wf1.getWorkflowFromName('give the workflow name'), inc, 'update');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 06:00 AM
Hi Ankur,
Thanks for the help.one more question
is that possible to pass some value while starting the workflow from the script .?
Thanks
Ramesh R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 06:13 AM
Hi,
yes you can pass information to the calling workflow using this
check the approach I shared in below link
Trouble Accessing variables from inbound action
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader