sql.query.run ​
Execute parameterized SQL against an external SQL connection (Postgres v1; mutations allowed)
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-sql |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
cloud_connection_uuid | uuid | Yes | — | — |
sql | string | Yes | — | SQL statement (use %s placeholders for params) |
params | list | No | — | Positional parameters matching %s placeholders |
timeout_seconds | integer | No | — | Connect/statement budget (default 30, max 120) |
max_rows | integer | No | — | Max rows returned (default 1000, max 10000) |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
cloud_connection_uuid | uuid | No | — | — |
sql | string | No | — | — |
params | list | No | — | — |
timeout_seconds | integer | No | — | — |
max_rows | integer | No | — | — |
actor | string | No | — | — |
rows | list | No | — | — |
row_count | integer | No | — | — |
status_message | string | No | — | — |
truncated | boolean | No | — | — |
executed_at | string | No | — | — |
failure_reason | string | No | — | Engine-stamped human-readable failure reason |
failed_at_state | string | No | — | Engine-stamped state when the workflow failed |
failed_step | string | No | — | Engine-stamped step name (DAG path) |
failed_layer | integer | No | — | Engine-stamped layer index (DAG path) |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
failure_type | string | No | — | Engine-stamped failure category (atomic path) |
failed_action | string | No | — | Engine-stamped action method that raised (atomic path) |
failed_at | string | No | — | ISO timestamp when the fail action ran |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | execute | Inputs accepted |
completed | No | Yes | Yes | — | SQL executed |
failed | No | Yes | No | — | SQL execution failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "sql.query.run",
"initial_data": {
"organization_uuid": "value",
"cloud_connection_uuid": "value",
"sql": "value"
}
}