deploy.database.run-migrations ​
Run database migrations for a release through the configured runner backend.
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. |
deployment_target_uuid | uuid | Yes | — | Deployment target UUID. |
release_uuid | uuid | Yes | — | DeploymentRelease UUID. |
runner_connection_uuid | uuid | Yes | — | Runner backend connection UUID. |
image_reference | string | Yes | — | Image used to run migrations. |
command | list | Yes | — | Migration command argv. |
env | json | No | — | Plain environment variables. |
secret_env | json | No | — | Secret Manager env mappings. |
timeout_seconds | integer | No | — | Migration timeout. |
approval_ref | string | No | — | Approval token or policy ref when migrations require approval. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | Echoed organization UUID. |
deployment_target_uuid | uuid | No | — | Target UUID. |
release_uuid | uuid | No | — | Release UUID. |
runner_execution_uuid | uuid | No | — | Runner execution UUID. |
status | string | No | — | Migration status. |
exit_code | integer | No | — | Process exit code. |
log_ref | string | No | — | Runner log reference. |
started_at | string | No | — | ISO-8601 start time. |
completed_at | string | No | — | ISO-8601 completion time. |
failure_reason | string | No | — | Failure reason. |
failed_step | json | No | — | Failed step envelope. |
failed_layer | json | No | — | Failed 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 | — | launch | — |
waiting | No | No | — | — | Polling the runner execution |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | launch | waiting | — |
waiting | poll | waiting | — |
waiting | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "deploy.database.run-migrations",
"initial_data": {
"organization_uuid": "value",
"deployment_target_uuid": "value",
"release_uuid": "value",
"runner_connection_uuid": "value"
}
}