Wait at specified time

I’m trying to use a wait node to wait until a specified time the following date but it never ever finishes executing.

Someone seems to be having the same issue and it looks like a bug but I just wanted to confirm if mine in the the bug or something I have done wrong:

GitHub - n8n-io/n8n-desktop-app: n8n Desktop App

Wait node “At Specified Time” not working correctly - Questions - n8n Community

This is the syntax I am using in the node

`
{{ DateTime.now().plus(1,‘days’).format(‘yyyy-MM-dd 08:30:00’)

And this is out the output

But when it gets to the specified time the workflow never continues

Information on your n8n setup

  • n8n version: - 1.89.2
  • Database (default: SQLite): - Not sure where I get this from
  • n8n EXECUTIONS_PROCESS setting (default: own, main): - Not sure where to check this
  • Running n8n via (Docker, npm, n8n cloud, desktop app): - Cloud
  • Operating system: - Windows 11

Hi @Shaun
Can you please test this example on your instance…

This worked in my workflow.

I.E it waiting 10 seconds and then continued.

@Shaun
Nice, now the issue in your attached workflow is that you’re using the wrong format:
format('yyyy-MM-dd 08:30:00') should be format('yyyy-MM-dd HH:mm:ss')

Here’s a working example for your case.

Just change the 10-second delay to your desired “wait until” date/time:

let me know if you still have issues…

Thanks is it possible to set waitUntil to +1 day and a certain time.

E.G

{{ DateTime.now().plus(1,‘days’).format(‘yyyy-MM-dd 08:30:00’) }}

Or is that what was breaking it?

@Shaun

Yes, You can use an expression like this:

{{ DateTime.now().plus(1, 'day').set({ hour: 8, minute: 30, second: 0 }).format('yyyy-MM-dd HH:mm:ss') }}

Feel free to adjust it to suit your needs.


If this answers your question, kindly mark the reply as the solution so others with the same issue can find it easily. ✅🙏🏻

Thanks. I will test it tomorrow and let you know

1 Like

Note that if you’re on n8n Cloud, there is likely an execution time limit

In this case, you would use the Schedule Trigger node to start your workflow at a specific time time…

2 Likes

This was bothering me so after doing some checking, I’m adding more context here…

IMO… there is a bug. The wait node fails with an error message like invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN" if the Date string isn’t a VERY specific format (i.e. just "yyyy-MM-dd'T'HH:mm:ss", without TZ or millis)(also i.e. a standard ISO date format WON’T WORK). The Date string should be valid if it conforms to any parsable date string format, OR the error message should say how/why the format is invalid.

The “reason” for this is (probably) related to the 2nd bullet point here, which is also a “heads up” for expectations if the Date string value is created anywhere that IS affected by the TZ settings for n8n or the specific workflow.

Hmm, I see that formatting was an issue but it appears that something else may be going on.
The Wait in this workflow has an incorrect format but you can see that even though the wait is still waiting, the workflow thinks something is being passed to the next node. When I open the last node, the input is empty. The wait is for 5 seconds.
So there be some kind of bug going on here.

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