Quick Overview
This workflow makes unreliable HTTP requests safer by using Google Gemini to classify failures, retry only transient errors with exponential backoff, and log non-retriable or exhausted failures to a Google Sheets dead-letter register that is replayed nightly.
How it works
- Receives inputs from another workflow (job name, URL, method, body, and retry budget) or runs nightly on a schedule to sweep a Google Sheets dead-letter register.
- Initializes an attempt counter and calls the target endpoint using an HTTP request with error output captured as data.
- When the call fails, sends the error details to Google Gemini to classify the failure (transient, permanent, or needs_human) and recommend a backoff time.
- Tracks attempts and either waits for the suggested backoff before retrying the HTTP request or stops retrying when the budget is exhausted or the failure is not transient.
- Appends failed jobs to a Google Sheets “Dead Letters” tab with the payload, diagnosis, and any required human action, and returns a structured failure response to the caller.
- On successful responses, returns a structured success result and, if the success came from a nightly replay, updates the corresponding Google Sheets entry to close it.
Setup
- Add Google Gemini (PaLM) API credentials for the Gemini chat model used to triage failures.
- Add Google Sheets OAuth2 credentials and select the spreadsheet and “Dead Letters” sheet used as the dead-letter register.
- Create the “Dead Letters” sheet columns expected by the workflow (for example: Failed At, Job, Endpoint, Class, Attempts Used, Diagnosis, Someone Must, Payload, Status, Execution).
- In the calling workflow, use Execute Workflow to trigger this workflow and pass jobName, url, method, body, and maxAttempts.
- Activate the workflow so the nightly 2am sweep runs and can replay eligible transient failures from the register.