Iterate over Parameters to trigger Workflow Executions in a Loop - For loop - Parametrised Executions

Posted over 4 years ago by Antonio Poggi

Antonio Poggi
Antonio Poggi Admin

We've recently made public a couple of Workflow API methods to get and set project parameters :  https://help.visokio.com/support/solutions/articles/42000073133-workflow-rest-apis 


You can explore and test the API in Omniscope by navigating to the Swagger embedded page on any project , e.g. here on our public sandbox


What these API methods allow, apart from automating, controlling and triggering execution from another software / app, is the ability to run parametrised executions in a loop.

Imagine you want to execute the same main workflow for each value in a sequence, which is used to set a project parameter upon execution. You can exploit the "set param" and the "execute workflow" methods to do so.


For the sake of demonstrating this, here's attached a simple custom block that allows you to iterate over a series of values - read from the block input - to set a project param and trigger a series of parametrised workflow executions.  (N.B. you can import the custom block on your end)



In the above picture the custom block is reading 20 rows from its Field Organiser block input, iterating on them to set the project param called "Region" and triggering a workflow execution on the "MainWorkflow.iox" project. The MainWorkflow project has a workflow with the "Region" project parameter used in a block (Record filter in the example) to control the data flow. 


You can configure parameters anywhere in your workflow, from file paths, to database table names, to record filter rules and any other configuration really.


Furthermore, you can set those params even from a Report using a custom view: imagine having your report user exploring data and at the same time being able to click on a menu to set a param and trigger a workflow execution which uses that param anywhere (even in your Custom Python script!) to refresh the same or another report. Possibilities are kinda infinite.


Please get in touch if you'd like to bounce some ideas.




0 Votes


3 Comments

Sorted by
Antonio Poggi

Antonio Poggi posted over 4 years ago Admin

... on the same series, another use case possible thanks to the Workflow API and Custom View, see how you can have a Parametrised workflow execution triggered from Report


0 Votes

Antonio Poggi

Antonio Poggi posted over 4 years ago Admin

...and the "ForEach" block is now available in Omniscope Evo under the Community section https://help.visokio.com/support/discussions/topics/42000006554 

0 Votes

Antonio Poggi

Antonio Poggi posted over 1 year ago Admin

and now we have a For Each core block that simplifies the set up and allow iterative executions within the same workflow.


Here's an example comparing / exploring several survival analyses running on different subsets and / or using different models : https://public.omniscope.me/Public/Analytics/Survival/Survival+Analysis.iox/ .
You can check the report that visually explores the data and compares the different runs.

0 Votes

Login or Sign up to post a comment