
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2020 03:21 AM
HI friends,
I want to trigger a workflow from inbound action. Can some one give me the lines of code plz.
i seen this link, but i am doubtful that how can we use workflow sys id as it changes every time we checkout and publish. So how to do this?
Also tell me how to get the sys id of a workflow.
Thanks in advance
Regards,
Indup
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2020 03:27 AM
Hi,
use below script; give your workflow name
var workflowRec = new Workflow();
workflowRec.startFlow(wflw.getWorkflowFromName('give the workflow name'), current, 'update');
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
09-13-2021 06:03 AM
Hi,
can you post a new question for this as this is quite older thread?
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
04-06-2020 10:55 AM
Ankur,
If I am getting variables from the email body in my Inbound Action like in this example:
var userInitials = email.body.initials;
var branch = email.body.branch;
How can I pass those variables to the workflow and use them in it if I am calling the workflow from a script?
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2021 07:27 AM
Hi Ankur,
I am doing the same but it is not calling the workflow, Can you help me what could be reason.
I have added above 2 lines as it is with workflow name.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2020 03:29 AM
Hello,
It refer the below blog it will give you proper understanding of how do it .
https://community.servicenow.com/community?id=community_blog&sys_id=c25da629dbd0dbc01dcaf3231f961933
Mark my ANSWER as CORRECT and HELPFUL if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2020 03:33 AM
Hi there ,
follow this :
hope this helps !
Regards,
Apeksha