data.commerce.sync-cursor.upsert ​
Idempotent upsert of a (connection, provider, entity_type) cursor row. Replaces last_synced_at; increments items_synced_total when the input carries it.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-commerce |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cloud_connection_uuid | uuid | Yes | — | — |
provider | string | Yes | — | — |
entity_type | string | Yes | — | — |
last_synced_at | string | No | — | ISO-8601. Becomes the since cursor for next run. |
items_synced_total | integer | No | — | Running total — incremented (not replaced) when provided |
last_sync_workflow_uuid | string | No | — | — |
last_error | string | No | — | On failed sync runs; cleared on success |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cloud_connection_uuid | uuid | Yes | — | — |
provider | string | Yes | — | — |
entity_type | string | Yes | — | — |
last_synced_at | string | No | — | ISO-8601. Becomes the since cursor for next run. |
items_synced_total | integer | No | — | Running total — incremented (not replaced) when provided |
last_sync_workflow_uuid | string | No | — | — |
last_error | string | No | — | On failed sync runs; cleared on success |
actor | string | No | — | — |
sync_cursor_uuid | uuid | Yes | — | — |
created | boolean | Yes | — | — |
persisted_at | string | Yes | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | complete | Upsert cursor |
completed | No | Yes | Yes | — | Cursor written |
failed | No | Yes | No | — | Cursor upsert failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.commerce.sync-cursor.upsert",
"initial_data": {
"cloud_connection_uuid": "value",
"provider": "value",
"entity_type": "value"
}
}