How to run the same flow for two (or more) sets of variables

Status: Open · Asked by Anders Nielsen on · 0 views

Anders Nielsen — Question ·

Please check this screenshot. So what I would like to do is I am running a flow I need to run twice - and the only difference between these two runs are two variables

Company ID in accounting program (GET)
And subfolder I upload invoices to (POST)

Basically I get invoices from company A
And I post the invoices in a Company A folder
And I rerun the same just with company B

I realize I can duplicate my entire flow and just change those two variables. However that's quite inefficient and it's not very practical for easy maintenance.

So I wonder can I in the beginning of my flow define those two variables and then have an iterator that first runs the entire flow using the first set of variables and then afterwards reruns the same flow using the different set of variables.

Arshil Ahmad — Reply ·

Hi @apps,

To achieve this use case, you would need to add a Router to your workflow with two routes. Both routes should have the same filter conditions. Then, add the steps related to Company A in Route 1 and the steps related to Company B in Route 2. Essentially, both routes will execute each time the workflow is triggered.

Anders Nielsen — Reply ·

No that still means I have to duplicate all steps among 2 router paths. It's this I want to avoid. Because if I need to change on thing I have to redo my changes in both routers. That is the issue.

Can't I use an iterator to run all steps after with 2 different sets of variables? Only having the flow once.

Anders Nielsen — Reply ·

Hi ArshilAhmad,
Thanks, this is exactly what I meant! However I have have two sets of variables - not just 1 set.

I need it like this:

Run 1:
- apikey = abc
- subfolder id = 123

Run 2:
- apikey = xyz
- subfolder id = 741

How can this be accomplished?

Anders Nielsen — Reply ·

Ahhh awesome thanks ArshilAhmad! It looks like something like this could work! And I see how I can add multiple variables as well. Will implement and will let you know if I have any problems!

Thanks again!

Anders Nielsen — Reply ·

Hi ArshilAhmad,
I have to return again and say this solution is working perfectly! Really this has so many usecases. I can really simplify many of my flows based on this! Makes maintenance so much easier for all my Pabbly flows! Thanks so much!

Arshil Ahmad — Reply ·
Hi ArshilAhmad,
I have to return again and say this solution is working perfectly! Really this has so many usecases. I can really simplify many of my flows based on this! Makes maintenance so much easier for all my Pabbly flows! Thanks so much!

Thank you for the update. Glad we were able to help.

Back to all forum threads · Log in to reply