data.commerce.entity.persist-batch ​
Transactionally upsert one bounded page of provider-neutral commerce entities
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-commerce |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
cloud_connection_uuid | uuid | Yes | — | — |
provider | string | Yes | — | — |
entity_type | string | Yes | — | — |
items | json | Yes | — | List of item objects containing external_ref, raw, and optional name, status, provider_updated_at. With external_ref_field set, a provider's normalized rows are accepted as they come instead. |
external_ref_field | string | No | — | Dotted path to the field already holding each item's identity, e.g. 'sale_ref'. Set it to persist a provider's normalized rows directly -- the item itself becomes raw. Exists because a saved composition cannot reshape a record: control.collection.map does unary transforms, not projection, so without this no sync composition could feed this workflow at all. |
last_synced_by_workflow_uuid | string | No | — | — |
max_items | integer | No | 500 | — |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
persisted_count | integer | Yes | — | — |
created_count | integer | Yes | — | — |
updated_count | integer | Yes | — | — |
restored_count | integer | Yes | — | — |
rejected_count | integer | Yes | — | — |
results | list | Yes | — | — |
rejected_items | list | 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 | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
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.entity.persist-batch",
"initial_data": {
"organization_uuid": "value",
"cloud_connection_uuid": "value",
"provider": "value",
"entity_type": "value"
}
}