Enhancing Error Handling for API Data Retrieval in Alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Alteryx Community,
I’m seeking advice on improving the resilience of an API data retrieval macro in Alteryx. The process involves an API endpoint limited to 1000 records per request, authenticated with a bearer token that expires every 599 seconds.
The macro, configured with inputs for token expiration (“item expires”), the token itself (“item access token”), and the endpoint URL, works well under typical conditions. It logs in, captures the token details, and fetches data in chunks. However, during extended runs for larger data sets (around 15 minutes or 130 iterations), it fails without gracefully handling what appears to be network hiccups, leading to an abrupt end of the macro and parent workflow.
Currently, the macro lacks robust error handling, and Alteryx’s debugging features have proven inadequate for capturing the network error messages, making troubleshooting challenging.
I aim to achieve two key improvements:
1. Implement a retry mechanism that attempts to re-fetch data up to three times in case of a failure before stopping.
2. Enhance error visibility within the parent workflow to simplify debugging.
Any guidance on capturing network errors, improving error handling, or on the retry logic within the Alteryx environment would be invaluable.
Thank you for your support.
Best,
Greg
- Labels:
- API
- Batch Macro
- Error Message
- Iterative Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Test to see if a you are receiving a 200 response - and if not build appropriate error handling. assuming there is some form of incremental changes to what you are pulling in your api range (ie an offset) - prior to increasing the offset - test that the last call was a 200. If it wasn't retrieve a new token - and retry - if not - loop your increment. use multiple macro output tools to capture response types.
