# listRuns

```graphql
query ListRuns($command: RunsListRunsCommand!) {
  listRuns(command: $command) {
    data {
      id
      runId
      status
      projectId
      input
      output
      title
      labels
      parentRunId
      rootRunId
      createdAt
      updatedAt
      startedAt
      finishedAt
      config
      taskId
      conversationId
      inputMessageId
      outputMessageId
      batchId
      metadata
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

List runs; bound runtimes need own project\_id, trigger\_type=\["schedule"] and trigger\_id.

## Arguments

| Name                       | Type                 | Required | Description                                                                                                                                                                            |
| -------------------------- | -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command`                  | RunsListRunsCommand! | Yes      |                                                                                                                                                                                        |
| `command.taskId`           | ID                   |          | Discover agent runs with this persisted task identity across conversations. Matches canonical task metadata or the first enqueue request; results are not task authorization evidence. |
| `command.limit`            | Float                |          | Maximum number of records in a page, from 1 to 100. Defaults to 20.                                                                                                                    |
| `command.cursor`           | String               |          | Opaque cursor returned by the previous page. Reuse with unchanged filters and ordering.                                                                                                |
| `command.sortBy`           | String               |          | Field used to order runs: created\_at, status or duration. Defaults to created\_at.                                                                                                    |
| `command.sortOrder`        | String               |          | Sort direction: asc or desc. Defaults to desc.                                                                                                                                         |
| `command.status`           | \[String!]           |          | Run statuses to include. Values within this filter use OR; different filters use AND.                                                                                                  |
| `command.targetType`       | \[String!]           |          | Execution definition types to include: agent, task, workflow or legacy eval.                                                                                                           |
| `command.triggerType`      | \[String!]           |          | Trigger types to include: user, api\_key, service\_account, system, schedule, webhook, agent, task or workflow.                                                                        |
| `command.rootOnly`         | Boolean              |          | true lists only top-level runs (parent\_run\_id null). Defaults to false.                                                                                                              |
| `command.parentRunId`      | ID                   |          |                                                                                                                                                                                        |
| `command.targetId`         | \[ID!]               |          |                                                                                                                                                                                        |
| `command.triggerId`        | ID                   |          |                                                                                                                                                                                        |
| `command.projectReference` | ID                   |          |                                                                                                                                                                                        |
| `command.conversationId`   | ID                   |          |                                                                                                                                                                                        |

## Variables

```json
{
  "command": {}
}
```

## Responses

| Status | Description                              |
| ------ | ---------------------------------------- |
| 200    | The RunsRunConnection! in data.listRuns. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ListRuns($command: RunsListRunsCommand!) {\n  listRuns(command: $command) {\n    data {\n      id\n      runId\n      status\n      projectId\n      input\n      output\n      title\n      labels\n      parentRunId\n      rootRunId\n      createdAt\n      updatedAt\n      startedAt\n      finishedAt\n      config\n      taskId\n      conversationId\n      inputMessageId\n      outputMessageId\n      batchId\n      metadata\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n  }\n}",
  "variables": {
    "command": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "listRuns": {
      "data": [
        {
          "id": "string",
          "runId": "string",
          "status": "string",
          "projectId": "string",
          "input": {},
          "output": {},
          "title": "string",
          "labels": {},
          "parentRunId": "string",
          "rootRunId": "string",
          "createdAt": "string",
          "updatedAt": "string",
          "startedAt": "string",
          "finishedAt": "string",
          "config": {},
          "taskId": "string",
          "conversationId": "string",
          "inputMessageId": "string",
          "outputMessageId": "string",
          "batchId": "string",
          "metadata": {}
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      }
    }
  }
}
```
