TP2A Prototype B

Automation Explorer

n8n is an orchestration layer, not the owner of business state. Events arrive through the controlled event bridge; n8n can only request allowlisted actions through TP2A APIs.

1BUSINESS OWNER

Domain Event

TP2A Business Service

Writes outbox event with business transaction.

Control: Owning service + PostgreSQL transaction.
2NO DIRECT MUTATION

Redis Stream

Outbox Worker

Publishes durable at-least-once event transport.

Control: Stable event_id, retry and DLQ evidence.
3NO DIRECT MUTATION

Event Bridge

TP2A Integration Worker

Consumes stream and forwards an idempotent event envelope to n8n.

Control: Consumer checkpoint before Redis acknowledgement.
4NO DIRECT MUTATION

n8n Orchestrator

Automation Layer

Maps known events to allowlisted automation requests.

Control: service-n8n has automation.request only.
5NO DIRECT MUTATION

Automation API

TP2A Application

Authenticates automation key, identity and event/action mapping.

Control: Fail-closed allowlist and audit.
6NO DIRECT MUTATION

Automation Request

TP2A Workflow

Persists requested work for governed downstream execution.

Control: Unique event_id + action_type prevents duplicate requests.

Scenario A automation path

payment.mismatch_detected
  ↓
Redis Stream
  ↓
Event Bridge + consumer checkpoint
  ↓
n8n webhook
  ↓
START_RECONCILIATION_AGENT request
  ↓
TP2A Automation API
  ↓
Persisted automation request
  ↓
M8 governed AI runtime execution

Guardrails

  • • n8n has no direct PostgreSQL/PostgREST connection.
  • • n8n cannot approve reconciliation, create allocation or close a case.
  • • n8n may request only event/action combinations allowlisted by TP2A.
  • • Automation requests are persisted and auditable before downstream execution.
  • • Redis and n8n execution state are not business systems of record.
  • • Live model execution remains disabled until the controlled AI integration milestone.