bling.sync-stock-balances
Iterates every page of Bling /estoques/saldos and persists each row into commerce_entity. No incremental cursor on Bling's side — full scan every run; rely on diffs at the persist layer.
Overview
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-bling |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
warehouse_external_ref | string | No | — | — |
limite | integer | No | — | — |
actor | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
warehouse_external_ref | string | No | — | — |
limite | integer | No | — | — |
actor | string | No | — | — |
current_page | integer | No | — | — |
synced_count | integer | No | — | — |
persisted_count | integer | No | — | — |
created_count | integer | No | — | — |
updated_count | integer | No | — | — |
last_page_items | json | No | — | — |
has_next_page | boolean | No | — | — |
started_at | string | No | — | — |
completed_at | string | No | — | — |
failure_reason | string | No | — | — |
failed_at | 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 | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | start | Sync requested |
fetching | No | No | — | — | Fetching one page |
planning | No | No | — | fetch_page | Kick first page fetch |
completed | No | Yes | Yes | — | All pages synced |
failed | No | Yes | No | — | Sync failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
initiated | start | planning | — |
planning | fetch_page | fetching | — |
fetching | fetch_page | fetching | — |
fetching | complete | completed | — |
initiated | fail | failed | — |
planning | fail | failed | — |
fetching | fail | failed | — |
Business Errors
| Code | Message Template |
|---|---|
BLING_PAGE_FETCH_FAILED | bling.fetch-stock-balance failed on page {page}: |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.sync-stock-balances",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value"
}
}