n8n: Respond to a Webhook Instantly and Keep the Workflow Running
Description and use
In n8n, the default webhook response waits for the entire workflow to finish, causing timeouts. Setting the response mode to "On Received" or using a "Respond to Webhook" node lets the client get a quick 200 response while the workflow continues in the background.
Problem
When a webhook triggers an n8n workflow, the HTTP response is delayed until the entire workflow finishes, causing client timeouts and poor UX.
Outcome
Clients receive a 200 response within 150 ms, while the workflow continues to run heavy tasks in the background, eliminating timeouts and improving user experience.
Workflow
- Configure webhook node to use "On Received" or "Using 'Respond to Webhook' Node'" response mode
- If using "On Received", set response code 200 and optional message
- If using "Respond to Webhook", add a Code node to generate a jobId and timestamp
- Connect Code node output to a Respond to Webhook node with JSON body {success:true, jobId:…}
- Continue workflow with heavy nodes (AI, PDF, DB, Slack) after the Respond node
- Optional: attach an Error Workflow to notify on failures
- Optional: write status to DB and expose polling endpoint for final result
Evidence
By default, n8n couples the lifecycle of an incoming HTTP request to the lifecycle of the entire workflow.
Pattern B: Generate Ticket, Respond Early, Then Continue
- Record date: 2026-09-15T03:01:38.551Z