Skip to content

List runs

Terminal window
kindgi runs list --limit=2
{
"data": [
{
"id": "657512f8-97b5-41bb-a0cc-396bffe158f6",
…
"flowId": "acme.reserve-order",
"flowVersion": "0.1.0",
"status": "cancelled",
…
},
{
"id": "365d7fd0-7801-43e5-a3c5-66f9479cf02d",
…
}
],
"hasMore": true,
"nextCursor": "eyJjcmVhdGVkQXQiOiIyMDI2LTEwLTAzVDIwOjE0OjE2Ljc0NFoiLCJpZCI6IjM2NWQ3ZmQwLTc4MDEtNDNlNS1hM2M1LTY2Zjk0NzljZjAyZCJ9"
}

Runs come newest first, 25 to a page by default (--limit, at most 100). --cursor=<nextCursor> gets the next page. The list leaves out each run's output; kindgi runs get <run-id> has it.

The CLI lists every run, including the agent turns inside flows (each one a run of agent.turn, with a parentRunId). The client can filter.

// The newest runs your app started, without the agent turns inside them
const page = await kindgi.runs.list({ topLevel: true, limit: 3 });
for (const run of page.data) console.log(run.id, run.flowId, run.status);
// The next page
if (page.nextCursor !== undefined) {
const next = await kindgi.runs.list({ topLevel: true, limit: 3, cursor: page.nextCursor });
console.log(next.data.length, next.hasMore);
}
f703bffb-367c-4abb-a699-006575b7c21a acme.reserve-order cancelled
54e3258d-3cd3-444a-8175-c965ef6cf682 acme.reserve-order completed
42b7c0c8-3c47-4962-9b08-3319ff887ada acme.review-order completed
3 true
  • topLevel: true (top_level=True) leaves out runs started inside other runs, such as agent turns: the runs your app and the CLI started.
  • includeOutput: true (include="output") adds each run's output.
  • In Python, paginate follows next_cursor for you.

parentRunId (parent_run_id) lists the runs a run started: for a flow, its agent steps' turns, each with the step it belongs to.

const run = await kindgi.runs.start({ flow: 'acme.process-order', input: { orderId: 'A-100' } });
const children = await kindgi.runs.list({ parentRunId: run.id });
for (const child of children.data) console.log(child.id, child.flowId, child.parentNodeId);
eb59636f-aaae-4cd2-84ec-66cbcbf55f83 agent.turn note

Read a run's journal to see what a turn did.