Building your own
Wire a role to a trigger and a collection, set a budget, and you have a standing loop.
The built-in loops aren't privileged code — they're the same machine you get. An automation is four pieces of configuration. Note what isn't among them: the behavior, which lives in the agent role.
| Piece | What it says |
|---|---|
| Role | What the agent does when it wakes. |
| Trigger | When it wakes: manual (Run now), a schedule (daily, weekly…), or event subscriptions. |
| Outputs | The document collections it maintains — its durable memory and its deliverable. |
| Policy | Its budget: max runs per day, and a per-run token cap. |
Pick a role, say when it wakes, name what it writes, set the budget. There's no stored goal to keep in sync with the role's instructions, because there's only one place the behavior lives.
Triggers: batch or digest
Event subscriptions bind the loop to sources on the event spine, optionally filtered by kind. There are two ways to consume them:
| Mode | Behavior |
|---|---|
| Batch | An event wakes a run immediately, and a cooldown debounces the followers — a burst of commits becomes one run, not twenty. |
| Digest | Events only accumulate. The next scheduled or manual run consumes them. |
Batch suits react-now work: triage an error, respond to a merge. Digest suits work that reads better in aggregate — a weekly write-up over everything that happened since the last one.
One run at a time
A loop never runs concurrently with itself. If events arrive while a run is in flight, they accumulate as lag and the next run drains them. Nothing is lost, and nothing gets processed twice.
Outputs: active or proposed
Each collection a loop writes is either active on write or proposed — landing in your Inbox to wait for your yes. That's the autonomy dial, and it's per collection, so one loop can keep its own working notes active while everything user-visible waits for review.
Budgets that fail gracefully
Policy caps how many runs a day the loop gets and how many tokens each run may spend. A run that hits its token cap finishes cleanly and resumes on its next trigger, picking up from the documents it maintains — because state lives in those documents rather than in a conversation, there's no half-finished thread to rescue.
Every run leaves a record
Each run records the exact prompt it started from, the outcome, what it edited, and what it cost in tokens. Even a wake-up that a budget cap skipped leaves a row, so silence is visible too: "why didn't it run last night?" has an answer instead of a shrug.
That record is how you tune a new loop. Start it on a schedule with proposed outputs, read what it actually did and what it cost, then widen its trigger or promote a collection to active once it's earning it.