We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Tools to stop macro if it runs over than 10mins

MattLi
6 - Meteoroid

Hi everyone,

 

I have a macro built on optimization tool to do some voucher matching process. sometimes, situation is way to complex, so the macro can run up to millions of years.

 

I am wondering if there is a tool we can use to track runtime of each macro run and stop the run if it run over than 10 mins and push the macro to next run?.

 

I know test tool can stop workflow based on certain condition, but I cannot find such tool exist to capture macro runtime.

 

would really appreciate if anyone could let me know about this.

 

Thank you in advance,

Matt

2 REPLIES 2
flying008
15 - Aurora

Hi, @MattLi 

 

1- If you can tell us, how many such optimization macros do you use in a workflow?


2- If there is only one optimization macro, you can do this:
a- Insert a python tool after the data source and in parallel with the macro. The python tool code checks every 3 seconds whether the temporary file exists or is occupied by other processes. If it does not exist or is occupied, it waits 3 seconds before checking again.. In this way, if the total time reaches 10 minutes, a field column containing error information will be generated, and then passed to the Message tool to let it send Error.


b- In the runtime tab of workflow'configuration, check the 'Cancel Running Wrokflow on Error.' option.


c- Add a sample tool after the macro to generate a row of records, and then send this record to the Output tool to generate the temporary file described in a above.


3- If you do this, you should be able to achieve the condition that the workflow automatically stops when the macro runs for a timeout.

OTrieger
13 - Pulsar

@MattLi 

You can define the number of iterations, so it might not be 10 minutes, but you can define that after 1000, 100,000 iteration the macro will stop. So you can define how many times the macro will try to find a match and if failing after X times stop.

Labels
Top Solution Authors