data.appdata.transaction.apply
Apply an ordered batch of appdata record operations atomically in one session and one commit (routes to the app's storage plane: the shared appdata store, or the app's own Postgres instance when it has one)
Apply an ordered batch of appdata record operations in one session/one commit.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-appdata |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Authenticated organization UUID |
identity_app_uuid | uuid | No | — | (server-resolved principal from the end-user token; input ignored unless it agrees) |
end_user_uuid | uuid | No | — | (server-resolved principal from the end-user token; input ignored unless it agrees) |
request_id | string | No | — | Caller request id for audit correlation |
actor | string | No | — | Workflow caller or agent identifier |
operations | list | Yes | — | Ordered list of record operations applied atomically. Each item is an object {op: 'create' |
idempotency_key | string | No | — | Optional batch-level idempotency key; a replay with the same key returns the prior result |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID echoed from input |
identity_app_uuid | uuid | Yes | — | Identity app UUID echoed from input |
applied | boolean | Yes | — | True when the whole batch committed |
count | integer | Yes | — | Number of operations applied in the batch |
results | list | Yes | — | Per-operation result summaries in input order |
replayed | boolean | Yes | — | True when returned from an idempotent replay |
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 | Apply record batch |
completed | No | Yes | Yes | — | Applied |
failed | No | Yes | No | — | Batch failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
Outcomes
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
applied | SUCCESS | Apply an ordered batch of appdata record operations atomically in one session and one commit (routes to the app's storage plane: the shared appdata store, or the app's own Postgres instance when it has one) | count |
failed | FAILURE | Appdata workflow failed | failure_reason |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.appdata.transaction.apply",
"initial_data": {
"organization_uuid": "value",
"operations": "value"
}
}