Send variables to a subworkflow | Community
Skip to main content
CampaignerForLife
Level 5
March 22, 2023
Solved

Send variables to a subworkflow

  • March 22, 2023
  • 1 reply
  • 683 views

Is there a way to send variables to a subworkflow? 

 

Like for example, I generate a variable a = 1 in a workflow, then call a subworkflow that takes A value and adds 5 to it. Is it possible? How can I do it?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manoj_Kumar_

Hello @campaignerforlife 

 

In your main wf define the variable like this:

vars.mainWFVar=1;

Master WF:

 

Then in the Sub-workflow you can use the same variables to add values to it:

vars.varfromMainWF = vars.mainWFVar + 5; logInfo(vars.varfromMainWF)

Sub-workflow

 

And if you start the mast WF you see the updated added in the logs:

 

 

 

1 reply

_Manoj_Kumar_
Community Advisor
_Manoj_Kumar_Community AdvisorAccepted solution
Community Advisor
March 22, 2023

Hello @campaignerforlife 

 

In your main wf define the variable like this:

vars.mainWFVar=1;

Master WF:

 

Then in the Sub-workflow you can use the same variables to add values to it:

vars.varfromMainWF = vars.mainWFVar + 5; logInfo(vars.varfromMainWF)

Sub-workflow

 

And if you start the mast WF you see the updated added in the logs:

 

 

 

     Manoj     Find me on LinkedIn