Webhook router handling ping and process actions
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.Webhook node accepts POST on path template/scalable-orchestrator with response deferred to a response node
- 2.Parse Input reads action from the body defaulting to ping, and sets payload with a default object {id:123, text:"hello"}
- 3.Switch node routes to the ping or process output based on the action value, with non-matches ignored
- 4.The ping branch builds {ok:true, message:"pong"} and passes it straight to the response node
- 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.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
- Activate the workflow and curl -X POST to /webhook/template/scalable-orchestrator with {"action":"ping"} and verify the pong reply
- Send {"action":"process","payload":{"id":1,"text":"hello"}} and verify the returned data includes source:"serviceA"
- Send an unknown action such as "test" and expect no response since the fallback output is disabled
- 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
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (8)
Webhook
Webhook
Notas & Testes
Sticky Note
Parse Input
Set
Route by action
Switch
HTTP Service A
HTTP Request
Compose Ping
Set
Compose Result
Set
Respond
Webhook
Source and license
Sticky Note
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