调度触发器节点常见问题(Schedule Trigger node common issues)#
这里是一些关于 Schedule Trigger 节点 的常见错误和问题,以及解决或排查它们的步骤。
🌐 Here are some common errors and issues with the Schedule Trigger node and steps to resolve or troubleshoot them.
无效的 cron 表达式(Invalid cron expression)#
当你将 Trigger Interval 设置为 Custom (Cron) 且 n8n 无法识别你的 cron 表达式时,就会发生此错误。这可能意味着你的 cron 表达式有误,或者你使用了不兼容的语法。
🌐 This error occurs when you set Trigger Interval to Custom (Cron) and n8n doesn't understand your cron expression. This may mean that there is a mistake in your cron expression or that you're using an incompatible syntax.
调试时,请检查以下内容:
🌐 To debug, check that the following:
- 确保你的 cron 表达式遵循 cron 示例 中使用的语法
- 在删除秒列后,你的 cron 表达式可以在crontab guru上验证
计划工作流在错误的时间运行(Scheduled workflows run at the wrong time)#
如果“计划触发器”节点运行时间错误,则可能意味着你需要调整 n8n 使用的时区。
🌐 If the Schedule Trigger node runs at the wrong time, it may mean that you need to adjust the time zone n8n uses.
全局调整时区(Adjust the timezone globally)#
如果你正在使用 n8n Cloud,请按照 设置 Cloud 实例时区 页面上的说明操作,以确保 n8n 与你的本地时间同步执行。
🌐 If you're using n8n Cloud, follow the instructions on the set the Cloud instance timezone page to ensure that n8n executes in sync with your local time.
如果你是自托管,请使用GENERIC_TIMEZONE环境变量设置你的全局时区。
🌐 If you're self hosting, set your global timezone using the GENERIC_TIMEZONE environment variable.
调整单个工作流的时区(Adjust the timezone for an individual workflow)#
要为单个工作流设置时区:
🌐 To set the timezone for an individual workflow:
变量未按预期工作(Variables not working as expected)#
虽然变量可以在计划触发器中使用,但它们的值只有在工作流发布时才会被评估。发布工作流后,你可以在设置中更改变量的值,但这不会改变工作流的运行频率。为了解决这个问题,你必须停止工作流,然后发布新版本以应用更新后的变量值。
🌐 While variables can be used in the scheduled trigger, their values only get evaluated when the workflow is published. After publishing the workflow, you can alter a variable's value in the settings but it won't change how often the workflow runs. To work around this, you must stop and then publish a new version of the workflow to apply the updated variable value.
更改触发间隔(Changing the trigger interval)#
您可以随时更新计划触发器的间隔,但只有在工作流发布时才会更新。如果在工作流处于活动状态后更改触发器间隔,修改将不会生效,直到您停止工作流并发布新版本。
🌐 You can update the scheduled trigger interval at any time but it only gets updated when the workflow is published. If you change the trigger interval after the workflow is active, the changes won't take effect until you stop and then publish a new version of the workflow.
此外,计划从你发布工作流的时间开始。例如,如果你最初设置的计划是每小时执行一次,应该在12:00执行,但你将其更改为每两小时执行一次,并在11:30发布了工作流的新版本,那么下一次执行将在13:30,即从你发布时起两小时后执行。
🌐 Also, the schedule begins from the time when you publish the workflow. For example, if you had originally set a schedule of every 1 hour and it should execute at 12:00, if you changed it to a 2 hour schedule and publish a new version of the workflow at 11:30, the next execution will be at 13:30, 2 hours from when you published it.