Skip to main content
Use this when a job should run every five minutes or every weekday at 09:00. There are two ways, and the choice matters.

Steps

1

Put a SCHEDULE_TRIGGER at the start

Set exactly one of intervalMs and cron. The first tick comes after one interval, or at the next cron time. Each tick is a message {"tick": 1, "firedAt": "..."}; tick counts from 1.0 */5 * * * * is every five minutes, 0 0 9 * * MON-FRI is 09:00 on weekdays. Both set, neither set, a non-positive interval and a cron with no future date are refused at validation.
A trigger node has an idle timeout of 30 seconds like any other node. When the gap between ticks is longer, set timeoutSeconds on the trigger to more than the longest gap (above 86400 for a daily cron), or it times out between ticks.
2

Write the workflow

This probes a URL every minute and sends a notification when it fails. Save as uptime.json:
uptime.json
3

Apply it and start it once

Starting twice gives two runs and two independent schedules, so start it once; the Idempotency-Key makes a retried start return the first run.
4

Stop it when you are done

A run with a schedule stays open until you stop it, the trigger reaches maxRuns, or the server stops. The default DRAIN mode stops the trigger and lets in-flight work finish:
CLI: yukta-cli workflow stop uptime-watch probe.

Verify it worked

After a minute and a bit, the run is still RUNNING and the ok terminal has received a message with tick 1; a minute later, tick 2. Read it with the results stream or the run log.

Variations

  • A schedule that survives restarts. The schedule position is not stored: after a restart nothing starts the workflow, missed ticks are not replayed, and a resumed run starts its schedule again from the beginning. Run the clock outside Yukta instead: start a run per tick with POST /api/workflow/start, yukta-cli workflow start <session> <workflow> --payload '{...}' or the MCP tool start_workflow, from a workflow that begins with API_TRIGGER. An Idempotency-Key such as nightly-2026-10-15 stops a retried start from running twice.
  • Ticks arrive faster than the work. All ticks belong to one run and an interval tick that arrives while the previous start is still running is dropped and logged; keep the interval longer than the work, or put engine.edgeBuffer on the slow node (Delivery and back-pressure).
  • Limits on concurrent runs. A schedule holds one slot all the time: Tune capacity and limits.