neon.branches.set_primary ​
Promote a Neon branch to primary
Promotes a Neon branch to be the primary branch of its project.
Neon calls the primary branch the project's "default" branch; promoting a branch makes it the one that compute endpoints and the project default connection string target. This issues POST /projects/{neon_project_id}/branches/{neon_branch_id}/set_as_primary and confirms the branch's primary flag from the response.
Inputs:
- neon_project_id: Neon project ID owning the branch (required)
- neon_branch_id: Neon branch ID to promote to primary (required)
Outputs (terminal state_data):
- neon_project_id: str — confirmed Neon project ID
- neon_branch_id: str — confirmed Neon branch ID
- is_primary: bool — whether the branch is now primary (Neon's "default")
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 owning the branch |
neon_branch_id | string | Yes | — | Neon branch ID to promote to primary |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
neon_project_id | string | No | — | — |
neon_branch_id | string | No | — | — |
is_primary | 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.set_primary",
"initial_data": {
"neon_project_id": "value",
"neon_branch_id": "value"
}
}