Newer to Alteryx...
I have a workflow that calls an API and currently works.
I am now going back to take out hard coding and parameterize everything.
The first part of the process gets a token to be used later in the actual API call.
The token is valid for 60 minutes.
1. I would like to include the token timestamp in the input file at the beginning.
2. Evaluate the token timestamp
a. If the token timestamp is less than 55 minutes old, then reuse the token.
b. If the token timestamp is greater than 55 minutes then get a new token
i. In this path, the token timestamp in the input file needs to be updated/saved with the newly retrieved token timestamp
How would this normally be done in Alteryx? I basically need to update and save the input file based on logic in the workflow.
BTW, the input file also has other fields such as URL, Client Credentials, etc that are not updated by the workflow.
Let me know if you need more details.
Have you looked into the detour tools?
I would recommend having a process which evaluates the token timestamp and creates a flag to signify whether your token is less than 55 minutes old.
This can then be used as a control parameter into a batch macro, where you can update a detour tool:
- If the flag="Y" (token less than 55 minutes) then it proceeds onto the rest of your processing
- If the flag="N" (token too old) then it switches the detour to include the processing to generate a new token
The inside of the macro might look something like this:
Hope this helps!
I will look at this and see if I can get it to work for me. I will reply later and update this post.