---
title: "serviceRun"
description: "The durable record of one service generation — what was asked for, which gateway job is doing it, and what state that job reached."
section: "Types"
slug: "types-servicerun"
canonical: "https://origozero.ai/docs/types-servicerun"
updated: "2026-09-05T16:41:47.401387247+00:00"
tags: ["asset-type", "reference"]
---

# serviceRun

A generation is charged when it is submitted and then runs for minutes on the
gateway, which keeps the job and its finished result for hours afterwards. The
engine running the generation is the part that does not last: it can be
restarted, rebuilt or closed while the provider is still working. A run asset is
what survives that, so the answer to "what did I start, and where did it get to"
outlives the process that asked.

Every run carries the `jobId` its work is running under. That is the handle the
result is reached by when a run's engine did not live long enough to collect it
— `services.attach(jobId)` finishes a job that was already paid for, at no
further cost.

## Shape

`run.json` holds the record, and the same fields are mirrored onto `.metadata`
so a run is findable by query without being opened:

- `id` — the run handle `services.generate` returned
- `service`, `operation`, `prompt` — what was asked for
- `jobId` — the gateway job the work is running under
- `status` — `submitted` / `polling` / `completed` / `failed`
- `assetPath` — what it produced, once it has

## Reading them

`services.jobs()` lists runs and `services.status(id)` reads one. Both answer
from these records, so both keep answering after a restart.
