Home » n8n» n8n webhook node respond when last node finishes – Beginner Docker Guide

Guide: n8n webhook node respond when last node finishes?

To make the n8n webhook node respond when the last node finishes, set the webhook to wait and place a Respond to Webhook node or use the webhook’s response mode so the HTTP reply is sent after your final node completes. This approach ensures the caller receives the final output when the workflow ends.

What You Need

  • n8n running (Docker recommended).
  • Basic Docker and Node.js knowledge.
  • A simple workflow with a Webhook and one or more processing nodes.

Step 1: Start n8n with Docker

Run n8n locally with Docker. This example enables basic auth and maps port 5678.

docker run -it --rm -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=user \
  -e N8N_BASIC_AUTH_PASSWORD=pass \
  n8nio/n8n:latest

Wait until n8n is ready at http://localhost:5678. Open the editor UI to build the workflow.

Step 2: Create the Webhook and Respond nodes

Create a Webhook node to receive the request. Then add your processing nodes. Finally add a Respond to Webhook node or set the Webhook node to wait for the last node result. The Respond to Webhook node must be connected after the last processing node.

  1. Create Webhook node (choose POST or GET and a path).
  2. Add your processing nodes (HTTP Request, Function, Database, etc.).
  3. Add Respond to Webhook node and connect it after the final node.

Step 3: Test with curl

Trigger the workflow and observe the response after all nodes finish.

curl -X POST http://localhost:5678/webhook/my-path \
  -H "Content-Type: application/json" \
  -d '{"name":"test"}'

The HTTP client will wait until the Respond to Webhook node runs and then receive the final JSON output.

How n8n webhook node respond when last node finishes works

The Webhook node can either reply immediately or wait. When you configure the workflow to wait, n8n keeps the HTTP connection open. The Respond to Webhook node or the webhook’s “wait/last node” mode sends the final response when the workflow is done. This gives you the final processed payload or status.

Step-by-step logic

  1. Incoming HTTP request hits the Webhook node.
  2. Webhook node triggers the workflow and keeps context to respond later.
  3. Processing nodes run in order or in parallel as configured.
  4. Final node (Respond to Webhook) formats the response payload.
  5. n8n sends the HTTP response and closes the connection.

Update

Check your n8n version when options change. Node names or response options may change between releases. Update workflows after major upgrades and test in a safe environment before production.

Security

  • Enable authentication (basic auth or OAuth) on n8n in production.
  • Use HTTPS / TLS in front of n8n. Do not expose n8n directly to the public without a proxy.
  • Validate and sanitize webhook inputs. Avoid running untrusted code in Function nodes.
  • Limit access by IP or use API gateways and rate limiting.

Done

You now have a workflow pattern where the n8n webhook node responds when the last node finishes. Use the Respond to Webhook node or the webhook “wait for last node” mode. Test with curl and secure your instance before production use.


Neil
Written by Neil

Neil is a true n8n geek who lives and breathes workflow automation. He dives deep into nodes, triggers, webhooks, custom logic, and self-hosting setups, sharing everything he learns about n8n on AutomationCompare.com. As part of a broader team of automation specialists, Neil focuses purely on mastering n8n and helping others unlock its full potential.

Keep Reading

Scroll to Top