sap.ingest-page ​
Persist one externally-pushed page of normalized SAP records into commerce_entity
Persist one externally-pushed page of normalized SAP records.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-sap |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Authenticated organization UUID injected by the workflow boundary |
connection_uuid | uuid | Yes | — | Organization-scoped SAP CloudConnection UUID |
workflow_run_id | string | No | — | Engine-stamped parent DAG run id |
entity_type | string | Yes | — | Which SAP entity this page carries: invoice, journal_entry, party, payable, receivable, supplier_invoice |
items | list | Yes | — | Normalized SAP rows, each carrying the identity field for its entity_type. At most 500 per page. |
source_ref | string | No | — | Free-form provenance for the pusher, e.g. a CPI iFlow name. Recorded on the run for audit; never interpreted. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Authenticated organization UUID injected by the workflow boundary |
connection_uuid | uuid | Yes | — | Organization-scoped SAP CloudConnection UUID |
workflow_run_id | string | No | — | Engine-stamped parent DAG run id |
entity_type | string | Yes | — | Which SAP entity this page carries: invoice, journal_entry, party, payable, receivable, supplier_invoice |
items | list | Yes | — | Normalized SAP rows, each carrying the identity field for its entity_type. At most 500 per page. |
source_ref | string | No | — | Free-form provenance for the pusher, e.g. a CPI iFlow name. Recorded on the run for audit; never interpreted. |
sap_environment | string | No | — | Which SAP data set the records came from: 'sandbox' (Business Accelerator Hub canned data) or 'live'. Sourced from the connection, never from caller input. Persisted evidence must be partitioned by this value. |
item_count | integer | Yes | — | Rows received on this page |
persisted_count | integer | Yes | — | Rows durably written |
created_count | integer | Yes | — | Rows that did not exist before |
updated_count | integer | Yes | — | Rows that already existed and were refreshed |
restored_count | integer | Yes | — | Soft-deleted rows brought back |
rejected_count | integer | Yes | — | Rows the persistence layer refused |
ingested_at | string | Yes | — | UTC ISO-8601 completion stamp |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | integer | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
provider_request_ref | string | No | — | — |
retryable | boolean | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | execute | — |
executing | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | execute | executing | — |
executing | complete | completed | — |
* (any state) | fail | failed | — |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
ingested | SUCCESS | The pushed page was persisted into commerce_entity | item_count, persisted_count, rejected_count, sap_environment |
failed | FAILURE | The ingest failed | failure_reason, failure_type, retryable |
Business Errors ​
| Code | Message Template |
|---|---|
SAP_ORGANIZATION_CONTEXT_INVALID | Authenticated organization context is missing or does not match the workflow input |
SAP_CONNECTION_NOT_FOUND | SAP connection {connection_uuid} was not found in the authenticated organization |
SAP_CONNECTION_WRONG_PROVIDER | Connection {connection_uuid} is not a SAP connection |
SAP_CONNECTION_SERVICE_UNAVAILABLE | The shared cloud connection service is unavailable |
SAP_ENVIRONMENT_INVALID | The connection's SAP environment must be exactly 'sandbox' or 'live' |
SAP_INGEST_ENTITY_TYPE_INVALID | entity_type must be one of the SAP entity types this library persists |
SAP_INGEST_PAYLOAD_INVALID | items must be a non-empty list of objects within the page bound |
SAP_INGEST_ITEM_REF_MISSING | every pushed item must carry a non-empty identity field for its entity_type |
SAP_SYNC_PERSIST_FAILED | SAP sync persist-batch failed: |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "sap.ingest-page",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value",
"entity_type": "value",
"items": "value"
}
}