client.runs is the shared run API for workflow, agent, manual, and eval runs.
Start
Get
expand:
List
Subresources
Artifacts
client.files.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
client.runs is the shared run API for workflow, agent, manual, and eval runs.
const { id } = await client.run('workflows.extract-invoice', input);
const result = await client.run('workflows.extract-invoice', input, {
waitForCompletion: 60,
});
const { id } = await client.run('agents.invoice-agent', input);
let run;
do {
await new Promise((resolve) => setTimeout(resolve, 2000));
run = await client.runs.get(id);
} while (!run.finished);
const run = await client.runs.get(id);
// { id, type, finished, execution, output?, files?, error?, timing, ... }
expand:
const run = await client.runs.get(id, { expand: ['usage', 'execution'] });
console.log(run.output, run.usage, run.execution);
const { runs } = await client.runs.list({
type: 'workflow',
status: 'failed,cancelled',
limit: 50,
});
await client.runs.usage(id);
await client.runs.steps(id);
await client.runs.events(id);
await client.runs.trace.get(id);
await client.runs.reviews.get(id);
await client.runs.reviews.update(id, {
note: 'Looks wrong',
verdict: 'incorrect',
status: 'open',
});
const { artifacts } = await client.runs.artifacts.list(id);
const bytes = await client.runs.artifacts.download(id, artifacts[0].path);
client.files.
await client.runs.cancel(id);
const rerun = await client.rerun(id, { waitForCompletion: 60 });
const { exampleId, name } = await client.runs.promote(id, { name: 'golden-invoice' });