Skip to content
Proud to collaborate with Microsoft for Startups

neon.roles.create ​

Create a role on a Neon branch

Creates a role on a Neon branch.

Issues POST /projects/{neon_project_id}/branches/{neon_branch_id}/roles with body {"role": {"name": role_name}}. The Neon-generated password is NEVER returned on this surface — to (re)obtain a password use neon.roles.reset_password (A-18).

Idempotency: HTTP 409 (role already exists) is treated as success. The existing role is re-fetched via GET .../roles and returned, so re-running the atomic with the same inputs converges instead of failing.

Inputs:

  • neon_project_id: Neon project id (required)
  • neon_branch_id: Neon branch id the role is created on (required)
  • role_name: name of the role to create (required)

Outputs (terminal state_data):

  • neon_project_id: str — pass-through project id
  • neon_branch_id: str — pass-through branch id
  • role_name: str — confirmed role name
  • is_protected: bool — whether Neon marks the role as protected

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
neon_branch_idstringYes—Neon branch id the role is created on
role_namestringYes—Name of the role to create

Output Schema ​

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

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeCreate-role request accepted
completedNoYesYes—Neon role created
failedNoYesNo—Neon role creation failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedCreate Neon role
* (any state)failfailedMark workflow failed

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "neon.roles.create",
  "initial_data": {
    "neon_project_id": "value",
    "neon_branch_id": "value",
    "role_name": "value"
  }
}