deploy.database.provision-postgres ​
Provision a PostgreSQL database for a deployment target using Cloud SQL primitives.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-deployments |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID. |
connection_uuid | uuid | Yes | — | GCP connection UUID. |
project_id | string | No | — | GCP project override. |
region | string | Yes | — | Cloud SQL region. |
instance_id | string | Yes | — | Cloud SQL instance id. |
database_name | string | Yes | — | PostgreSQL database name. |
database_user | string | Yes | — | Runtime DB user. |
database_password | string | No | — | Password to set or rotate; generated if omitted. |
instance_config | json | No | — | Tier, storage, backup, network and HA config. |
secret_id | string | No | — | Secret id for DATABASE_URL or component credentials. |
labels | json | No | — | Labels for provider resources. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | Echoed organization UUID. |
connection_uuid | uuid | No | — | Echoed GCP connection UUID. |
project_id | string | No | — | Effective project. |
region | string | No | — | Cloud SQL region. |
instance_id | string | No | — | Cloud SQL instance id. |
instance_connection_name | string | No | — | Cloud SQL connection name for Cloud Run. |
database_name | string | No | — | Database name. |
database_user | string | No | — | Database user. |
database_url_secret | json | No | — | Secret Manager reference for DATABASE_URL. |
env | json | No | — | Non-sensitive DB env fragments. |
secret_env | json | No | — | Cloud Run secret env mapping. |
failure_reason | string | No | — | Engine failure reason. |
failed_step | json | No | — | Failed DAG step envelope. |
failed_layer | json | No | — | Failed DAG layer envelope. |
failed_at_state | string | No | — | State where failure occurred. |
error | string | No | — | Error message. |
error_type | string | No | — | Error class. |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | provision | — |
waiting | No | No | — | — | Polling the Cloud SQL create operation |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | provision | waiting | — |
waiting | poll | waiting | — |
waiting | finalize | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "deploy.database.provision-postgres",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value",
"region": "value",
"instance_id": "value"
}
}