How to trigger workflow from business rule & it should only run when its triggered from business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 08:14 PM
Hi all,
I have created one custom application (similar to service request) in this, I have created one workflow but it should run only when its triggered from business rule, it should not run when the ticket is created or updated in the custom application.
Please help me with this.
Thanks in advance!!
- Labels:
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 08:30 PM
Hi you can try the below script from BR
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), current, 'update'); // replace the wf name
Also you can refer OOB Business rule called "Start Workflow". go to BR search by name "Start Workflow"
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:17 PM
Hi Harish please tell us which BR is use here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 08:40 PM
1. In the workflow property and conditions, make sure no conditions are defined to trigger workflow automatically.
2. Use the script below to trigger it from business rule
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), current, 'update');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 08:41 PM
Hi,
Why to trigger the workflow only from BR?
Anyhow BR would run on insert/update of the custom table
Can you explain your business requirement here?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader