Calling sub-flow (flow designer) from legacy Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Friends,
I have already created a Flow designer to add details in a table. I am currently modifying a Workflow. I need to call a Sub-flow (flow designer) from my workflow ?
1. I tried using core activity Run sub-flow from Workflow.
2. I have added sub-flow inputs in Workflow in Has Inputs section through a code.
e.g. answer = {};
answer['user'] = 'sys_id';
answer['entitlement']='sys_id';
Both user and entitlement are inputs in sub-flow with reference data type.
But this gives error during execution of workflow in RITM.
Any idea to resolve this?
Any other approach to call Sub-flow from a Workflow?
Please help.
Your help will be appreciated.
Thank you,
Asmi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
share how you are calling that subflow using workflow?
may be the inputs you are passing are not of the correct type
share subflow screenshots
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you @Ankur Bawiskar for reply.
I am using Workflow Core Activity : Run Flow/subflow/action
Inside this activity, I am selecting the Subflow.
Than "Has Inputs" checkbox is selected. It enables the Script. Inside the script I am providing Sub-flow inputs. Subflow has 3 inputs
1. emp_type ------ String
2. user ------- Reference
3. software_model ------ Reference
For these inputs I am using script as:
answer = {};
answer['emp_type'] = 'Perm';
answer['user']= 'sys_id';
answer['software_model']='sys_id';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
better with screenshots
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Asmita7
In my last project we called subflow from Workflow using run script via sn_fd.FlowAPI .
https://www.servicenow.com/docs/r/api-reference/server-api-reference/ScriptableFlowAPI.html
You need to pass correct sys_id (string) for user and entitlement as input .
If you need to pass the input , you can check this video for the script on how to to pass inputs via sn_fd.FlowAPI.
https://www.youtube.com/watch?v=_P1Yz-KLrOk&t=13s