Automation
Run agents on a schedule or in response to external events.
A run is the unit of agent execution. This guide covers the two ways to fire one without a human in the loop: schedules that run on a cron, and triggers that fire on events from your connected integrations.
Where to set them up
Every agent's detail page has a Triggers card. It collapses three rows you can expand on demand:
- API call — always on once the agent is active. The endpoint to call lives behind the row.
- Schedule — cron-style schedules. The row badge shows how many are active or paused at a glance.
- GitHub events — runs triggered by GitHub activity, available whenever the GitHub integration is connected.
Open the row you care about, fill in the form, save. The Triggers card shows the current state alongside the agent so you never have to remember what's wired up where.
Schedules
A schedule attaches a cron expression to an agent. Levain fires a run at each matching time and reports its outcome alongside any manually triggered run.
When you create a schedule, you set:
- A cron expression, evaluated in the timezone you pick (defaults to UTC).
- What to send the agent — either a prompt for single-turn instructions, or a structured payload matching the agent's state schema.
Pause a schedule from its row in the Triggers card to stop new runs without losing the setup. Flip it back on when you're ready, or delete it outright when you no longer need it.
GitHub events
Once you've connected the GitHub integration, the GitHub events row lists every event type Levain can listen for — pull requests, pushes, issue comments, and new issues — and lets you turn each one into a trigger with one click. The event payload becomes the run's input, so the agent sees the same shape GitHub delivers.
You can wire several events to the same agent, and the same event to several agents. Triggers and the integration they belong to are linked: disconnecting the integration drops the triggers, and reconnecting it later means rebuilding them.
Watching automated runs
Scheduled and triggered runs use the same lifecycle and the same session log as manual ones. Filter the Runs tab by agent to see everything that ran, regardless of how it started.
From the API
Schedules and triggers are fully scriptable. The Schedules API covers schedule management; trigger endpoints live under the Agents API.
Next
- Connect an integration so triggers have an event source.
- Read up on the run lifecycle to know what happens after a schedule or trigger fires.