Wait for Webhook: Batched HTTP Requests

Describe the problem/error/question

I have an http node that I must make batch requests to: the request enriches contact information using a list of IDs, and has a max of 10 IDs per request.
I have a code node before that formats the IDs in batches of 10, each batch being an item.
The HTTP node runs successfully for each item (batch), and returns the results.
Unfortunately, to get a contact’s email, the response comes via a webhook. I have set the webhook in the HTTP node as {{ $execution.resumeUrl }}, and have a wait on webhook node after to get the emails.
The problem currently is that the flow resumes after the first batch’s emails are returned, and the rest are ignored (never come through). I have checked the executions and it does not create a separate execution for the second batch.
Is there a way for me to set this up so that all the webhook batches come through before I continue the flow?

Please share your workflow

Here are some images of the nodes and the outputs:

Formatting batches:

HTTP request:

Webhook for emails: (as seen there is only 1 item)

Information on your n8n setup

  • n8n version: 2.7.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system: Cloud

Note: I added a limit node before the http node just for the example images. That is why there are only two output items and not 9, but the issue remains the same: only 1 output for the wait on webhook.

Hello @shongololo ,
you need to process them sequentially. Add a Loop Over Items (or Split In Batches set to 1) after your Code node. Put your HTTP Request and Wait nodes inside this loop.

This forces the workflow to send Batch 1, pause until it gets that specific answer, and only then loop back to send Batch 2.

Let me know if that helps.

2 Likes

hello @shongololo

you can use Loop Node or sub-workflow for that

2 Likes

Thank you so much this worked!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.