How to Answer a Webhook Instantly While AI Runs in the Background in n8n
Acknowledge the caller in milliseconds, then process a slow AI task asynchronously so the request never times out.
Many senders give up if a webhook takes more than a few seconds to respond, but a long AI generation can run much longer. The pattern that solves this is respond first, work later: reply with a quick acknowledgement, then continue the heavy AI step on a separate branch and deliver the result somewhere else.
What you need
- An n8n instance, version 1.x
- A chat model credential for the slow generation step
- A place to deliver the finished result (Slack, email, or a callback URL)
Step 1: Respond before the AI step
Set the Webhook node Respond option to Using Respond to Webhook Node. Wire a Respond to Webhook node as the very next step so n8n returns a 200 right away, before any model call.
{
"status": "accepted",
"message": "Your request is processing. We'll post the result to Slack."
}Step 2: Continue to the AI node
From the Webhook node, also connect a second branch into your AI Agent or HTTP model node. Because the response already went out, this branch can take as long as it needs.
Step 3: Deliver the finished result
After the AI node, add a delivery step. A Slack message, an email, or an HTTP request back to the caller all work. Include any id from the original payload so the result can be matched up.
Result: the caller gets a confirmation in well under a second, and the finished article shows up in your Slack channel a minute later with no timeout error.
Watch related tutorials
32:08
21:45
34:10
26:40
32:15
40:20