n8n Respond to Webhook node
Updated 2026-10-21 · 5 min read
- It only works if the Webhook node's Respond option is Using 'Respond to Webhook' Node.
- The node runs once with the first item. Only All Incoming Items returns every item.
- In our tests, placed early, it answered the caller and the workflow kept running.
The n8n Respond to Webhook node sets the HTTP response that a webhook caller gets: the status code, the headers and the body. By default the caller gets "Workflow got started" or the last node's output. Use this node whenever that is not the response you want.
It is also the n8n counterpart of Pipedream's $.respond() and of the Return HTTP response action.
Setup in three steps
- Start the workflow with a Webhook node.
- In the Webhook node, set Respond to Using 'Respond to Webhook' Node.
- Add a Respond to Webhook node where the response should be sent. To include data from other nodes, place it after them.
Step 2 is the one people miss. If Respond stays on Immediately or When Last Node Finishes, the Webhook node answers by itself. The caller then doesn't get the response you set up in Respond to Webhook.
Respond With
This setting decides what goes into the response body.
| Option | Sends | Notes |
|---|---|---|
| All Incoming Items | The JSON of all input items, as an array | The way to return a list |
| First Incoming Item | The first item's JSON | |
| JSON | The object you write in Response Body | Expressions allowed |
| Text | The text in Response Body | Sent as text/html by default |
| Binary File | A binary field from the input | PDFs, images, CSV downloads |
| JWT Token | A JSON Web Token | |
| Redirect | A redirect to Redirect URL | OAuth callbacks, "thank you" pages after a form |
| No Data | An empty body | Pair it with status 204 |
More options sit under Add Option:
- Response Code
- Response Headers
- Put Response in Field (for All Incoming Items and First Incoming Item)
- Enable Streaming (needs a trigger set to the Streaming response mode)
Examples
JSON with a custom status
Respond With JSON, Response Code 201, Response Body:
{{
{
"id": $('Create record').first().json.id,
"status": "created"
}
}}
Validation error
Put an If node after the Webhook to check the input. On the false branch, add a Respond to Webhook node with Response Code 400 and this body:
{{ { "error": "email is required" } }}
On the true branch, continue the work and respond with 200 at the end. Only the first Respond to Webhook node that runs is used. So one on each branch is the normal pattern.
Plain text or CSV
Respond With Text, Response Headers Content-Type: text/csv, Response Body {{ $json.csv }}. Set the header yourself, because Text defaults to text/html.
File download
Respond With Binary File and point it at the binary property, often data. Should the browser download the file instead of showing it? Then add Content-Disposition: attachment; filename="report.pdf" in Response Headers.
Redirect
Respond With Redirect and set Redirect URL. For example, send people to a confirmation page after a form post.
Respond early, keep working
The docs let you place the node anywhere in the workflow. In our tests the response goes out when the node runs, and the nodes after it keep running. That gives you an "acknowledge, then process" pattern without a second workflow:
Webhook → Respond to Webhook (202) → HTTP Request → Google Sheets → Slack
The caller gets a fast 202. That matters for senders with short timeouts. It also matters on n8n Cloud: there, a webhook that doesn't answer within 100 seconds fails with a 524 (webhook common issues).
Behavior you should know
From the node docs:
| Situation | Caller gets |
|---|---|
| The workflow finishes without reaching Respond to Webhook | A standard message, status 200 |
| The workflow fails before the first Respond to Webhook runs | An error message, status 500 |
| A second Respond to Webhook runs after the first | Ignored |
| Respond to Webhook runs, but a webhook didn't start the workflow | Ignored |
The node runs once, using the first incoming item. Only All Incoming Items puts every item in the response. So if you loop and expect several responses, only the first counts. To return many items, use All Incoming Items or put an Aggregate node in front.
In the node's Settings, Enable Response Output Branch adds a second output. It carries the response that was sent, so you can log it.
HTML responses
Since n8n 1.103.0, HTML responses are wrapped in a sandboxed iframe, an isolated frame inside the page. Three things break there:
- scripts that access the top window or local storage;
- auth headers such as basic auth, which aren't available inside the frame;
- relative URLs, such as
<form action="/">.
Use absolute URLs. Or serve real pages from a web host and keep n8n as the API.
Replacing Pipedream $.respond()
In Pipedream, a code step can call $.respond({ status, headers, body }). With immediate: true, it answers before the workflow ends (Pipedream triggers). Without any response, Pipedream returns a 200 with a "Success!" page.
| Pipedream | n8n |
|---|---|
$.respond({ status: 200, body }) at the end |
Respond to Webhook (JSON) as the last node |
$.respond({ immediate: true, ... }) |
Respond to Webhook, placed early |
| Return HTTP response action | Respond to Webhook node |
| No response configured | Webhook node with Respond: Immediately |
headers: {...} |
Response Headers option |
The trap during migration: a Pipedream code step that both computes data and calls $.respond() has to be split in two. The Code node computes, and the Respond to Webhook node sends. The Webhook node's Respond setting must change to match. More on the code side: $.flow.exit and $.respond in n8n.
Our converter sets the Webhook node to "Using 'Respond to Webhook' Node". It also emulates $.respond() inside wrapped code steps. The report flags each workflow that responds over HTTP, so you know what to test. The report and 1 workflow are free. Full export: $3 per workflow, $1 each after 50, $19 minimum, one-off. To check a single step first, paste it into the Code node compatibility check.
Not affiliated with Pipedream or n8n.
FAQ
Why is my Respond to Webhook node ignored?
The Webhook node's Respond parameter must be set to Using 'Respond to Webhook' Node. Otherwise the Webhook node answers on its own, and the Respond to Webhook node has no request to answer.
How do I return all items from n8n Respond to Webhook?
Set Respond With to All Incoming Items. The node always runs once, and only All Incoming Items puts every item in the response. On versions before that option existed, aggregate the items into one before responding.
Can I respond to the webhook and keep the workflow running?
Yes. Place Respond to Webhook early in the workflow. The caller gets the response when that node runs, and the rest of the workflow continues.
What happens if the workflow fails before Respond to Webhook runs?
The caller gets an error message with a 500 status. If the workflow finishes without ever reaching the node, the caller gets a standard message with a 200 status.
Sources (5)
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook
- https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/common-issues
- https://pipedream.com/docs/workflows/building-workflows/triggers
- https://pipedream.com/docs/workflows/building-workflows/code/nodejs