Send Mail via Webhooks with Error Handling
Developer ToolAPI IntegrationMarketingRecipe Tools
What it does
When a placement is created via HTTP webhook, this automation monitors the task request and retries up to three times if it encounters a 408, 500, or 400 error. If the error persists after retries, the job stops and logs the failure to the job report.
Who it's for
Operations teams who need reliable mail delivery with automatic retry logic and error visibility.
How teams use this
Retry failed mail requests automatically
When a task request fails with a transient error like 408 or 500, the automation retries up to three times before giving up. This reduces manual intervention for temporary network issues.
Route errors to a monitoring system
Extend this automation to add a step that sends persistent errors to a dedicated error channel or monitoring tool so the team can triage failures in one place instead of checking logs.
Handle different error codes separately
Modify the conditions to retry only on 408 and 500 errors, but stop immediately on 400 errors since those indicate a bad request that retries will not fix.
How it works
- Receive placement via webhook. A placement is created in real time through an HTTP webhook, which starts this automation immediately.
- Request the task via HTTP. Get the task via HTTP and wait for a response. If a 408, 500, or 400 error occurs, the monitor block retries the entire request up to three times before proceeding.
- Process the response data. Execute JavaScript code to parse and transform the HTTP response data into the format needed for the next step in the workflow.
- Log the outcome. If an error persists after all retries are exhausted, log the message to the job report and stop the job so someone can investigate the failure.