# agentRuns (/api/reference/queries/agent-runs)

The workspace's agent runs, newest first.

```graphql
agentRuns(
  after: String
  before: String
  filter: AgentRunFilter
  first: Int
  last: Int
): AgentRunConnection!
```

### Arguments [#arguments]

#### [`agentRuns.after`](#after) · [`String`](/api/reference/scalars/string) `scalar` [#after]
Return the rows that follow this cursor.

#### [`agentRuns.before`](#before) · [`String`](/api/reference/scalars/string) `scalar` [#before]
Return the rows that come before this cursor.

#### [`agentRuns.filter`](#filter) · [`AgentRunFilter`](/api/reference/inputs/agent-run-filter) `input` [#filter]
Narrow the list. Left out, every run is returned.

#### [`agentRuns.first`](#first) · [`Int`](/api/reference/scalars/int) `scalar` [#first]
How many rows to return, from the start or from `after`. 50 when left out, 200 at most.

#### [`agentRuns.last`](#last) · [`Int`](/api/reference/scalars/int) `scalar` [#last]
How many rows to return, counting back from the end or from `before`. 200 at most.

### Type [#type]

#### [`AgentRunConnection`](/api/reference/objects/agent-run-connection) `object` [#agentrunconnection-object]
A page of agent runs.