A run is one agent working on one task in its own microVM. You send a prompt, JSON input, and the files and connections it may use. Ephemeral queues it, starts a fresh machine, records every step, and destroys the machine when the run ends.
What a run is made of
Every run has a prompt and optional input. The rest of the definition decides which model it uses, what it can read, what it can call, how long it may take and how much it may spend. You can send the whole definition inline, or name a saved workflow and send only the input.
{
"prompt": "Find out why this payment failed. Follow the playbook.",
"input": { "payment_id": "pay_123" },
"model": "anthropic/claude-haiku-5.5",
"files": [{ "file": "playbook.md" }],
"connections": { "payments": { "ref": "payments-api", "allowed_methods": ["GET"] } },
"timeout_seconds": 120,
"shell": false,
"max_cost_micros": 500000
}Inside the microVM the agent can always read the files you mounted. With shell on, which is the default, it can also run shell commands and write files in its working directory. Each connection you grant adds tools it can call, and with web access on it can read pages, search and call public APIs. The machine itself has no internet. The working directory is discarded with the machine, so nothing carries over to the next run.
Lifecycle
A run moves through these statuses. The last five are final; once a run reaches one of them it does not change again.
| Status | Meaning |
|---|---|
reserving | Hosted only. Credits for the run's budget are being reserved. |
queued | Waiting for a free worker slot. |
starting | Taken from the queue. The definition and files are being loaded. |
running | The microVM is starting or the agent is working. |
succeeded | The agent finished and returned output. |
failed | The worker failed, or credits could not be reserved. The error field says which. |
cancelled | Someone cancelled the run. |
timed_ | The run reached its timeout before finishing. |
interrupted | The engine restarted during the run, or admission did not complete. |
Runs leave the queue in the order they were created. A self-hosted installation runs two at a time by default; the rest wait in queued. The timeout counts from the moment a run leaves the queue, so time spent waiting does not use it up.
Limits
| Limit | Value |
|---|---|
timeout_ | 1 to 3,600. Default 300. |
| Prompt | 128 KiB |
| Input | 1 MiB of JSON |
| Files | 32 per run, 1 MiB each, 4 MiB in total |
| Connections | 16 per run |
| Model calls | 100 per run |
| Output per model reply | The model's own limit, up to 32,000 tokens, shortened to fit what is left of the budget. A reply cut off at the limit is continued automatically, twice at most. |
| Web requests and searches | 50 per run, when web access is on |
| Output | Up to 1 MiB. A longer answer is cut there, and the run records that it was. |
| Events | The record keeps up to 256 KiB per event and 10,000 events or 16 MiB per run. Larger tool results are shortened in the record and marked; the agent still receives them in full. When the record is full, later detail is skipped and counted. Neither ever fails the run. |
max_ | 1 to 100,000,000 (up to $100) |
Following a run
There are three ways to learn what a run is doing and when it ends.
- Poll
GET /v1/runs/{id}until the status is final. - Stream
GET /v1/runs/{id}/events. This is a server-sent event stream that replays everything recorded so far, then continues live until the run ends. - Set a callback on the run. Ephemeral sends a signed request to your server when the run reaches a final status.
Closing the event stream does not affect the run. You can reconnect with the last event ID you received and continue from there.
Event types
| Type | Recorded when |
|---|---|
status | The run starts running or reaches a final status. |
microvm_ | Ephemeral requests a microVM. |
microvm_ | The microVM is up. |
worker_ | The agent process starts. Includes whether the shell is on. |
connection_ | An MCP connection is ready, with the tools the run may call. |
tool_ | The agent calls a tool. Includes the arguments. |
tool_ | A tool call returns. Includes the result and whether it was an error. A result over 256 KiB is shortened here and carries trimmed_from_bytes. |
text_ | The model streams text, in batches about ten times a second. |
model_ | A model response ends. Token usage as reported by the worker; not used for billing. |
usage | Ephemeral authorizes or reconciles the cost of a model call. |
connection | The engine makes an HTTP request or MCP tool call on the run's behalf. |
web_ | The engine sends a web request for the agent. Includes the URL, status, cost and safety check. |
web_ | The engine runs a web search for the agent. |
web_ | A web request or search was refused before it was sent. Includes the reason. |
result | The agent returns its final output. The run's output field holds all of it; this event may be shortened. |
model_ | A model call was refused, for example because its worst-case cost exceeds what is left of the budget. Includes the reason. |
output_ | A reply reached the model's output limit and the agent was asked to continue. |
output_ | The final output was longer than 1 MiB and was cut there. |
events_ | The run record was full, so later events were not stored. Includes how many. |
worker_ | The worker stops with an error. |
microvm_ | The microVM is confirmed destroyed. |
microvm_ | Termination could not be confirmed yet and will be retried. |
done | Last message on the stream. Carries the final run object. |
Ephemeral removes known credential values, such as connection tokens, from events and output before storing them. The API reference shows the exact stream format.
Cancelling a run
POST /v1/runs/{id}/cancel stops a run that is reserving, queued, starting or running. The worker is stopped and the microVM is terminated. Cancelling a run that has already finished changes nothing.
Zero data retention
Set zero_data_retention to true on a run, or in a saved workflow, when the task is sensitive. Ephemeral then records nothing of the run's content: you only get the output.
| Kept | Not kept |
|---|---|
| Run ID, organization, status, timestamps, schedule, cost and usage figures, and a generic error category with no worker text. | Events and output once delivered, worker error text, and the run's definition: prompt, input, file list and connection references. A run's definition cannot be fetched or run again. |
- Events still stream while the run works, through
GET /v1/runs/{id}/eventson any engine. They are held in a transient store and deleted a few minutes after the run ends. - The output is returned once. The first
GET /v1/runs/{id}after the run ends includes it and deletes it. With a callback, the callback delivers it and reads leave it in place until then. Either way it is deleted after at most an hour.output_availableandoutput_expires_atsay whether it is still held. - Model calls go only to providers that neither retain your data nor train on it. A model with no such provider is refused with
400before anything is reserved. - On the hosted service the run costs 10% more: the surcharge applies to compute, model calls and web requests, counts toward the budget and appears in the cost breakdown. Self-hosted installations charge nothing extra.
- Transient data lives in tables that every backup leaves out, so a restored database never contains it.
After a run
The run keeps its output, error message, timestamps, events and cost. Treat the cost as final once the status is final and billing_pending is false; see budgets and billing.
Finished runs are deleted 30 days after they end, together with their events. A run is kept longer while its billing, callback delivery or microVM cleanup is still pending. Self-hosted installations can change the retention period.
To run the same task again, fetch GET /v1/runs/{id}/definition. It returns the definition the run actually used, with credentials removed, so you can review it, set a new budget and submit it.