data.appdata.document.request-upload
Register a pending end-user document and return server-chosen storage upload coordinates (shared storage plane; an app served from its own instance reads and writes through the Data API instead)
Register a pending document and return server-chosen upload coordinates.
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 |
storage_connection_uuid | uuid | Yes | — | Target storage connection UUID |
bucket | string | Yes | — | Target storage bucket |
ref_table_slug | string | No | — | Optional appdata record table slug |
ref_record_uuid | uuid | No | — | Optional appdata record UUID |
kind | string | Yes | — | Document kind (e.g. attachment, certificate) |
content_type | string | No | — | Declared MIME content type |
visibility_scope | string | No | — | Visibility scope: 'owner' or 'app' |
expires_s | integer | No | — | Requested presign TTL in seconds |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
document_uuid | uuid | Yes | — | Document UUID |
storage_connection_uuid | uuid | Yes | — | Storage connection UUID |
bucket | string | Yes | — | Server-chosen bucket |
key | string | Yes | — | Server-chosen object key |
content_type | string | No | — | Declared MIME content type |
visibility_scope | string | Yes | — | Applied visibility scope |
expires_s | integer | No | — | Requested presign TTL in seconds |
status | string | Yes | — | Document status ('pending') |
written_at | string | Yes | — | ISO-8601 write timestamp |
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 | Request upload |
completed | No | Yes | Yes | — | Registered |
failed | No | Yes | No | — | Request upload failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
Outcomes
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
written | SUCCESS | Register a pending end-user document and return server-chosen storage upload coordinates (shared storage plane; an app served from its own instance reads and writes through the Data API instead) | document_uuid |
failed | FAILURE | Appdata workflow failed | failure_reason |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.appdata.document.request-upload",
"initial_data": {
"organization_uuid": "value",
"storage_connection_uuid": "value",
"bucket": "value",
"kind": "value"
}
}