Invoke Workflows and Arguments over several levels

If you have several levels of Invoke Workflows what is the best way to pass the argument from the top level to the bottom?

So e.g. I have:

  1. Invoke Workflow 1, which contains:
    ‘Variable 1’ containing the string.

  2. Invoke Workflow 2, which contains:
    ‘In Argument 2’ that uses ‘Variable 1’ from above for the Value.

  3. Invoke Workflow 3.
    ‘In Argument 3’ that uses ‘In Argument 2’ from above as the Value.

Is this the best practice? Or instead should i be creating as follows:

e.g.

  1. Invoke Workflow 1, which contains:
    ‘Variable 1’ containing the string.

  2. Invoke Workflow 2, which contains:
    ‘In Argument 2’ that uses ‘Variable 1’ from above for the Value.

At this point do i then need to assign ‘In Argument 2’ to a ‘Variable 2’ and then use ‘Variable 2’ as the value for the ‘In Argument 3’?

  1. Invoke Workflow 3.
1 Like

I suggest avoiding several levels of Invokes if at all possible. The best practice is to be simple and to be organized.

Each workflow (most of which would probably be re-usable modules) should perform an individual task. So, using this practice, it would be rare that you would have multiple inner Invokes.

But, I suppose it depends on what you are trying to do…

In my opinion, if you have to go through a Labyrinth to navigate your code, that is a bad thing.

However, to your point…
You would set up your Arguments to get the values from the original workflow. And, you would use Variables to manipulate the arguments if needed to be used in the workflow.

For example,
Workflow 1 with Variable1
Invoke Workflow 2 with in_Argument1
Invoke Workflow 3 with in_Argument1

Therefore, the same value gets sent to each argument.

I probably explained that poorly, but basically just keep it simple.

Regards.

1 Like

Buddy @jon1302

Buddy its all based on the situation, but both are valid at their own situation like this
for example
if your ultimate thing is to get the value from first workflow and use the same in all the workflow go for the first option as that would be simple enough and it wont make it complicated, which is what is needed…
but
if you want to process the variable1 in second workflow (invoke workflow -2), getting output of it and pass that to the next workflow as (invoke workflow -3) and thus each workflow will be getting different input - in that case you can go for the second option buddy, but you must change the direction of the in-argument 2 in second workflow as both in/out

Thats all buddy you are done

Hope this would help you
Cheers @jon1302

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.