neon.branches.delete ​
Delete a Neon branch by project + branch ID
Delete a Neon branch by project + branch ID.
Inputs:
- neon_project_id: Neon project ID (required).
- neon_branch_id: Neon branch ID to delete (required).
Outputs (terminal state_data):
- neon_project_id: str — the project ID
- neon_branch_id: str — the deleted branch ID
- deleted: bool — true on success (including idempotent 404)
Idempotency: HTTP 404 (branch already gone) is treated as success. Primary branch cannot be deleted — Neon returns HTTP 409, mapped to a non-retryable error.
Compensation: branch deletion is destructive; recreate via neon.branches.create from a snapshot if needed. Plugin required: context.get_plugin("neon") must expose .api_token.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | Base |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Cloud connection holding the Neon credential |
neon_project_id | string | Yes | — | Neon project ID |
neon_branch_id | string | Yes | — | Neon branch ID |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
neon_project_id | string | No | — | — |
neon_branch_id | string | No | — | — |
deleted | boolean | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "neon.branches.delete",
"initial_data": {
"neon_project_id": "value",
"neon_branch_id": "value"
}
}