Skip to main content

Route API requests via webhook with retries and backup endpoints

Workflow preview

Workflow preview
100%
Route API requests via webhook with retries and backup endpoints preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow exposes a webhook that forwards a request to a primary API, retries once after a short delay if it fails, and then fails over to a backup API, returning a structured JS...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.respondtowebhook, n8n-nodes-base.wait, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.

Original n8n.io source

1.1 Workflow description

Title
Route API requests via webhook with retries and backup endpoints
Workflow name
Route API requests via webhook with retries and backup endpoints

Quick Overview

This workflow exposes a webhook that forwards a request to a primary API, retries once after a short delay if it fails, and then fails over to a backup API, returning a structured JSON success or error response to the caller.

How it works

  1. Receives a POST request on an n8n webhook with the primary API URL, backup API URL, HTTP method, and optional retry count.
  2. Sends the request to the primary API using an HTTP request with a 10-second timeout and captures the full response even on failure.
  3. If the primary API responds with HTTP 200, returns a JSON response to the webhook caller indicating the primary provider succeeded.
  4. If the primary API fails, waits 5 seconds and retries the same primary API request once.
  5. If the retry responds with HTTP 200, returns a JSON response indicating the primary-retry path succeeded.
  6. If the retry fails, sends the request to the backup API and returns success if it responds with HTTP 200.
  7. If both primary and backup APIs fail, returns a JSON error message with an ISO timestamp to the webhook caller.

Setup

  1. Activate the workflow and copy the production webhook URL from the Webhook trigger to use as your API recovery endpoint.
  2. Configure the calling system to POST a JSON body that includes primaryApi, backupApi, and (optionally) method and retryCount values.
  3. If your target APIs require authentication or custom headers/body, extend the HTTP requests to include the required headers, query parameters, or payload and adjust the timeout as needed.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - API Recovery Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 2 - Extract Request Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 2

Block 3 - Execute Primary API Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 4 - Check Primary API Success

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - Return Primary API Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 6 - Wait Before Retry Attempt

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 7 - Retry Primary API Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 8 - Check Retry API Success

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 9 - Return Retry API Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 10 - Execute Backup API Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 11 - Check Backup API Success

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 12 - Return Backup API Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 13 - Prepare Failure Payload

Type / Role
n8n-nodes-base.set - set
Config choices
Version 2

Block 14 - Return Final Failure Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Route API requests via webhook with retries and backup endpoints
Complexity advanced
Nodes 20
Categories DevOps
Author WeblineIndia
Published 08 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16174/16174.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Route API requests via webhook with retries and backup endpoints do?

Quick Overview This workflow exposes a webhook that forwards a request to a primary API, retries once after a short delay if it fails, and then fails over to a backup API, returning a structured JS...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.