Spanish Total.js
English
Documentation For AI agents
Contents

Run a workflow on a schedule

Run work every few seconds with Timer, or at set times with Crontab.

.md GitHub
On this page

Timer starts a flow at a fixed interval. Crontab starts it at set minutes, hours or days. Both run on the server, with or without the designer open.

A Timer flow and a Crontab flow after they ran, with Print showing their data

Every few seconds: Timer

This service runs every 10 seconds, writes a log line and passes a status to Print.

  1. Drag Timer, Code and Print onto the canvas and connect them in that order.
  2. Double-click Timer. Set Interval to 10000 (milliseconds). To send fixed data, clear Random data and type the Data, for example tick. Select APPLY.
  3. Double-click Code, paste the code below and select APPLY.
  4. Select APPLY in the toolbar, then Continue.

The Timer settings

console.log('Heartbeat received:', value);
send({ status: 'ok', checked: new Date().toISOString() });

Every 10 seconds, Print shows the status and the time, and the log line appears in the Console. Select Run on the Timer to start it at once.

At set times: Crontab

  1. Drag Crontab and Print onto the canvas and connect them.
  2. Double-click Crontab.
  3. In Timers, type a schedule in the empty field at the bottom and press Enter. A new Crontab has 0 9 * * * (every day at 9:00). Remove a schedule with the bin icon next to it.
  4. Choose what it sends in Type, for example Current date and time.
  5. Select APPLY, then APPLY in the toolbar and Continue.

The Crontab settings with the schedule <em *" class="img-responsive" border="0" loading="lazy" />

A schedule has five fields: minute, hour, day of month, month and day of week (0 is Sunday). * means every value.

ScheduleRuns
* * * * *Every minute
0 9 * * *Every day at 9:00
0 20 * * 1Every Monday at 20:00

Time zone offset is in minutes. As the window says, the server time is in UTC, and the window shows the offset of your browser.

Select Run on the Crontab to start it at once.

Made in Europe