Tasks
A task is an actor saved with an input and run options. Run it again in one click, point a schedule at it, or start it from the API by name. Find tasks under Actors → Saved tasks.
Create a task
From an actor:
- Open the actor and fill in its Input tab.
- Click Save as task and give the task a Name (lowercase letters, digits and dashes).
From a run: on the run page, open Automate → Save as a task. The task keeps the run's input and options. You can save the task and a schedule in one step with Save task and schedule.
From Saved tasks: click New task, pick the actor, then fill in the input.
The task page has the input form, Settings (Title, Memory (MB), Timeout (s), Max items and Max cost per run), Runs of this task and a Monitoring section for monitors that apply only to this task's runs.
Run a task
- In the Console: Run now. If you changed the form, the button reads Save and run and saves first.
- From the API:
curl -s -X POST "https://lantfly.com/api/v3/tasks/$TASK_ID/runs" \
-H "Authorization: Bearer $LANTFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "input": { "maxPagesPerCrawl": 10 }, "wait_for_finish": 30 }'
| Field | Meaning |
|---|---|
input | Merged over the saved input: fields you send replace the saved ones. |
options | Merged over the saved options (memory_mb, timeout_secs, build, max_items, max_total_charge_usd). |
exact | true ignores the saved input and options: the run gets only what you send, and is still linked to the task. |
wait_for_finish | 0 to 60 seconds to wait for the run to finish. |
webhooks | Up to 10 webhooks for this run only. Tasks do not store webhooks. |
The run is a normal run with task_id set.
Manage tasks with the API
| Request | What it does |
|---|---|
GET /api/v3/tasks?q=daily | List tasks; q searches name and title, actor_id filters, paged with page and per_page |
POST /api/v3/tasks | Create: actor, name, optional title, input, options |
GET / PATCH / DELETE /api/v3/tasks/:task | Read, change the title, input or options, or delete |
POST /api/v3/tasks/:task/duplicate | Copy the task as name-copy |
POST /api/v3/tasks/bulk | { "ids": [...], "action": "delete" }, up to 200 tasks |
Deleting a task makes schedules that run it fail until you point them at another task. Runs it already made stay.