Schedule Trigger executing at wrong time

Describe the issue/error/question

The Schedule Trigger appears to be executing at the wrong time. For example, I have a weekly trigger that is set to execute at 3 AM every Sunday, but it ends up executing at 7 PM instead.

I have checked the Timezone settings for the workflow and my install and they are both correct (PST).

I do not have any issues with the legacy Cron node, so this seems to be a new behavior introduced in the new node.

What is the error message (if any)?

There is no error but it executes at the incorrect time.

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.207.1
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: K8s

Hi @joeldeteves, I am so sorry for the trouble. The new Schedule node has caused a few headaches recently and I am very sorry for this :frowning:

I’ll set up a test workflow to run over the holidays to see if I can reproduce the problem.

1 Like

Thanks I’m upgrading to 0.209.2 (not sure if fixed yet) but I’ll keep an eye out as I tend to run latest as much as I can

Thanks @joeldeteves! My workflow also ran over the holiday weekend, but the scheduling appears to have worked as expected. My exact workflow was this one:

Workflow settings suggest Pacific Time is being used:

Querying the execution suggests this workflow ran at 2022-12-25T11:00:00.422Z

Quickly comparing these values on this website confirms 11:00 UTC is equal to 03:00 PST:

This was on [email protected]. So it seems this is working as it should for me. Are there perhaps any additional steps required to reproduce this problem? Perhaps a problem with the time set on your server?

Hi @MutedJam I updated to 0.209.3 and unfortunately the same issue occurred at the exact same time (workflow scheduled to execute at 3 AM but instead runs at 7 PM).

We run in a k8s environment so the “server” per se (i.e. the K8s node) is in UTC time. However, the deployment has the timezone variable set to PST which I can confirm by looking at my n8n settings.

Should it be configured differently? I never had this issue with the old Cron node and in fact I have a few older workflows that are using the cron node and they are executing at the correct time.

Hey @MutedJam - it gets weirder.

I ran the date command using the Execute Command node - the date here is correct.

So I don’t think this is a server-side issue.

Hey @MutedJam - I fixed the issue!

After looking at the problem again I realized it made no sense that it was working for you and not for me - and also that my server has the correct time as verified by the date command.

That led me to thinking about what else the problem could be - which led me to the solution:

We use n8n in queue mode - and it turns out, I forgot to set the timezone parameters on the workers!!!

After setting the TZ environment variables on the worker deployment, I created a test workflow to send myself an email at 10:54 AM and it came through on the dot!

Thanks for all your help,

2 Likes

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