Schedules
A schedule starts actors or saved tasks automatically: every few minutes, every day, on the weekdays you pick, or once a month. Lantfly starts them on time even when your browser is closed. Find them under Automation → Schedules.
Create a schedule
-
Click New schedule.
-
Give it a Name, for example "Daily collection". A Technical name for the API (lowercase letters, digits and dashes, unique in your account) is made from it; change it under Advanced if you like.
-
Under What to run, pick A saved task or An actor. You can add an Input override (JSON, optional) under Advanced.
-
Under When to run, pick how often:
Option Example Every few minutes Every 5, 10, 15 or 30 minutes Every hour At minute 15 of every hour Every day At 08:00, or at several times a day Some days of the week Monday to Friday at 09:00 Every month On day 1, or on the last day of the month Advanced (cron) Any cron expression -
Pick the time zone. It defaults to your browser's.
-
Keep Notify me when it cannot start a run on to get a notification if a run is refused (for example when usage runs out).
-
Click Save.
Below the form, a sentence describes the schedule ("Runs at 08:00 every day…") and lists its next five runs in the chosen time zone.
Several times a day can be combined only when they form a grid of hours and minutes (08:00 and 17:00, or 08:00 and 08:30). For 08:00 and 17:30, create two schedules.
The schedule list
Each schedule shows a readable description of when it runs, its Next run, and its Last run with the status of the run it started. Runs and logs opens the runs that schedule started. Turn on / Turn off pauses a schedule without deleting it.
Cron expressions
The API takes a five-field cron expression (minute hour day-of-month month day-of-week) or one of @hourly,
@daily, @weekly, @monthly. L in the day-of-month field means the last day of the month. Time zones are IANA
names such as Asia/Ho_Chi_Minh or Europe/Berlin; older names such as Asia/Saigon are accepted.
| Expression | Runs |
|---|---|
*/15 * * * * | Every 15 minutes |
0 8 * * * | Every day at 08:00 |
0 9 * * 1-5 | Monday to Friday at 09:00 |
0 8 L * * | The last day of every month at 08:00 |
Preview the next runs
GET /api/v3/schedules/preview returns the next fire times of an expression in a time zone, without saving anything.
It uses the same cron engine as the scheduler, so it matches the real runs.
curl -s -G "https://lantfly.com/api/v3/schedules/preview" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
--data-urlencode "cron_expression=0 8 * * 1-5" \
--data-urlencode "timezone=Asia/Ho_Chi_Minh" \
--data-urlencode "count=3"
The answer has cron_expression, timezone and next_runs (UTC timestamps). count is 1 to 10 (default 5). An
invalid expression or time zone answers 422.
Create a schedule with the API
curl -s -X POST "https://lantfly.com/api/v3/schedules" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "daily-collection",
"title": "Daily collection",
"cron_expression": "0 8 * * *",
"timezone": "Asia/Ho_Chi_Minh",
"is_enabled": true,
"notify_on_failure": true,
"actions": [
{ "type": "RUN_ACTOR_TASK", "task_id": "YOUR_TASK_ID" }
]
}'
| Field | Meaning |
|---|---|
name | Unique slug in your account |
title | Display name, up to 120 characters |
cron_expression, timezone | When it runs |
is_enabled | Whether it runs |
notify_on_failure | Notify the account when a fire cannot start its run (default true) |
actions | Up to 10 actions: RUN_ACTOR with actor_id, or RUN_ACTOR_TASK with task_id, each with optional input and options |
Each schedule returns next_run_at, last_run_at, last_run_id and last_run_status. Other calls:
| Request | What it does |
|---|---|
GET /api/v3/schedules | All schedules; add page or per_page (up to 100) to page them |
GET / PATCH / DELETE /api/v3/schedules/:schedule | Read (with recent runs), change (is_enabled turns it on or off), delete |
POST /api/v3/schedules/bulk | enable, disable or delete up to 200 schedules |
GET /api/v3/runs?schedule_id=… | Runs a schedule started |
Schedules do not carry webhooks. To be called when scheduled runs end, use an account webhook.