Workflow Repair — synthetic reliability sample

This is a local work sample, not client work. It uses n8n 2.42.6 and a mock
HTTP API. No LLM, voice provider, CRM, payment provider or paid API is called.

Verified behaviors:
- Without an idempotency key, sending an event twice creates two mock orders.
- With a stable key, the API returns the existing mock order on replay.
- Without retry, a synthetic HTTP 503 fails the workflow.
- With bounded retry, the next attempt succeeds and creates one mock order.
- Invalid amounts and reuse of a key for a different payload are rejected.

Reproduce on Linux (Docker and Python 3 required):
1. Extract the bundle into an empty working directory.
2. In that directory, run: mkdir -p private/n8n-data public
3. Run: python3 demo/make_workflows.py
4. In a separate terminal run: python3 demo/mock_api.py
5. Import (replace /ABSOLUTE/ROOT with this directory):
   docker run --rm --network host \
     -e N8N_DIAGNOSTICS_ENABLED=false \
     -e N8N_VERSION_NOTIFICATIONS_ENABLED=false \
     -v /ABSOLUTE/ROOT/demo:/demo:ro \
     -v /ABSOLUTE/ROOT/private/n8n-data:/home/node/.n8n \
     docker.n8n.io/n8nio/n8n:2.42.6 \
     import:workflow --input=/demo/workflows.json
6. Run: python3 demo/replay.py
7. Inspect public/proof.json. Raw execution logs stay in private/.

The n8n container uses uid 1000. If your user ID differs, arrange suitable
ownership on the empty private/n8n-data directory before importing.
The downloaded image uses around 1.8 GB on disk. The API listens only on
127.0.0.1:5691. Docker host networking is used for this isolated Linux demo.
Stop the mock API with Ctrl+C when finished. No permanent n8n service is added.

Limitations:
The fixture keeps its state in memory. It is not a production service.
Duplicate protection requires a downstream API with idempotency support.
The sample retries all request errors at most three times. A real deployment
must distinguish retryable failures and handle Retry-After and rate limits.
Production behavior, authorization, retention, and real side effects require
separate acceptance tests on the specific integration.

Code license: MIT. Copyright 2026 Workflow Repair.
Permission is granted, free of charge, to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of this sample, subject to retaining
this notice. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND.
The n8n software is separately licensed by its authors; this license covers
only the original sample files supplied here.
