Artifacts

View as Markdown

Artifacts are durable outputs produced by a run: downloads, screenshots, recordings, collected files, PDFs, reports, and other captured files.

In the SDK, start from the active run when you care about the current runtime session.

1const run = await runtime.currentRun();
2
3const { artifacts } = await run.artifacts.list({
4 kind: "download",
5});

You can also list artifacts across a space when you are building a broader file or audit view.

1const artifacts = await space.artifacts.list({
2 runtimeId: runtime.id,
3 limit: 50,
4});

Artifact identity

Artifacts have both an artifact ID and a backing storage file ID.

1for (const artifact of artifacts) {
2 console.log(artifact.id, artifact.fileId, artifact.path);
3}

Use the artifact APIs when you want run output semantics. Use space storage when you want durable file management.