Passing values

Hello. I have an workflow (main) thats invoking another workflow (main.1) . In workflow (main.1) i have a flow decision thats causing an error upon invoke ( i know the reason) I want to pass a value in here from the workflow(main) but some topics says that its a bad habit to use invoke workflow inside a already invoked workflow. main%20invoke%20workflow%20function inside%20the%20invoked%20workflow

1 Like

Hi @langsem

That’s not true. In any programming language we use best practices. And one of them is to separate out code that can be repeated into separate files and call them where neccessary. This also helps to look and understand the files we have easily. I really don’t believe that it’s bad to call other work flows within other called workflows. It’s a good way of maintaining the workflows. And also simplify the architecture. Like other languages, UiPath also has best practices. We have to always follow them as good developers.

So I suggest irrespective of what you saw in whatever the posts you read, please use separate workflow files to workflows that can be repeated anywhere. And call those workflows in locations you need. This doesnt have a limit like you should not call them from a already invoked workflow. If it is necessary please call them within. There is no problem in doing that. As an additional note, UiPath REFramework also does the same. Which is really good.

So please stick to those good practices :slight_smile:


Hi @langsem
no not like that buddy
we can use nested Invoke workflow activity
but we need to make sure that the argumenst are passed correctly between them with right direction

Cheers @langsem

1 Like

should i use action invoke workflow file ?

1 Like

Invoke workflow file activity can be called within another Invoked workflow buddy (i.e., inside another invoke workflow file activity)
Cheers @langsem

So this its not wrong ?
THats inside the already invoked workflow.
And i am extracting just a value from the workflow thats invoking this workflow

yah nothing wrong in it buddy
Pls go ahead
Cheers @langsem

hm dont seem to work, what its doing now its that as soon as the invoked workflow takes action it goes back to the workflow that it was already on. I want it to keep moving in the invoked workflow ( just extract the value it needs from the previous one and the procced with the functions in the invoked workflow)

As you see in the image, the red circle its the previous workflow( also the workflow thats invoking the one i am in now, blue circle) The blue circle its the workflow that has been invoked, the invoke function inside the workflow its the initial red circle workflow( but i dont want to open this workflow before the other functions below its executed, i only want to extract a variable form the previous workflow (red circle)

Then you can pass the arguments along here to this invoked workflow
and there would be no need to invoke it again

hm did not work.

Here to give you a better overview main1

THats the workflow thats been executed (main1)

THats inside the exectued workflow (main1)

I want only to extract a certaint value from the previous workflow and pass it into the flow decision, then go back to the previous workflow when all of the functions underneath are executed