Marble 2 beta
Operations
Every task submission returns a long-running operation. Store its ID beside your own job record; the operation is how you observe progress and retrieve the terminal response.
Understand the operation envelope
An operation is a common status envelope around a task-specific result:
| Field | Meaning |
|---|---|
id | Stable short ID used in Developer API /operations/{operation} paths. |
name | Full resource name for the same operation. |
ownerId | Account that owns the operation. The API key still limits access to its project. |
metadata | Task information. Use metadata.task to interpret a generic response, and use done to determine completion. |
done | The only terminal signal. Do not infer completion from metadata. |
response | Task-specific result after a successful terminal operation; otherwise null. |
error | Failure details after a failed terminal operation; otherwise null. |
createdAtSecs | Unix time when the task was accepted. |
expiresAtSecs | Task execution deadline when present, not an asset read-URL expiration. |
The API reference gives each task submission a type such as
AtlasGenerateResponseOperation. This is not a second kind of operation. It
means the common operation envelope above, with response typed as
AtlasGenerateResponse. The generic GET /operations/{operation} endpoint can
return work from any task, so its response type is simply Operation; use the
task you submitted or metadata.task to interpret its successful response.
Submit once
Send a stable Idempotency-Key for each logical task. If a timeout or broken
connection makes the response uncertain, retry the same validated body with
the same key. Reusing that key with a different body returns 409.
Do not create a new idempotency key for a transport retry; that can start duplicate work.
Wait or poll
For a bounded blocking read, call:
Waiting is best-effort and capped server-side. The response may still have
done: false. Poll with GET /operations/{operation} using capped exponential
backoff and jitter when work outlives the wait.
Use done as the terminal signal:
done: false: work is still running;done: truewithresponse: the task succeeded;done: truewitherror: the task failed.
A fast task can come back from its submission already done: true with its
response. The stored operation catches up a moment later, so a
GET /operations/{operation} right after can still show done: false. Treat
the first done: true you receive as final.
A response returned from the submission can carry each file the task produced
inline, as a data URL in base64, and name each input it echoes back by
assetId. images2PosedRGBD does this only when the request sets
"base64Outputs": true; otherwise its submission response names files by
assetId and url. The stored operation names the same files by assetId
and url. Read a file from whichever form the response you hold carries.
Task metadata can report a phase or progress percentage, but clients must not infer completion from those fields.
List project operations
List entries include metadata, completion status, and failure details, but omit
the task's response payload. Fetch GET /operations/{operation} for the
result and output URLs; use done and error to distinguish success from
failure in a list entry.
GET /operations lists the API key's project operations newest first. Use
pageSize and preserve nextPageToken exactly. Filters are applied on the
server, so a page holds only matching operations and paging stays exact at any
volume:
| Query parameter | Narrows the list to |
|---|---|
task | One task, by its metadata.task name, such as atlasGenerate. |
status | RUNNING, SUCCEEDED, or FAILED. FAILED is every done operation with an error, so cancelled and expired operations count. |
createdAfter, createdBefore | Operations accepted in a half-open window of Unix seconds: at or after createdAfter, before createdBefore. |
origin | Developer API operations, or work started in another Marble surface. |
task and status only search the last 30 days, even when createdAfter is
earlier.
The authenticated platform shows the same history with the same filters on Operations.
Retention
An operation, its request trace, and its terminal response are available for 30 days after the operation is accepted. Do not plan on reading them later than that: record the operation ID, the request, and any output assets you need in your own systems within the window.
Output assets are kept in the project's library until you delete them, unless the account has chosen not to retain uploads and outputs (Account settings) or the request said so itself:
Such an operation's outputs, and any input it consumed that was uploaded under
the same setting, are purged one hour after it finishes; the operation's own
record stays. Download what you need within that hour. The request field can
turn purging on for one operation but cannot turn it off for an account that
purges: sending false there is rejected. Where purging is not enabled,
a request asking for it is refused with 412. Assets the platform will purge
report "transient": true and no contentPath; read them through
:createReadUrl.
Inspect a trace
GET /operations/{operation}:trace returns the request as you sent it beside
the operation's response and error, served exactly as GET /operations/{operation} serves them. Use it to reproduce a result or compare
the exact payload. A request recorded under an earlier version of the task's
schema is returned as recorded. Like the operation itself, the trace is
available while the operation is within the retention window.
Request cancellation
Cancellation is asynchronous and best-effort:
Reuse requestId when retrying cancellation. Continue polling until terminal;
work that already finished may retain its real success or failure result.