Skip to content
Proud to collaborate with Microsoft for Startups

neon.databases.create ​

Create a database on a Neon branch

Create a database on a Neon branch (synchronous on the Neon API).

Issues POST /projects/{neon_project_id}/branches/{neon_branch_id}/databases with body {"database": {"name": db_name, "owner_name": owner_name}}.

Inputs:

  • neon_project_id: Neon project ID hosting the branch (required).
  • neon_branch_id: Neon branch ID to create the database on (required).
  • db_name: Name of the database to create (required).
  • owner_name: Existing role that will own the database (required).

Outputs (terminal state_data):

  • neon_project_id: str — pass-through project ID
  • neon_branch_id: str — pass-through branch ID
  • db_name: str — confirmed database name
  • owner_name: str — confirmed owner role
  • provider_metadata: dict — raw Neon response (database + operations)

Idempotency / error policy:

  • 4xx → WorkflowNotRetryableError (via _common.raise_for_neon_status).
  • 5xx / timeouts → propagate so the engine retries.
  • Neon returns operations[] that complete near-instantly; this atomic treats the response as synchronous (no polling). If the first operation is present and not yet "finished", a retryable error is raised so the engine re-runs the transition rather than implementing a polling loop.

Compensation: Use neon.databases.delete to undo. 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 hosting the branch
neon_branch_idstringYes—Neon branch ID to create the database on
db_namestringYes—Name of the database to create
owner_namestringYes—Existing role that will own the database

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
neon_project_idstringNo——
neon_branch_idstringNo——
db_namestringNo——
owner_namestringNo——
neon_database_idstringNo—Neon's own database id
neon_operation_idstringNo—Id of the create operation; feed to A-22 wait
provider_metadatajsonNo——
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.databases.create",
  "initial_data": {
    "neon_project_id": "value",
    "neon_branch_id": "value",
    "db_name": "value",
    "owner_name": "value"
  }
}