ifood.events.ingest ​
Normalize and deduplicate an inbound iFood order-event batch delivered through a hook redirect
Normalize one inbound batch of iFood order events from the hook.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-ifood |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Authenticated organization that owns the hook redirect |
source | string | No | — | Hook-configured source label, e.g. 'ifood' |
event_type | string | No | — | Hook-configured or header-derived event type |
action | string | No | — | — |
delivery_ref | string | No | — | Provider or hook delivery reference used for tracing |
payload | json | No | — | Parsed request body: an event list, a single event, or an envelope |
headers | json | No | — | Inbound request headers forwarded by the hook. Consumed for shape only and never echoed on output, since they may carry authorization material. |
metadata | json | No | — | — |
redirect_uuid | string | No | — | — |
event_uuid | string | No | — | — |
workflow_run_id | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Authenticated organization that owns the hook redirect |
source | string | No | — | Hook-configured source label, e.g. 'ifood' |
event_type | string | No | — | Hook-configured or header-derived event type |
action | string | No | — | — |
delivery_ref | string | No | — | Provider or hook delivery reference used for tracing |
payload | json | No | — | Parsed request body: an event list, a single event, or an envelope |
metadata | json | No | — | — |
redirect_uuid | string | No | — | — |
event_uuid | string | No | — | — |
workflow_run_id | string | No | — | — |
events | list | Yes | — | Normalized, deduplicated iFood order events |
record_count | integer | Yes | — | — |
duplicate_count | integer | Yes | — | Events dropped because their event_ref repeated in this batch |
unknown_count | integer | Yes | — | Events whose code is not a known order-status transition |
order_refs | list | Yes | — | Distinct order references touched by this batch |
confirmable_order_refs | list | Yes | — | Orders still awaiting confirmation within the SLA. Matches the batch-aware rule used by ifood.events.poll. |
settling_order_refs | list | Yes | — | Orders whose transition means Sales / Financial Events records should now be expected |
accepted | boolean | Yes | — | False when the envelope carried no recognizable iFood event |
rejection_reason | string | No | — | Why the envelope was not accepted; absent when accepted |
envelope_metadata | json | No | — | — |
ingested_at | string | Yes | — | — |
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 | Inbound event batch was normalized | events, record_count, settling_order_refs |
failed | FAILURE | Event ingest failed | failure_reason, failure_type, retryable |
Business Errors ​
| Code | Message Template |
|---|---|
IFOOD_ORGANIZATION_CONTEXT_INVALID | Authenticated organization context is missing or does not match the workflow input |
IFOOD_CONNECTION_NOT_FOUND | iFood connection {connection_uuid} was not found in the authenticated organization |
IFOOD_CONNECTION_WRONG_PROVIDER | Connection {connection_uuid} is not an iFood connection |
IFOOD_CONNECTION_SERVICE_UNAVAILABLE | The shared cloud connection service is unavailable |
IFOOD_PROVIDER_CAPABILITY_MISSING | The installed iFood provider does not expose the required API operation |
IFOOD_AUTHENTICATION_FAILED | iFood rejected the connection credentials or bearer token |
IFOOD_PROVIDER_REQUEST_FAILED | The iFood API request failed |
IFOOD_RESPONSE_SHAPE_INVALID | The iFood Merchant API returned an invalid merchant record |
IFOOD_PAGINATION_INVALID | Merchant page must be at least 1 and limit must be between 1 and 100 |
IFOOD_SALES_WINDOW_INVALID | Sales dates must use YYYY-MM-DD, be ordered, and span no more than 8 inclusive days |
IFOOD_SALES_PAGINATION_INVALID | Sales page must be a zero-based integer |
IFOOD_SALES_RESPONSE_SHAPE_INVALID | The iFood Financial Sales API returned an invalid response |
IFOOD_FINANCIAL_EVENTS_WINDOW_INVALID | Financial Events dates must use YYYY-MM-DD, be ordered, and span no more than 33 inclusive days |
IFOOD_SETTLEMENTS_WINDOW_INVALID | Settlements dates must use YYYY-MM-DD, be ordered, and span no more than 90 inclusive days |
IFOOD_FINANCIAL_PAGINATION_INVALID | Financial page must be one-based and page_size must be between 100 and 300 |
IFOOD_FINANCIAL_EVENTS_RESPONSE_SHAPE_INVALID | The iFood Financial Events API returned an invalid response |
IFOOD_SETTLEMENTS_RESPONSE_SHAPE_INVALID | The iFood Settlements API returned an invalid response |
IFOOD_DATA_ENVIRONMENT_INVALID | data_environment must be exactly 'production' or 'homologation' |
IFOOD_DATA_ENVIRONMENT_UNSUPPORTED | The installed iFood provider does not support data_environment; upgrade ltinteg-cloud-connections to request homologation records |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "ifood.events.ingest",
"initial_data": {
"organization_uuid": "value"
}
}