data.commerce.bank-line.persist-batch ​
Transactionally upsert one bounded page of bank statement lines
Idempotently upsert one bounded page of bank statement lines.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-commerce |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
provider | string | Yes | — | Source that produced the lines, e.g. 'ofx', 'csv', or a bank slug. |
account_ref | string | Yes | — | Opaque pseudonym for the account. NEVER a branch/account number: banking coordinates are customer data and are rejected. |
data_environment | string | No | production | 'production' (default) or 'homologation'. Part of the row identity, so a sanitized statement never overwrites a real one. |
cloud_connection_uuid | uuid | No | — | Absent for a file import, which has no connection behind it. |
statement_artifact_uuid | uuid | No | — | The commerce_artifact this batch was extracted from, for provenance. |
items | json | Yes | — | Normalized lines: external_ref, posted_at, amount, and optional value_date, currency, balance_after, description, counterparty_ref, metadata. |
imported_by_workflow_uuid | string | No | — | — |
max_items | integer | No | 500 | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
provider | string | Yes | — | — |
account_ref | string | Yes | — | — |
data_environment | string | Yes | — | — |
persisted_count | integer | Yes | — | — |
created_count | integer | Yes | — | — |
updated_count | integer | Yes | — | — |
rejected_count | integer | Yes | — | — |
results | list | Yes | — | — |
rejected_items | list | Yes | — | — |
net_amount | string | 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.bank-line.persist-batch",
"initial_data": {
"organization_uuid": "value",
"provider": "value",
"account_ref": "value",
"items": "value"
}
}