Docs/Architecture/Data Flow

Architecture

Data Flow

How a request moves from ERP event through the webhook, into the workflow engine, and back to the dashboard.

The happy path — purchase order approval

Here is an example of how an ERP-shaped supply chain event flows through EasyFlow end to end. The example uses a purchase order raised in SAP, but the same path applies to any supported source that sends a normalized event.

Step 1 — Inbound event

1
SAP creates a purchase order

An operator raises a PO in SAP. SAP triggers an outbound webhook, or n8n's scheduled workflow detects the new PO in the next polling cycle (every 5 minutes).

2
n8n normalises the payload

The n8n workflow maps SAP's field names (PurchaseOrder, OrderQuantity, Supplier) to EasyFlow's standard format and POSTs to /api/webhooks/inbound/{tenant_id}.

3
EasyFlow verifies and accepts

The webhook endpoint validates the X-Webhook-Token header, normalises any remaining SAP field aliases, and publishes a purchase_order_created event to RabbitMQ. Returns 202 Accepted immediately.

Step 2 — Workflow execution

1
Worker consumes the event

The RabbitMQ worker picks up the purchase_order_created message and loads the tenant's active workflow definition for this event type.

2
Engine validates the graph

The workflow engine validates the definition — checking for cycles, missing assignments, and unreachable nodes.

3
Engine executes step one

The first step (Request) is marked complete. The engine identifies the next step (Approval) and its assignee based on the workflow definition and the PO's value.

4
Notification published

The worker publishes a notification event. The notification service sends an email or Slack message to the approver with a direct link to the approval screen.

Step 3 — Dashboard update

1
Approver opens EasyFlow

The manager sees the pending approval in their Operations dashboard. They see the PO details, the supplier, the quantity, and the deadline.

2
Approver clicks Approve

The approval action is posted to the API. The engine marks this step complete and moves to the next node in the workflow graph.

3
Workflow completes

If all steps complete, the workflow is marked done. The procurement officer sees the approved status. The worker can optionally hand the completion back to an external system through a connector or follow-up automation.

4
Metrics updated

Prometheus counters increment for workflow completions. The dashboard shows updated counts, average approval times, and pending queues.

ℹThe exact timing depends on your source system, queue load, polling interval, and notification setup. The important point is that EasyFlow is designed for near-real-time operational routing rather than manual status chasing.