---
node_type: cursor_cloud_agent
category: ai
color: purple
icon: simple-icons:cursor
display_name: Cursor Cloud Agent
description: Create and manage Cursor Cloud Agents for automated code generation.
---

# Cursor Cloud Agent

Interact with [Cursor Cloud Agents](https://cursor.com) directly from your workflow. Create agents, send followups, poll for results, and manage the full agent lifecycle.

## Sockets

| Socket | Direction | Description |
|---|---|---|
| `input` | Input | Workflow data available for `{{input.*}}` interpolation in config fields |
| `output` | Output | Cursor API response as JSON |

## Configuration

### Connection
A **Cursor Cloud Agent** connection containing your Cursor API key. Create one from Settings → Connections → Cursor Cloud Agent.

### Operation
A tagged-union selector. Each variant exposes its own config fields.

### Retry
Whether each Cursor API request is sent again after a failure that passes: a rate limit, a busy server, a dropped connection. Off by default; see [Retries](http_get.md#retries) for how attempts and waits work. Wait For Run's polls, Get Run Result, List Agents, Get Agent and Delete Agent are sent again freely. Create Agent, Send Followup, Cancel Run, Archive Agent and Unarchive Agent are writes, sent again only when Cursor refused them before acting: the connection never opened, or Cursor answered 425 or 429.

Cursor answers a rate limit with 429 and a `Retry-After` header saying how long to wait, which Retry follows. Cursor does not document how it reports running out of capacity to start or run an agent: it may answer 429, 503 or 500, or the run may end in `ERROR`. A run that ends in `ERROR` is a finished run, not a failed request, so Retry never repeats it.

## Operations

### Create Agent
Create a new Cursor Cloud Agent with an initial prompt.

| Field | Type | Description |
|---|---|---|
| `prompt` | TextBlock | Instructions for the agent |
| `repo_url` | TextBlock | GitHub repository URL |
| `starting_ref` | TextBlock | Branch, tag, or commit SHA |
| `pr_url` | TextBlock | GitHub pull request URL |
| `model_id` | TextBlock | Model ID (required, e.g. `gpt-5`, `claude-sonnet-4-20250514`) |
| `auto_create_pr` | Boolean | Ask Cursor to open a pull request when the run completes (default: true). See caveat below. |
| `work_on_current_branch` | Boolean | Push directly to `starting_ref` or the PR head branch instead of a new Cursor-generated branch |
| `name` | TextBlock | Custom agent display name |
| `env_vars` | JSON | Environment variables as JSON object |
| `mode` | Enum | Agent mode: `agent` or `plan` (default: `agent`) |
| `env_type` | Enum | Cursor environment type: `cloud`, `pool`, or `machine` |
| `env_name` | TextBlock | Cursor environment name |

Create Agent requires either `repo_url` or `env_name`. Do not set both: Cursor treats explicit repositories and named environments as mutually exclusive.

Cursor API v1 does not support choosing a custom new branch name. Use `starting_ref` to choose the base ref. If you need Cursor to push to a specific existing branch, set `starting_ref` to that branch and enable `work_on_current_branch`.

#### Auto PR caveat

Cursor Cloud Agents created through the API can fail automatic PR creation even when the Cursor GitHub App appears to have the right repository permissions. The common GitHub error is `Resource not accessible by integration` around `createPullRequest`. This is a Cursor GitHub App runtime-token scope issue; only Cursor can fix the built-in `auto_create_pr` path reliably.

Workarounds:

- Add a repo-scoped GitHub token as `GH_TOKEN` in Cursor Cloud Agent environment/secrets so the agent can use GitHub directly.
- Set `auto_create_pr` to `false`, let Cursor push a branch, then create the PR in a later Verdalia workflow step using GitHub tooling or a webhook/integration.
- For a predictable existing branch, set `starting_ref` and enable `work_on_current_branch`.

### Wait For Run
Wait for a Cursor agent run to reach a terminal state. If `run_id` is empty, fetches the latest run from the agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |
| `run_id` | TextBlock | Run ID (leave empty for latest) |
| `poll_interval_secs` | Integer | Poll interval in seconds (default: 10, max: 300) |
| `timeout_secs` | Integer | Timeout in seconds (default: 600, max: 3600) |

With Retry on, a poll that meets a rate limit or a server error is sent again, so one failed poll does not end the wait.

### Get Run Result
Get the result of a Cursor agent run. If `run_id` is empty, fetches the latest run.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |
| `run_id` | TextBlock | Run ID (leave empty for latest) |

### Send Followup
Send a follow-up prompt to an existing agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |
| `prompt` | TextBlock | Follow-up instructions |

### Cancel Run
Cancel a running Cursor agent run.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |
| `run_id` | TextBlock | Run ID to cancel |

### List Agents
List Cursor Cloud Agents.

| Field | Type | Description |
|---|---|---|
| `limit` | Integer | Maximum agents to return (default: 20, max: 100) |

### Get Agent
Get details about a specific agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |

### Archive Agent
Archive a Cursor Cloud Agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |

### Unarchive Agent
Unarchive a Cursor Cloud Agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |

### Delete Agent
Permanently delete a Cursor Cloud Agent.

| Field | Type | Description |
|---|---|---|
| `agent_id` | TextBlock | Agent ID |

## Run Statuses

| Status | Meaning |
|---|---|
| `CREATING` | Agent is initializing |
| `RUNNING` | Agent is actively working |
| `FINISHED` | Run completed successfully |
| `ERROR` | Run encountered an error |
| `CANCELLED` | Run was cancelled by user |
| `EXPIRED` | Run timed out |

## Example: Create Agent and Wait

1. Add a **Cursor Cloud Agent** node with operation **Create Agent**
2. Configure: prompt = `"Fix the failing test in src/tests/api_test.rs"`, repo_url = `"https://github.com/org/repo"`, auto_create_pr = `true`
3. Add a second **Cursor Cloud Agent** node with operation **Wait For Run**, wire the first node's `output` to its `input`
4. Set `agent_id` to `{{output.agent_id}}` and leave `run_id` empty (auto-resolves latest)
5. Execute — first node creates the agent, second polls until the PR is ready

## Connection Setup

1. Go to [cursor.com/dashboard/integrations](https://cursor.com/dashboard/integrations)
2. Generate a new API key
3. In Verdalia, go to Settings → Connections → Cursor Cloud Agent
4. Paste the API key and test the connection

## See Also

- [Cursor Cloud Tools](cursor_cloud_tools.md) — Expose Cursor operations as AI agent tools
- [Cursor Cloud Agents API Documentation](https://docs.cursor.com)
