How to pass arguments back and forth between two sequences?

Hello guys, I am currently developing a process which involves going back and forth between two files.
The reason I am doing it this way is because I will have multiple “Sequence 2” files - each one is tailored to my clients needs, and the robot picks the file based on the client ID. However, the process has to come back to the main with the newly generated information - this will finish off the rest of the process in the main. Attached is an illustration of what I am trying to do. argumentflow.pdf (19.8 KB)

I COULD make a process for each individual client, but as you all know it would defeat the DRYS principle.

I’m not sure if I understand the question, but you can invoke Sequence2 from Main using the Invoke Workflow File activity. When you do that, you can pass and receive the arguments that you want from Sequence2.

Since you have different Sequence2 workflows, the correct one would have to be chosen according to some condition. To do that, you can either use a dynamic file name in the Invoke Workflow File activity or you can use something like a Switch to invoke the appropriate workflow.

Thank you Mateus. I initially tried that, but for some odd reason it sends me in a loop. So my main has the “Invoke File” - no arguments to import, just invokes “Sequence 2”. On “Sequence 2”, the first thing it does is invoke the main, in order to import the arguments and set the variables. How would I keep this from looping?

Hi , use switch activity
In the condition of the switch activity use the variable which is carrying client ID
Create multiple cases for each client ID output
And use invoke workflow of that client ID’s of sequence 2 files

But you don’t need to invoke Main just to import the arguments in Sequence2.
You can just use IN/OUT arguments in Sequence2, call Sequence2 from Main and then modify the values in Sequence2. Those changes will be reflected in the variables in Main.

Please take a look at this sample to see if it helps: (3.2 KB)

Okay that worked. Last thing is steps 5 & 6. So On Sequence 2, I generate a tracking number to stick back into the Main; however, it needs to start where it left off, not from the very begining of Main’s sequence. Is this possible? From what I am seeing, starting a third sequence would be the thing. I’d just move the arguments from Main and Sequence 2 into it.

Once the execution of Sequence2 ends, it goes back to Main and continues from after the Invoke Workflow activity, not from the beginning of Main.

1 Like

Working, thank you!

Hello @Mateus_Cruz,

I ran into a similar scenario, and wanted to ask if you could please point me in the right direction too:

In my case, I have to iterate through multiple files in a folder in workflow file #1 and have to pass around 6 arguments from each file from workflow file #1 to the next workflow file #2.

I can do it if there was only 1 file in workflow file #1.

But I cannot seem to figure out how to do same when you have multiple files.

Thank you!