Error occurred: connect ECONNREFUSED | WAIT NODE | ON CALL WEBHOOK

Describe the problem/error/question

I’m facing a connection error when I try to use a Wait Node “on call webhook” in a loop. I make a request sending the {{$execution.resumeUrl}} to my CRM (GHL), where another event will be triggered to execute a phone call. However, on the second attempt to call a different number of the same contact, the {{$execution.resumeUrl}} produces a localhost url, generating the error. Any suggestions? Below are the two urls produced

  1. First iteration of the loop over items to send a post request (wait node works normally, continuing the flow):

Correct URL: https://primary-production-3601.up.railway.app/webhook-waiting/9954

  1. Second iteration of the loop (here the wait node crashes and just keeps processing).
    Wrong URL: http://localhost:5678/webhook-waiting/9954

What is the error message (if any)?

Error log: Action webhook Event Status error Info Error occurred: Message = connect ECONNREFUSED 127.0.0.1:5678 | Status = 500 Message Error occurred: Message = connect ECONNREFUSED 127.0.0.1:5678 | Status = 500 Executed On November 12th 2024, 6:15:26 pm

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • 1.66.0
  • Database (default: SQLite):
  • Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Docker
  • Operating system:
  • Macbook pro Monterey 12.7.6

Hey @Jon, any idea about this problem? I’ll appreciate some help.

Tks

Hey @Carlos_Guimaraes,

This is on my list to check out properly, I did spot this yesterday and the workflow looked exciting but not easy to just import and run.

What I plan to do is build out a small test with a loop that uses a wait node, I did wonder if maybe we only allow having one wait for webhook per workflow which is why it is failing but I need to test that theory.

1 Like

Hey @Jon, thank you so much to your return.
I’m trying also use the node to continue from another flow.

Hey @Carlos_Guimaraes,

Can you try updating? I just tried the workflow below which makes 3 items then loops sending the URL to Gotify each time and the URL is correct. Can you also make sure you have the WEBHOOK_URL env option set.

I also noticed at the bottom you are using a Set / Edit Fields node to keep an index, We actually do this for you with {{ $currentIndex }} which tracks how many times a node has run.

If you don’t need this index value as well you can use the noItemsLeft option from the Loop node.

@Jon, In fact, the URLs are now sent correctly to Gotify, in sequence… /1034, /1035, /1036, etc.

However, I don’t understand how the “WAIT” node will know that it should suspend the wait?! Basically, in your model I don’t understand how it evaluates the loop number and moves on.

But apart from that, I think you solved the problem. You’re the best!

Hey @jan,

I’ve been stuck on this for at least a month now and I can’t find anyone to help me with this implementation. Could you please take some time to read the post and give me a solution?

Carlos Guimarães

Main Workflow

Sub-workflow

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