Execution, budgets and failures
Where things run
Workflows execute on Ring's server. AI calls are made from the server with the server's credentials; no provider key reaches the browser. AI computation happens off-chain. Nothing about a run is written to Elysium.
Lifecycle
A draft is validated in the browser and again on the server. An accepted run goes through:
queued → running → completed
→ failed
→ canceled
→ budget_exceeded
Steps go through pending → running → completed, or end as skipped or failed.
Slices, and why a run survives a closed tab
Creating a run only queues it. Execution happens in slices: a request to /api/runs/<id>/advance runs the next steps for up to about 40 seconds, saves every result, and returns. The browser asks again until the run ends. All state is in the database, so any process can continue a run:
- the browser that started it, slice by slice;
- the same run page reopened later;
- the scheduled worker at
/api/cron/runs, which picks up runs nobody is advancing.
A database lease makes sure only one of them advances a run at a time. Ring never starts background work in a request and assumes it outlives the response.
A step that was interrupted mid-flight (for example a killed process) is tried again if it has an attempt left, and otherwise recorded as failed with the code interrupted.
Idempotency and limits
- Creating a run requires an
Idempotency-Keyheader. Submitting the same key again returns the existing run, so a double click or a retried request cannot start a second one. - An owner may have two open runs at a time.
- Run creation, advancing, saving, publishing and sign-in are rate limited per owner and per address, with counters kept in the database so every server instance shares them.
Budgets
Each workflow has a maximum budget in USD. It caps what a run counts against AI calls; steps without a model call cost nothing.
Before a run the Studio shows a worst-case estimate: every AI step at its input limit and its full output limit, at the configured price.
Before each AI call the engine:
- counts the input tokens with the provider's token counter (falling back to a deliberately high estimate of one token per two bytes);
- assumes the model will use its whole output limit;
- multiplies by the configured price and by a 1.25 safety factor, because a refusal fallback may be served by a model with a higher price;
- compares that reservation with what is left of the budget.
If the reservation does not fit, the call is not made and the run ends as budget_exceeded. Completed steps keep their outputs.
After the call the engine records the provider's reported token usage, priced by the model that actually served the reply.
These figures are estimates built from configured prices. The provider's invoice is the only exact record. Where a cost cannot be measured, the record says so:
- the call timed out or was interrupted: the full reservation is counted, marked as not measured;
- the provider reported no usage, or the serving model has no configured price: the full reservation is counted, marked as not measured;
- no price is configured for the model at all: AI steps do not run, because a budget could not be enforced.
Failures and retries
- An error that may pass on its own (timeout, rate limit, 5xx, dropped connection) is retried once automatically. If the slice has no time left, the retry happens in the next slice.
- Any other error fails the step immediately.
- A failed step fails the run. Steps after it stay
pending. - The owner can retry a failed run from the failed step, up to two times. Completed steps keep their outputs; what was already counted against the budget stays counted.
- Cancel stops a run before its next step. A step that is in the middle of a provider call finishes or times out first.
Every error is stored as a structured record: a stable code, a message that is safe to show, and whether a retry can help. Text that looks like a credential is masked before it is stored.
Provider costs can occur even when a later step fails: a summary that was produced and paid for stays paid for if the formatter after it breaks. Ring does not promise "no charge on failure".
Reference runs
The public pages show real run records, not mock-ups. They come from reference runs: the scheduled worker starts five runs under an operator account that belongs to nobody's wallet, with the same engine, the same budget checks and the same shared AI allowance as any visitor's run.
| Reference | What it runs | How often |
|---|---|---|
| News Digest | The template, unchanged, on its three default feeds | Daily |
| Token Research | The template, unchanged, on the USDC contract on Elysium | Daily |
| Research Brief | The template, unchanged, on its two default pages | Weekly |
| Stopped by its budget | The Research Brief with a one-cent budget: the reservation does not fit, no call is made | Weekly |
| Stopped by a gate | The Research Brief pointed at a page that does not exist: the gate stops the workflow | Weekly |
Each reference has a revision number. When the engine or a template changes in a way the public record should show, the revision is raised and the next scheduled pass runs that reference again without waiting for its interval. Earlier records stay readable at their own address.
These records are public by design and read-only: anyone can open one at /runs/<id>, nobody can cancel or retry it. They contain only public pages, feeds and chain reads. Without an AI provider the templates run in their no-AI modes and the budget reference is skipped. Before the first reference exists, the landing page shows a labelled example instead.
The landing page's hero animation remains an illustration of how blocks combine and is labelled as one; the line beneath it names the newest real run.
Traces and receipts are different records
A workflow trace is the run record in Ring's database: step status, provider, timing, cost, sources, errors and outputs. It is private to the run's owner.
An on-chain payment receipt would be a public record of a settlement on Elysium. Ring does not create these in this version, and a trace is never written to the chain.