Retry error handler
4 min
when a hits an error, the default behavior is often to simply stop the retry error handler allows you to pause a failed bundle, store t he error message, mappings and the remaining flow depending on the retry error handler settings, retries the incomplete either automatically or manually when to use it use the retry error handler when you want to pause and potentially retry the failed run rather than just skipping or rolling back for example a new order is placed and triggers a scenario tim uses make to write the order data to the database the database write fails due to a temporary connection issue he adds the retry error handler which pauses that bundle and stores the error, the order data, and the remaining scenario flow as an incomplete execution make continues processing any other orders in the queue make automatically retries the failed bundle after a set interval (e g 3 attempts, every 15 minutes) until the database connection is restored and the entry is successful once the database write completes, the confirmation email is sent as normal for more information about error handling strategies check the overview of error handling docid\ sn7mce4qml q6wdtoocsy how does the retry error handler works the retry error handler acts as a time out corner for a problematic module instead of stopping the whole , the retry handler pulls the failing bundle out of the flow saves exactly what went wrong, including the error message and the data that caused it processes the rest of the modulesin the flow automatic retry is most effective for temporary errors or errors where another attempt might be successful automatically retries the most frequent temporary errors, the connectionerror and ratelimiterror you don't need the retry error handler to automatically retry these types of errors to automatically retry the connectionerror and ratelimiterror , you only need to enable incomplete executions in scenario settings you can read more about automatic retry in the article about incomplete executions docid 6zznn7v35herrcjfccp9q to use the retry error handler in your , you have to enable incomplete executions in settings use the retry error handler in this example, we have a scenario that updates a data store and then sends a slack message if the data store update fails because of a missing value (a bundlevalidationerror ), a slack message will never be sent this demo contains five modules json parse json provides test data in the form of an array of ten record ids iterator splits the array into individual bundles data store update a record updates the data in the data store data store update a record this module updates the data again this time the module works differently in the module mapping, there is a mapping that intentionally creates an error the mapping inserts a null value into the required key field, which always creates the bundlevalidationerror slack send a message sends a message to a private testing channel this is how the example looks when we run the example , we would get the bundlevalidationerror let's see how to handle this error using a retry error handler right click the data store module that failed and click add error handler from the list of error handlers, click retry configure the automatically complete execution by toggling between yes or no if you set it as yes , the system automatically retries depending upon the the number of attempts and the interval (e g , try 3 more times, every 15 minutes) if you leave this as no , the error will stay in your incomplete executions tab until you resolve it in the bottom panel, click the scenario settings in store incomplete executions , select yes click save you've successfully added the retry error handler to your what happens when you run the scenario after you add a retry error handler here, we added the retry error handler to the update a record module, the retry error handler would remove the bundle from the flow when an error occurs in the data store module, issues a warning and creates an incomplete execution the incomplete execution contains the error message, mappings and data would then process the remaining bundles in the flow you can finish the run in the incomplete executions tab manually or can finish the run automatically if you use the automatic completion, attempts to finish the automatically