Recording

View as Markdown

Recordings capture the browser session for a run. Use recording viewers to replay a run after it completes, or to watch recording segments as they become available.

Get the run from the runtime, then create the recording viewer from the run.

1const run = await runtime.currentRun();
2
3const { iframeUrl, status } = await run.recording();
1<iframe src={iframeUrl} style="width: 100%; height: 600px; border: none;" />
Viewer URLs are opaque

The URL is backed by a short-lived server-side lease. Do not parse it, build sub-URLs from it, or store it long-term. When expiresAt passes, create a new viewer URL.

Options

1const { iframeUrl, activityStreamUrl, status, durationMs, expiresAt } =
2 await run.recording({
3 components: ["activity"],
4 });
ParameterTypeRequiredDescription
componentsArray<"activity">NoRequest viewer add-ons. Pass ["activity"] to receive activityStreamUrl.
expiresInSecondsnumberNoLease lifetime override. Default is one hour; max is 24 hours.

Recording status

StatusDescription
not_availableThe run produced no recording, or the recording window expired.
preparingEncoding has not started yet.
processingEncoding is in flight. The player can show segments that are already available.
readyThe recording is available for playback.
failedEncoding failed permanently.

Retention

Recordings are retained for 7 days after the run stops.

HTTP equivalent

1POST /v1/runs/{runId}/recording