appdata.query.save ​
Save a named SQL statement for an app, private or shared with the organization
Save a named statement so it survives the browser it was written in.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-appdata |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
identity_app_uuid | uuid | Yes | — | — |
actor_user_uuid | uuid | No | — | Platform user this query belongs to; authorship and private visibility key off it |
name | string | Yes | — | — |
sql_text | string | Yes | — | — |
description | string | No | — | — |
parameters | list | No | — | — |
tags | list | No | — | — |
folder_uuid | uuid | No | — | — |
folder_name | string | No | — | Folder to file this under; created if it does not exist |
visibility | string | No | — | private |
pinned | boolean | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
identity_app_uuid | uuid | Yes | — | — |
saved_query_uuid | uuid | No | — | — |
name | string | No | — | — |
description | string | No | — | — |
sql_text | string | No | — | — |
parameters | list | No | — | — |
tags | list | No | — | — |
folder_uuid | uuid | No | — | — |
folder_name | string | No | — | — |
visibility | string | No | — | — |
pinned | boolean | No | — | — |
version | integer | No | — | — |
created_by_user_uuid | uuid | No | — | — |
updated_by_user_uuid | uuid | No | — | — |
last_run_at | string | No | — | — |
created_at | string | No | — | — |
updated_at | string | No | — | — |
failure_reason | string | No | — | Engine-stamped failure reason |
failed_at_state | string | No | — | State when the workflow failed |
failed_step | string | No | — | Failed DAG step name |
failed_layer | integer | No | — | Failed DAG layer index |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | complete | Save requested |
completed | No | Yes | Yes | — | Save done |
failed | No | Yes | No | — | Save failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
saved | SUCCESS | Save a named SQL statement for an app, private or shared with the organization | saved_query_uuid, name |
failed | FAILURE | Appdata workflow failed | failure_reason |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "appdata.query.save",
"initial_data": {
"organization_uuid": "value",
"identity_app_uuid": "value",
"name": "value",
"sql_text": "value"
}
}