Passing variables between 2 work flows


I would like to know how to pass variables between 2 work flows. I am creating some variables in work flow A and I can pass them to work flow B using invoke work flow file, but at the same time I want to pass variables from work flow B to work flow A. Can anyone help

Hi @hassan.dabour ,

We can create arguments to pass variables from one work flow to another. For each argument have direction in, out, in/out based on the scenario we can use this direction for the arguments.

For suppose if you create three variables X,Y and Z in work flow A. We can create three arguments in B work flow like if all are in direction only in that case we have to create arguments like in_X, in_Y, in_Z so we can assign the X,Y and Z variables in three arugments so variables can pass between two work flows.

If you want to create any variable in B and want to use it in work flow B you can careate it as argument for suppose out_W as out argument and assing this argument to the output. make sure that vafiable and argument should be in different name the best practice is based on the direction we can give name like in_Argument1, out_arument2, in/out_Arument3 etc. Please refer the below links for more guidance. thanks.

Hello Kirankumar,

Thank you so much for your reply
What you said is just exactly what I i did and it works fine. Additionally I want to pass some variables from work flow B to work flow A. When I do invoke workflow file to work flow A, it doesn’t work.


Hi Hasan,
Three types of the passing of information are possible from one workflow to another. They are
Variable from workflow 1 → Argument of workflow 2 (or) vice versa
the argument of workflow 1 → variable of workflow 2
The argument of workflow 1 → argument of work flow 2 (or) vice versa

we should remember only one thing while invoking workflows
we should import variables or arguments from one workflow to another by using invoke workflow method to pass the information between one other
out_argument is used to send data from the current workflow to another workflow
in_Argument is used to receive data from another workflow to the current workflow.

Hope this helps :slightly_smiling_face: