Skip to content
Proud to collaborate with Microsoft for Startups

sap.sync-journal-entries ​

Page a bounded PostingDate window of SAP journal entries via sap.fetch-journal-entries — through an async, engine-scheduled polling loop — and persist each page into commerce_entity (entity_type=journal_entry).

Page a bounded PostingDate window of SAP journal entries via sap.fetch-journal-entries — through an async, engine-scheduled polling loop — and persist each page into commerce_entity (entity_type=journal_entry).

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-sap
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—Authenticated organization UUID injected by the workflow boundary
connection_uuiduuidYes—Organization-scoped SAP CloudConnection UUID
start_datestringYes—Inclusive PostingDate window start, YYYY-MM-DD, forwarded to every page of sap.fetch-journal-entries
end_datestringYes—Inclusive PostingDate window end, YYYY-MM-DD; must not precede start_date
workflow_run_idstringNo—Engine-stamped parent DAG run id
skipintegerNo—Starting OData $skip offset within the window; non-negative, defaults to 0
topintegerNo—OData $top page size passed to sap.fetch-journal-entries per page; 1..1000, defaults to 100
max_pagesintegerNo—Safety cap on pages fetched this run; defaults to 20
actorstringNo—Optional actor stamp forwarded to commerce persist/cursor workflows

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—Authenticated organization UUID injected by the workflow boundary
connection_uuiduuidYes—Organization-scoped SAP CloudConnection UUID
start_datestringYes—Inclusive PostingDate window start, YYYY-MM-DD
end_datestringYes—Inclusive PostingDate window end, YYYY-MM-DD
workflow_run_idstringNo—Engine-stamped parent DAG run id
skipintegerNo—Starting OData $skip offset requested for this run
topintegerNo—Effective page size used
max_pagesintegerNo—Page cap echoed as applied
actorstringNo—Actor stamp echoed
current_skipintegerNo—Current OData $skip offset for the page about to run / just run
pages_fetchedintegerNo—Number of list pages successfully fetched
synced_countintegerNo—Total normalized journal entries seen across pages
persisted_countintegerNo—Rows accepted by data.commerce.entity.persist-batch
created_countintegerNo—New commerce_entity rows created
updated_countintegerNo—Existing commerce_entity rows updated
rejected_countintegerNo—Items rejected by persist-batch
has_next_pagebooleanNo—Whether another page remains (record_count == top on last fetch, and pages_fetched < max_pages)
sap_environmentstringNo—Environment stamped from the connection via the fetch atom
started_atstringNo—ISO-8601 UTC when sync started
completed_atstringNo—ISO-8601 UTC when sync completed
failure_reasonstringNo—Safe terminal failure reason
failure_typestringNo—Stable failure classification
failed_actionstringNo—Action that failed
failed_stepjsonNo—Failed DAG step envelope
failed_layerintegerNo—One-based failed DAG layer
failed_at_statestringNo—State where failure occurred
errorstringNo—Safe unexpected error
error_typestringNo—Unexpected exception class
failed_atstringNo—ISO-8601 failure timestamp
provider_request_refstringNo—Safe provider request reference
retryablebooleanNo—Whether the failure is retryable

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—start—
fetchingNoNo———
finalizingNoNo—complete—
planningNoNo—begin_fetch—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedstartplanning—
planningbegin_fetchfetching—
fetchingfetch_pagefetching—
fetchingfinish_fetchingfinalizing—
finalizingcompletecompleted—
* (any state)failfailed—

Business Errors ​

CodeMessage Template
SAP_ORGANIZATION_CONTEXT_INVALIDAuthenticated organization context is missing or does not match the workflow input
SAP_CONNECTION_NOT_FOUNDSAP connection {connection_uuid} was not found in the authenticated organization
SAP_CONNECTION_WRONG_PROVIDERConnection {connection_uuid} is not a SAP connection
SAP_CONNECTION_SERVICE_UNAVAILABLEThe shared cloud connection service is unavailable
SAP_PROVIDER_CAPABILITY_MISSINGThe installed SAP provider does not expose the required API operation
SAP_AUTHENTICATION_FAILEDSAP rejected the connection credentials or API key
SAP_PROVIDER_REQUEST_FAILEDThe SAP OData request failed
SAP_RESPONSE_SHAPE_INVALIDThe SAP OData API returned an invalid response
SAP_PAGINATION_INVALIDskip must be a non-negative integer and top must be between 1 and 1000
SAP_WINDOW_INVALIDDates must use YYYY-MM-DD and be ordered
SAP_SIDE_INVALIDside must be exactly 'receivable' or 'payable'
SAP_ENVIRONMENT_INVALIDThe connection's SAP environment must be exactly 'sandbox' or 'live'
SAP_SYNC_PAGE_FETCH_FAILEDSAP sync child fetch failed:
SAP_SYNC_PERSIST_FAILEDSAP sync persist-batch failed:

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "sap.sync-journal-entries",
  "initial_data": {
    "organization_uuid": "value",
    "connection_uuid": "value",
    "start_date": "value",
    "end_date": "value"
  }
}