We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Parallel Flow Launcher / Subflow Variables

dbaril
Tera Expert

I have questions regarding variable handling within a subflow called from a Parallel flow launcher.  Following are the scenarios I need clarification on.

 

Input Variables: Within Workflow Editor, I see an option for "Edit Inputs" to define these variables.  This is pretty straight forward and I understand how to pass these variables from the Parallel Flow Launcher and reference them as input.varialble_name from the subflow.

 

Output Variables: The documentation mentions referencing output parameters as output.varialble_name from the subflow, however I don't see any option in the workflow editor to define output parameters.  Are these dynamically created just by referencing them by name?  If not, where do I create the output variables?

 

Work variables: I need to keep track of some variables within the subflow, how would I do that?  If I use workflow.scratchpad is that specific to the subflow instance executing?  If the scope is the parent workflow, and all subflows, this is not a viable solution.  I need variables specific to the subflow instance.

 

 

2 REPLIES 2

Matthew_13
Mega Sage

Hey Buddy,

Inputs in legacy Workflow Editor subflows are exactly like you described — define them under Edit Inputs, pass them from the Parallel Flow Launcher, and reference them as input.<name> inside the subflow.

For outputs, that Flow Designer-style output.<name> guidance doesn’t apply to Workflow Editor. In legacy workflows you don’t “define output parameters” anywhere in the editor. If you need to pass data back to the parent workflow, you do it via the Return Value activity. That’s the supported way to return something from a subflow launched in parallel. If you need multiple values, return a single object/string payload (ex: JSON) and unpack it in the parent logic.

For work variables, you can absolutely use workflow.scratchpad inside the subflow. It is tied to the workflow context of that specific execution, so each parallel subflow run gets its own scratchpad state — you won’t have different parallel branches overwriting each other unless you intentionally write to the parent workflow’s context. Use scratchpad for values you need across multiple activities in the same subflow, and local script variables for values only needed inside a single script activity.

 

@dbaril - If help you answer, Please mark Accepted Solution.

MJG

Tanushree Maiti
Giga Sage

Hi @dbaril 

 

Go through this community post. It will help you.

Parallel Flow Launcher Activity on Catalog Items - ServiceNow Community

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: