Skip to content
General Automation

Webhook router handling ping and process actions

8 nodes 43 4 Webhook
Download

Loading workflow…

Workflow Description

The workflow receives POST requests on a fixed webhook path, extracts action and payload from the request body (with defaults), and routes through a Switch node: a ping action returns a simple {ok:true, message:"pong"} response, while a process action POSTs the payload as JSON to an external HTTP service (httpbin.org by default) with automatic retry up to 2 times on failure, then formats the result and returns it to the caller via a Respond to Webhook node in JSON. Any action not matching the configured rules is dropped and never reaches the response node.

How it works

  1. 1.Webhook node accepts POST on path template/scalable-orchestrator with response deferred to a response node
  2. 2.Parse Input reads action from the body defaulting to ping, and sets payload with a default object {id:123, text:"hello"}
  3. 3.Switch node routes to the ping or process output based on the action value, with non-matches ignored
  4. 4.The ping branch builds {ok:true, message:"pong"} and passes it straight to the response node
  5. 5.The process branch POSTs the payload as JSON to https://httpbin.org/post with retryOnFail and maxRetries set to 2, then shapes the result into {ok, data, source:"serviceA"}
  6. 6.Respond to Webhook returns the final JSON object to the caller

Use cases

  • Lightweight API health-check endpoint via the ping action before sending real data
  • Single entry point that forwards request payloads to an external service and returns its result synchronously
  • Starter template to extend routing with additional actions by adding Switch rules

Requirements

  • Workflow must be activated in n8n for the production webhook URL to work (currently inactive)
  • No credentials needed in the current setup since the default httpbin.org service is public; add appropriate credentials when replacing it with a real API
  • Network access from the n8n instance to the target external service
  • Requests must be JSON with an action field in the body to trigger the correct branch

Setup and testing in n8n

  1. Activate the workflow and curl -X POST to /webhook/template/scalable-orchestrator with {"action":"ping"} and verify the pong reply
  2. Send {"action":"process","payload":{"id":1,"text":"hello"}} and verify the returned data includes source:"serviceA"
  3. Send an unknown action such as "test" and expect no response since the fallback output is disabled
  4. Replace the httpbin URL with a controllable endpoint and re-send to observe retry behavior on service failure

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Webhook Set If HTTP Request

Details

Trigger Webhook
Nodes 8
Apps 4
Views 43
Downloads 4

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (8)

Webhook

Webhook

#1

Notas & Testes

Sticky Note

#2

Parse Input

Set

#3

Route by action

Switch

#4

HTTP Service A

HTTP Request

#5

Compose Ping

Set

#6

Compose Result

Set

#7

Respond

Webhook

#8

Source and license

Sticky Note

#9
Stay in the loop

Fresh workflows, straight to your inbox

Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.

  • New workflows
  • Clear overviews
  • Setup guides

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime