Workflow
AI Workflows

How to Respond to an n8n Webhook Before a Slow Job Finishes

Nov 26, 2026|
AL
Automation Lab

Return an n8n webhook acknowledgment before a slow workflow finishes, then track the result with a job ID.

For a slow n8n job, validate the incoming request, save a job record, and send a response with its ID before starting the slow step. Let the caller retrieve the result later through a status endpoint or an agreed callback. This keeps the caller from waiting for the entire workflow on one HTTP connection.

Choose when to respond

In the **Webhook** node, **Immediately** sends an acknowledgment when the workflow starts. Use it when the sender only needs that acknowledgment. To return a job ID after validation or storage, choose **Using ‘Respond to Webhook’ Node**. Place **Respond to Webhook** after those short steps and before the long API call or file processing step.

Set **Respond With** to **JSON**. Under options, set **Response Code** to **202** if you control the client and it treats 202 as accepted. For a third-party sender, follow its acknowledgment contract. Some integrations expect a specific status or response body.

Save enough information to recover the outcome

  1. **Validate the request.** Check the sender and required fields using the method supported by your integration. Keep invalid requests out of the job store.
  2. **Record the job before acknowledging it.** Save a unique job ID, the caller or tenant that owns it, and a starting state such as queued. When a sender may retry, use its stable event ID or a client-supplied idempotency key to look up the existing job. Enforce uniqueness atomically so two simultaneous deliveries cannot create two jobs.
  3. **Return the ID, then process the job.** Persist the result or a safe failure summary. A response sent partway through an n8n execution frees that HTTP connection. For work that needs to survive a worker restart, use a durable queue or a separate worker that can claim persisted jobs and recover stalled ones.
  4. **Give the caller a way to check.** A separate status endpoint should verify that the caller owns the job before returning its state. If you use callbacks, send them only to an agreed destination and give the receiver a way to deduplicate delivery.

Fictional example: creating a weekly report

A reporting tool requests a summary of five sample records. The workflow saves job `report-1042` and returns `{"jobId":"report-1042","status":"queued"}` with HTTP 202. The client shows “Report queued.” The worker later saves the report and marks the job completed. When the client checks the status, it can display the report. If the worker fails, the client sees a failed state instead of waiting indefinitely.

Try this with a harmless test job and a short artificial delay. Verify that the acknowledgment arrives while the job is still running. Then send the same input with the same idempotency key and check that it points to the same job. Test a worker failure separately and confirm the status changes.

Questions people ask

Can Respond to Webhook send the finished result later?

The original request gets one response. n8n ignores a second Respond to Webhook node after the first response has been sent. Return the result through a separate request or an agreed callback.

Does early acknowledgment prevent the workflow from timing out?

It shortens the time the caller holds the connection open. Workflow execution limits, worker reliability and upstream API timeouts still apply. Cloud and self-hosted environments can have different limits. Inspect where the failure occurred before tuning any timeout.

What if the client requires the result in the original response?

An early acknowledgment requires the client to support a separate result path. If the client cannot change, measure the caller, proxy and workflow deadlines and keep the synchronous work short enough for the tightest one.

Sources

Keep exploring

Find practical AI assets for your next task

Browse curated collections and ready-to-use AI assets for marketing, sales, project delivery and other goals.