Routines
Run work on a schedule or from a webhook. Create a routine, add triggers, set variables and overlap rules, run it by hand and read its history.
A routine creates a task for an agent again and again: on a schedule, when one of your systems calls a webhook, or when you press Run now. Use it for daily reports, weekly reviews, reactions to alerts, or anything that should happen without someone remembering to ask.
Before you begin
You need the Manage routines permission (routines:manage) and at least one agent.
Create a routine
- Open Routines and select New routine.
- Give it a title, the agent that does the work and, optionally, a project.
- Write the request: the task description the agent receives on each run.
- Select Create. The routine exists but does nothing until it has a trigger or you run it.
Variables
Write {{name}} in the request to declare a variable, for example Summarize tickets from {{week}}. Each variable can have a label, a type (text, number, yes/no, a choice, a date), a default and a Required switch. A run must supply every required variable that has no default.
Add a trigger
Open the routine's Triggers section and select Add trigger.
| Kind | Starts a run when | Settings |
|---|---|---|
| Schedule | The cron expression comes due in the chosen time zone. | Cron expression, time zone. |
| Webhook | Your system sends a signed request to the trigger's URL. | Signing mode, replay window. |
| API | Someone calls the run endpoint with this trigger. | None. |
A schedule such as 0 9 * * 1-5 with the time zone Europe/Istanbul runs at 09:00 Istanbul time every weekday.
For a webhook, the console shows the URL and, once, the secret. Your sender signs each request with it. Webhooks have their own page: Routine trigger webhook.
When runs overlap
Choose what happens when a run is due while the previous one is still working:
| Setting | Effect |
|---|---|
| Coalesce if active | The new run merges into the active one instead of starting another. |
| Skip if active | The new run is skipped and recorded as skipped. |
| Always enqueue | Every run is kept and starts in turn. |
And what happens to runs missed while the routine was paused:
| Setting | Effect |
|---|---|
| Skip missed | Missed runs are dropped. |
| Enqueue missed (with a cap) | Missed runs are created on resume, up to a limit. |
Run it by hand
Select Run now, fill in any variables and confirm. The run creates its task right away.
What a run does
Each run creates one task, assigned to the routine's agent (or the agent you chose for this run), and wakes that agent. The task is ordinary: you can follow it, reply, and see its cost. Pause, access and budget limits still apply, so a routine never spends past a budget.
History and revisions
- Runs lists every run with its source (schedule, webhook, API or manual), its status and the task it created.
- History lists configuration versions: every change to the request, agent or triggers creates a revision you can restore.
Pause or archive
Set the routine's status to Paused to stop new runs while keeping the triggers, or Archived to retire it. Webhook calls to a paused or archived routine are refused with 409.
From the API
Create a routine, add a schedule and start a run:
ROUTINE_ID=$(curl -s -X POST "https://intelligence-api.veyra.so/api/companies/$COMPANY_ID/routines" \
-H "Authorization: Bearer $VEYRA_API_KEY" -H "Content-Type: application/json" \
-d '{"title": "Weekly support summary", "description": "Summarize tickets from {{week}}.", "assigneeAgentId": "'"$AGENT_ID"'"}' | jq -r .id)
curl -X POST "https://intelligence-api.veyra.so/api/routines/$ROUTINE_ID/triggers" \
-H "Authorization: Bearer $VEYRA_API_KEY" -H "Content-Type: application/json" \
-d '{"kind": "schedule", "cronExpression": "0 9 * * 1", "timezone": "Europe/Istanbul"}'
curl -X POST "https://intelligence-api.veyra.so/api/routines/$ROUTINE_ID/run" \
-H "Authorization: Bearer $VEYRA_API_KEY" -H "Content-Type: application/json" \
-d '{"source": "api", "variables": {"week": "2026-W46"}, "idempotencyKey": "support-2026-w46"}'A repeated idempotencyKey returns the first run instead of starting another, so retries are safe.
See Create a routine, Create a routine trigger, Manually run a routine and every endpoint in Routines.