# runAgent (/api/reference/mutations/run-agent)

Run an agent on one or more candidates, optionally for a job, and wait for it. The agent may move a candidate's stage, grade them and leave notes. Returns one run for each candidate; a run that went wrong comes back with `status` `FAILED`, not as an error, and every run is kept whatever becomes of the rest of the request, so a caller that loses the answer can read `agentRun`. Every id is checked before anything runs, and so is the workspace's monthly limit: a request whose runs would pass it is refused whole. Every call runs the agent again.

```graphql
runAgent(
  input: RunAgentInput!
): RunAgentPayload!
```

### Arguments [#arguments]

#### [`runAgent.input`](#input) · [`RunAgentInput!`](/api/reference/inputs/run-agent-input) `non-null` `input` [#input]
Which agent to run, on whom.

### Type [#type]

#### [`RunAgentPayload`](/api/reference/objects/run-agent-payload) `object` [#runagentpayload-object]
The runs that were made.