Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

How can I force a tool (Download Tool) to constantly retry until success?

Anonymous1
7 - Meteor

Hello, I have a problem where reaching our DNS server on Alteryx Gallery is so slow that it sometimes times out the download tool and causes an error. Sometimes it works, Sometimes it doesn't. I know for a fact it's latency related and not due to the host website being offline or an incorrect URL.

 

Download Tool (DNS related): "Error transferring data: Couldn't resolve host name"

 

In any case, I need a way to loop the download tool until success and then it breaks the loop and continues the pipeline. Here is an example workflow (add a row with random text in the input tool to mimic failed DNS resolution).

 

Anonymous1_0-1654630644774.png

 

 

Condition 1: Keep looping the download tool until success (no error) and break the loop to continue with the rest of the pipeline OR stop at 100 attempts.

Condition 2: Throttle each attempt with a delay of 2 seconds in-between each attempt.

 

Does anyone have advice on how to achieve this? Thank you.

5 REPLIES 5
IraWatt
17 - Castor
17 - Castor

Hey @Anonymous1,

I would look at creating an iterative macro: Creating an Iterative Macro - Alteryx Community <- check this out

IraWatt_0-1654634027834.png

Essentially the macro will keeps iterating till 100 run throughs have been made or It will stop if the header 200 (successful request) is found in the header then continue your workflow.

Any questions or issues please ask :)
HTH!
Ira

 

Anonymous1
7 - Meteor

Hi Ira,

 

Thanks for the resource, I'll take a look at it. Do you have any advice for the second condition? Where I would like to insert a small bit of delay (2 secs) between each attempt?

IraWatt
17 - Castor
17 - Castor

No worries @Anonymous1, I would use the python tool:

IraWatt_0-1654634759744.png

Just need to add these two lines: 

 

 

import time
time.sleep(3)

 

 

Sleep will stop Alteryx for the number of seconds given in the parameter.

Anonymous1
7 - Meteor

Hm, I think I should clarify that the solution I'm looking for is not per row but per download tool run:

 

Anonymous1_1-1654635366337.png

 

Will your macro & time.sleep(2) work in this scenario as well? 

 

EDIT: I realize I can just insert the delay in the macro and not at the parent workflow.

Ariharan
11 - Bolide

Hi @IraWatt , 

 

After attempting the method you suggested in your post, I encountered an issue where I could not connect to the server. Despite having only one URL, it was failing sporadically and displaying an error message indicating a connection issue. Unfortunately, the approach you suggested did not resolve this problem. Is there another solution that could help me address this issue?

 

 

Error.PNG

 

Regards, 

Ariharan Rengasamy

Labels
Top Solution Authors