How to use correctly the wait node on call webhook?

Describe the problem/error/question

Hello Community?

I am developing an automation in n8n that makes calls using Ai Voice, with data received from GHL. The process is as follows:

  1. An initial webhook receives the contact data, which undergoes a brief preparation.
  2. The flow is then set to attempt calls to all the phone numbers listed for the contact, ensuring each one receives an attempt.

The logic is simple: if one of the calls is answered, the system should stop trying the remaining numbers. To manage this, the automation updates a custom field in GHL with the call status (“answered” or “not answered”). This update is sent back to n8n through an additional webhook.

The idea is that the call status acts as a “flag,” allowing the loop to proceed only if the last number called wasn’t answered — then, the flow should move to the next number. To implement this, I configured the “Wait” node in “On Call Webhook” mode with the $execution.resumeUrl path, expecting the flow to continue only when the webhook receives a “not answered” status. However, the loop is not resuming as expected after the webhook response.

What is the error message (if any)?

Please share your workflow

Preformatted text

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • 1.65.2
  • Database (default: SQLite):
  • Postgre
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Selfhosting (Railway, Docker)
  • Operating system:
  • MacOs Monterey Version: 12.7.6

Hi,

I think you are complicating the flow by trying to batch process. Why don’t you save the data after the preparations.

Then a workflow can read one by one from the table. You can connect the calling flow to a scheduling job and not worry about batch processing.

Hopefully this is helpful to you.

The problem is that I don’t want to call the customer two or four times, depending on the number of phones he has in his registry.

That’s why I need a mechanism that returns the result of the first call to know whether or not I should continue calling that same customer.

And to use this mechanism I need to use wait node to save the response back, because otherwise the flow will be continuous without stopping and I need to wait for the response to return.

Any suggestions? Thanks

Hi,

I see your point.

Yes you need to wait and check the previous call result. But I don’t think doing it in one step is the cleanest way.

Imagine, you have a table with,

Phone number
Status (NEW, IN_PROCESS, …)

You first execute a flow to do your data transformations and get the phone numbers and save them to the table with status, READY.

Now imagine another workflow running with 10 min intervals. It goes and takes 1 record from the table where the status is READY. Updates the record’s status to IN PROGRESS, calls the person and when the call is over it updates the status again.

This way you can control the state of your prospect with the status field. Scale your system decoupled from each prospect. And have control over your flow.

You can add company field to the table and do additional checks.

You can have last called at field and check if a certain time has passed.

…

If you have any other questions, feel free to send them my way, I would be happy to help.

Your suggestion makes sense, but if I wait 10 minutes for each call or result check, if the prospect has 4 phone numbers in their registry, it would take me 40 minutes to complete a prospect. I don’t think I mentioned this to you, but my prospecting lists are around 10 thousands leads per campaign! It would take forever to complete this batch.

But we’ve evolved our reasoning. Unless I’m mistaken, I think using the Wait node in “on call webhook” mode will be the best option in terms of algorithm efficiency and performance!

If you understand how to implement the solution with the WAIT node, let me know.

Thank you for your answers and help. It clarified my reasoning here. Thanks a lot.

Hi Carlos,

I hope you are having a nice day.

You are right. Schedule jobs would complicate the processing efficiency.

I tried to create an alternative flow with WAIT block. And I added a flagrant at the end.

I don’t know which platform you are using. But for this solution I assume they have a on call ended hook.

If you increase the type of statuses on GHL to 4,

Not-answered, Answered, In-progress, Not-called

1- You can finish your data transformation and save everything to GHL as Not-called.

2- Then you can take a single record, update it to be In-progress and call it.

3- The workflow than would wait for x minutes.

4- Afterwards it would check the table to see,

  • If there are any on going calls
  • If there is an answered call
  • If not is there a number left to call

In the first case it would just go back to the wait block and check again after x minutes.

In the second case it would stop.

If the third case is true it will take another number and start a call.

This should allow you to sequentially try all numbers.

But for this to work you would need a second workflow listening for “on call ended event”.

It should go to the table and update the record status. Otherwise this will get into an infinite loop.

Excuse my bad hand writing,

I hope I was able to be helpful. Feel free to reach out if you need any more support.

PS: If there is an “on call ended” event listener you can get rid of the WAIT block and check the table on the on call ended event flow.

It can then make a new call request or stop depending on the status.

1 Like

I’m trying that. I’ll let you know soon.

Thanks again my friend!

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