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 ​
| 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 the role is created on |
role_name | string | Yes | — | Name of the role to create |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
neon_project_id | string | No | — | — |
neon_branch_id | string | No | — | — |
role_name | string | No | — | — |
is_protected | 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 | Create-role request accepted |
completed | No | Yes | Yes | — | Neon role created |
failed | No | Yes | No | — | Neon role creation failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Create Neon role |
* (any state) | fail | failed | Mark 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"
}
}