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 handleservices.generatereturnedservice,operation,prompt— what was asked forjobId— the gateway job the work is running understatus—submitted/polling/completed/failedassetPath— 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.