Wait Node waits more on n8n 1.25.0+. (wait time = UTC + specified time)

Hello,

I have a problem with the Wait Node starting with 1.25.0.
The node waits for the specified time (e.g., 2 minutes + the UTC difference, 5 hours in my case).
In previous releases, the wait node only waited for the specified time (2 minutes).

Describe the problem/error/question

Starting with n8n 1.25.0, the Wait node waits more than the specified time.
For instance, if I’m located in the US Eastern Timezone (UTC-5), and I set up a node to wait for 2 minutes, the node waits for 5 hours (UTC difference?) plus the 2 minutes.
I noticed this worked fine on n8n 1.24.0 and older, but stopped working since 1.25.0.

What is the error message (if any)?

Please share your workflow

I have this in my .env file for Docker (not sure if this matters):
GENERIC_TIMEZONE=America/New_York

Share the output returned by the last node

Looking at the execution output, we can see that the latest execution started at 13:36:09 and ends at 18:38:09 (UTC + Wait Node time).
Previous releases were not affected by this.

Information on your n8n setup

  • n8n version: 1.25.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux & Mac OS.

Hey @CristianG,

There are a few threads about this now and we are working on a fix which should be available soon.

1 Like

I’m sorry, @Jon , I wasn’t able to find another similar thread yesterday, but I found one now.
I’m glad you are aware of this and working on a fix.

1 Like

Where can we see the status of the fix?

Hey @ekadin,

This has actually been fixed we just forgot to link the threads to it, Can you try updating to 1.30.1 and let me know how that goes for you?

Hi @Jon ,

I updated to 1.30.1 and still having issues with my workflow. There are other issues that started when I updated to 1.29.1 as well.

  • I am passing in a Timestamp to my wait node and subtracting 30 minutes.
    The way I had it working was like this - {{ DateTime.fromISO($json[“state”]).minus({minutes: 30}) }}. After updating to 1.29.1, that would result in a error of “input.match is not a function”, which I fixed by converting it to a string - {{ DateTime.fromISO($json[“state”]).minus({minutes: 30}).toString() }}.

  • Another issue that is happening now is the Wait node is running multiple times, even after turning on the Execute Once option.
    image

This is besides the current issue of the Wait node not respecting the set Time zone.

What is the output of your expression? It needs to be a number. I don’t think a DateTime object will work.
E.g. your expression might produce something like “2024-02-26T12:28:32.207-05:00”, but I don’t know if this would work. Try with something like 30 instead.

For me, 1.29.1 fixed the problem, but I am using a number in the “Wait amount” field of the Wait node.

Hi @Jon ,

After a lot of trial and error and some verbose logging here is what I found:
The datetime parameter of the Wait node is being extremely picky on what it considers a valid format. I used the date and time picker in Fixed mode and then switched that to Expression mode. That was the ONLY format I got to work.
Anything else resulted in:

2024-02-26T20:22:17.407Z | verbose | Workflow execution will wait until Invalid Date

That is what was causing the multiple runs in the Wait node.

This is what I used to match the format that the Fixed mode was producing:

{{ $now.plus({minutes: 5}).startOf(‘second’).toISO({suppressMilliseconds: true, includeOffset: false}) }}

Once I got past this, the Wait node is working as expected, so the original issue does indeed seem to be fixed.

1 Like

Perfect nice to see you have it working, Maybe in the future we can look at other possible timeformats to include but I guess if you were just after 5 minutes from now you would use wait > 5 minutes rather than a date time but if it was for a fixed date or maybe the date is from somewhere else it won’t be that easy.

Yeah, I’m passing in a datetime from a Home Assistant state. I was just using $now plus 5 minutes for testing.
In previous releases the other formats were working. Possibly 1.24.1, but I don’t remember for sure.

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