ARCHOS 525 BLUEPRINT · /d/dgm_workflow-engine-design
Durable Workflow Engine (event history, retries with backoff, idempotent activities)
13 COMPONENTS · 16 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_workflow-engine-design) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_workflow-engine-design)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_workflow-engine-design" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Durable Workflow Engine (event history, retries with backoff, idempotent activities) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("Client application")]
ext_1["Idempotent sink"]
gw_2["API gateway"]
pdp_3["Policy decision point (PDP)"]
engine_4[("Workflow engine")]
history_5[("Workflow history (PostgreSQL)")]
alerting_6[("Alerting")]
queue_7[("Message queue")]
workers_8["Competing consumers"]
dlq_9[("Dead-letter queue (DLQ)")]
secrets_10[("Secrets manager")]
tsdb_11[("Time-series database (TSDB)")]
capacity_12["Capacity Estimate"]
client_0 -->|"1. Starts with a JWT · HTTPS"| gw_2
gw_2 -->|"2. Asks (mTLS) · HTTP"| pdp_3
pdp_3 -->|"3. Decides · HTTP"| gw_2
gw_2 -->|"4. Starts with key (mTLS) · HTTP"| engine_4
engine_4 -->|"5. Appends · TCP"| history_5
history_5 -->|"6. Confirms · TCP"| engine_4
engine_4 -.->|"7. Schedules · TCP"| queue_7
queue_7 -.->|"8. Delivers task · TCP"| workers_8
workers_8 -->|"9. Calls with key · HTTPS"| ext_1
ext_1 -->|"10. Returns · HTTPS"| workers_8
workers_8 -->|"11. Reports (mTLS) · HTTP"| engine_4
engine_4 -->|"Parks failed task · TCP"| dlq_9
engine_4 -->|"Exports (OTLP) · OTLP"| tsdb_11
workers_8 -->|"Exports (OTLP) · OTLP"| tsdb_11
tsdb_11 -->|"Supplies metrics · HTTP"| alerting_6
workers_8 -->|"Fetches key (mTLS) · HTTPS"| secrets_10COMPONENT STACK (12)
- Client applicationSTATEFULStarts workflows from an untrusted network
- Idempotent sinkSTATELESSThird-party API assumed to honour the key
- API gatewaySTATELESSChecks the JWT, then starts the workflow
- Policy decision point (PDP)STATELESSAllows or denies by scope; on error, fail closed
- Workflow engineSTATEFULRuns workflow steps; state rebuilt from history
- Workflow history (PostgreSQL)STATEFULAppend-only event log per workflow
- AlertingSTATEFULPages on-call when metrics go silent or spike
- Message queueSTATEFULActivity tasks; bounded depth
- Competing consumersSTATELESSActivity workers run tasks concurrently
- Dead-letter queue (DLQ)STATEFULHolds tasks that ran out of retries
- Secrets managerSTATEFULHolds the external API keys
- Time-series database (TSDB)STATEFULStores task, retry and heartbeat series
REQUEST & DATA FLOW (16)
- Client application → API gateway (Starts with a JWT)[HTTPS]
- API gateway → Policy decision point (PDP) (Asks (mTLS))[HTTP]
- Policy decision point (PDP) → API gateway (Decides)[HTTP]
- API gateway → Workflow engine (Starts with key (mTLS))[HTTP]
- Workflow engine → Workflow history (PostgreSQL) (Appends)[TCP]
- Workflow history (PostgreSQL) → Workflow engine (Confirms)[TCP]
- Workflow engine → Message queue (Schedules)[TCP]
- Message queue → Competing consumers (Delivers task)[TCP]
- Competing consumers → Idempotent sink (Calls with key)[HTTPS]
- Idempotent sink → Competing consumers (Returns)[HTTPS]
- Competing consumers → Workflow engine (Reports (mTLS))[HTTP]
- Workflow engine → Dead-letter queue (DLQ) (Parks failed task)[TCP]
- Workflow engine → Time-series database (TSDB) (Exports (OTLP))[OTLP]
- Competing consumers → Time-series database (TSDB) (Exports (OTLP))[OTLP]