Skip to content
MoveWorkflows

n8n Respond to Webhook node

Updated 2026-10-21 · 5 min read

The n8n Respond to Webhook node controls the HTTP response a webhook caller receives: the status code, headers and body. Use it whenever the default "Workflow got started" or "last node's output" isn't the response you want. It is also the n8n counterpart of Pipedream's $.respond() and the Return HTTP response action.

Setup in three steps

  1. Start the workflow with a Webhook node.
  2. In the Webhook node, set Respond to Using 'Respond to Webhook' Node.
  3. Add a Respond to Webhook node wherever 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, so the response you configured in Respond to Webhook isn't the one the caller gets.

Respond With

Option Sends Notes
All Incoming Items All input items' JSON 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, form "thank you" pages
No Data Empty body Pair with status 204

Options available under Add Option: Response Code, Response Headers, Put Response in Field (for All Incoming Items and First Incoming Item), and 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 that checks the input. On the false branch, a Respond to Webhook node with Response Code 400 and body:

{{ { "error": "email is required" } }}

On the true branch, continue processing and respond with 200 at the end. Only the first Respond to Webhook node that runs is used, so having 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 explicitly, because Text defaults to text/html.

File download

Respond With Binary File and point it at the binary property (often data). Add Content-Disposition: attachment; filename="report.pdf" in Response Headers if the browser should download rather than display it.

Redirect

Respond With Redirect and set Redirect URL, for example 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, which 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, which matters for senders with short timeouts and on n8n Cloud, where 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
Workflow finishes without reaching Respond to Webhook Standard message, status 200
Workflow errors before the first Respond to Webhook runs Error message, status 500
A second Respond to Webhook runs after the first Ignored
Respond to Webhook runs but the workflow wasn't started by a webhook Ignored

The node runs once, using the first incoming item; only All Incoming Items includes every item in the response. 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 node Settings, Enable Response Output Branch adds a second output that carries the response that was sent. Use it to log responses.

HTML responses

Since n8n 1.103.0, HTML responses are wrapped in a sandboxed iframe. Scripts that access the top window or local storage fail, auth headers such as basic auth aren't available inside the frame, and relative URLs (<form action="/">) break. Use absolute URLs, or serve real pages from a web host and keep n8n as the API.

Replacing Pipedream $.respond()

Pipedream lets a code step call $.respond({ status, headers, body }), with immediate: true to answer before the workflow ends (Pipedream triggers). Without it, 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. The Code node computes, the Respond to Webhook node sends, and the Webhook node's Respond setting must change to match. More on the code side in $.flow.exit and $.respond in n8n.

Our converter sets the Webhook node to "Using 'Respond to Webhook' Node" and emulates $.respond() inside wrapped code steps, and the report flags each workflow that responds over HTTP so you can test it. Paste a single step into the code step checker to see what it finds. The report and 1 workflow are free. Full export: $3 per workflow, $19 minimum — coming soon.

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; 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.

Related

Sources