Failed Payment Retry Automation with Webhook, HTTP API, Sheets & Gmail
Failed Payment Retry Automation with Webhook, HTTP API, Sheets & Gmail
Regular price
£11.99
Regular price
£11.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Failed Payment Retry Automation with Webhook, HTTP API, Sheets & Gmail
Regular price
£11.99
Regular price
£11.99
Sale price
Unit price
/
per
Automatically handle failed payments: retry on schedule and email customers when action is needed
This n8n workflow receives failed-payment webhooks, queues retryable cases in Google Sheets, retries due payments every 15 minutes via an HTTP payment API call, and sends Gmail notifications for success, required customer action, or exhausted retries.
What this workflow does
- Receives and normalizes webhook events: Accepts a POST webhook payload for a failed payment and maps it into consistent fields.
- Prevents duplicate processing: Checks the RetryQueue tab in Google Sheets for an existing row with the same event_id. If already processed, it stops.
- Classifies the failure reason: Determines whether the failure is retryable (scheduled with delay and max retries) or requires customer action.
- Queues outcomes in Google Sheets: Appends the result to the RetryQueue with the proper status and timing.
-
Notifies via Gmail:
- Sends an email when customer action is required (e.g., update payment method).
- Sends an email when a payment succeeds.
- Sends an email when retries are exhausted (max retries reached).
- Runs every 15 minutes: Loads the RetryQueue, filters rows that are SCHEDULED, due now, and below the max retry limit, then processes each due row.
- Retries via HTTP API: Calls the payment provider’s retry endpoint using HTTP, interprets the response, and updates the same Sheets row to SUCCESS, schedules the next retry time, or marks MAX_RETRIES_REACHED.
Use cases
- Reduce lost revenue by automatically retrying retryable payment failures on a 15-minute cadence.
- Send targeted Gmail messages when a payment needs customer updates instead of wasting retries.
- Maintain an auditable retry log using Google Sheets’ RetryQueue with event_id de-duplication.
Technical details
- Trigger cadence: Executes every 15 minutes to process due retries.
- Webhook handling: Webhook node receives failed-payment events and normalizes payload fields.
- Queueing and idempotency: Google Sheets RetryQueue tab, keyed by event_id.
- Control flow: if conditions and Code nodes to classify failures and schedule retry timing.
- Payment retry call: HTTP request to the payment provider’s retry endpoint.
- Email notifications: Gmail for customer updates (action required, success, retries exhausted).
- Workflow notes: Includes sticky note guidance; uses no op where appropriate.
