Run Commands

View as Markdown

Run commands are platform command records. They capture hosted invocation steps, SDK command execution, errors, timing, progress, and artifact counts.

Start from the runtime and get the active run.

1const run = await runtime.currentRun();

List commands

1const { commands, nextCursor } = await run.commands.list({
2 status: ["running", "succeeded", "failed"],
3 limit: 50,
4});
5
6for (const command of commands) {
7 console.log(command.sequenceNo, command.entryCall, command.status);
8}

Include heavier fields only when needed.

1const { commands } = await run.commands.list({
2 include: ["request", "result", "error"],
3});

HTTP equivalent

1GET /v1/runs/{runId}/commands