Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeAtomic
LibraryBase
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo—Cloud connection holding the Neon credential
neon_project_idstringYes—Neon project ID owning the branch
neon_branch_idstringYes—Neon branch ID to promote to primary

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
neon_project_idstringNo——
neon_branch_idstringNo——
is_primarybooleanNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

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"
  }
}