> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaantonio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How it works

> The shared path from CargoWise through Lambda automations and back.

Every Lambda automation follows the same spine. Modules differ in what they do with a capture; the handoff with CargoWise stays the same.

## The flow

```text theme={null}
CargoWise outbound (eAdaptor Next XML)
        │
        ▼
Lambda ingress — accept, capture, enqueue
        │
        ▼
Durable automation — entitled module path
        │
        ├── pause with a workspace note when blocked
        │
        └── complete module work
                │
                ▼
        Lambda outbound (when configured) → CargoWise inbound
```

1. **CargoWise outbound** pushes XML through eAdaptor Next.
2. **Lambda ingress** accepts the request, stores the capture, and queues work. CargoWise treats acceptance as delivered.
3. Durable automation runs the path for the entitled module — for example fiscal checks and Facturapi stamping, or projection into Analytics reporting.
4. When the module produces artifacts for CargoWise and outbound is configured, **Lambda outbound** delivers them to **CargoWise inbound**.
5. The workspace shows status, notes, and the next safe action when something needs attention.

## Who owns what

| Owner         | Owns                                                                                            |
| ------------- | ----------------------------------------------------------------------------------------------- |
| **CargoWise** | Source data: accounting fields, shipment XML, and what gets pushed outbound                     |
| **Lambda**    | Ingress capture, durable automations, reconciliation gates, workspace status, outbound delivery |
| **Facturapi** | SAT/CFDI validation and stamp submission (Stamping module)                                      |
| **Reporting** | Org-scoped Postgres `reporting` schema your login queries (Analytics module)                    |

If a dependency already owns a rule, Lambda surfaces the result instead of inventing a second version of it.

## Acceptance is not completion

When Lambda ingress accepts a message, CargoWise stops retrying that push. Module work may still be in progress. Check the workspace for the document or feed status — do not push the same work again from CargoWise.

## Module paths

Stamping and Analytics share this spine. Each has its own ordinary flow after ingress.

<CardGroup cols={2}>
  <Card title="How stamping works" icon="stamp" href="/stamping/how-it-works">
    Accounting XML to CFDI and back to CargoWise.
  </Card>

  <Card title="How Analytics works" icon="chart-simple" href="/analytics/how-it-works">
    Shipment XML into reporting Postgres.
  </Card>
</CardGroup>
