调度触发器节点常见问题#
¥Schedule Trigger node common issues
以下是 调度触发器节点 的一些常见错误和问题,以及解决或故障排除步骤。
¥Here are some common errors and issues with the Schedule Trigger node and steps to resolve or troubleshoot them.
无效的 cron 表达式#
¥Invalid cron expression
当你将触发间隔设置为“自定义(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 示例 中使用的语法。
¥That your cron expression follows the syntax used in the cron examples
- 确保你的 cron 表达式(移除 秒列 后)在 crontab 专家 上验证通过。
¥That your cron expression (after removing the seconds column) validates on 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 云,请按照 设置云实例时区 页面上的说明操作,以确保 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:
- 在画布上打开工作流。
¥Open the workflow on the canvas.
2. 选择右上角的
三个点图标。
¥Select the Three dots icon in the upper-right corner. 3. 选择“设置”。
¥Select Settings. 4. 更改时区设置。
¥Change the Timezone setting. 5. 选择“保存”。
¥Select Save.
变量未按预期工作#
¥Variables not working as expected
虽然可以在计划触发器中使用变量,但它们的值仅在工作流激活时才会计算。激活工作流后,你可以在设置中更改变量的值,但这不会改变工作流的运行频率。要解决此问题,你必须停止然后重新激活工作流以应用更新后的变量值。
¥While variables can be used in the scheduled trigger, their values only get evaluated when the workflow is activated. After activating the worfklow, 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 re-activate 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 activated. If you change the trigger interval after the workflow is active, the changes won't take effect until you stop and then re-activate the workflow.
此外,日程安排从你激活工作流之时开始。例如,如果你最初设置的是每小时执行一次,并且应该在 12:00 执行,如果你将其更改为每两小时执行一次,并在 11:30 重新激活工作流,则下次执行时间将是 13:30,即激活后两小时。
¥Also, the schedule begins from the time when you activate 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 re-activated the workflow at 11:30, the next execution will be at 13:30, 2 hours from when you activated it.