Skip to main content
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
[![Durable Workflow Engine (event history, retries with backoff, idempotent activities) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_workflow-engine-design/opengraph-image)](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_10

COMPONENT STACK (12)

  • Client applicationSTATEFUL
    Starts workflows from an untrusted network
  • Idempotent sinkSTATELESS
    Third-party API assumed to honour the key
  • API gatewaySTATELESS
    Checks the JWT, then starts the workflow
  • Policy decision point (PDP)STATELESS
    Allows or denies by scope; on error, fail closed
  • Workflow engineSTATEFUL
    Runs workflow steps; state rebuilt from history
  • Workflow history (PostgreSQL)STATEFUL
    Append-only event log per workflow
  • AlertingSTATEFUL
    Pages on-call when metrics go silent or spike
  • Message queueSTATEFUL
    Activity tasks; bounded depth
  • Competing consumersSTATELESS
    Activity workers run tasks concurrently
  • Dead-letter queue (DLQ)STATEFUL
    Holds tasks that ran out of retries
  • Secrets managerSTATEFUL
    Holds the external API keys
  • Time-series database (TSDB)STATEFUL
    Stores task, retry and heartbeat series

REQUEST & DATA FLOW (16)

  1. Client application → API gateway (Starts with a JWT)[HTTPS]
  2. API gateway → Policy decision point (PDP) (Asks (mTLS))[HTTP]
  3. Policy decision point (PDP) → API gateway (Decides)[HTTP]
  4. API gateway → Workflow engine (Starts with key (mTLS))[HTTP]
  5. Workflow engine → Workflow history (PostgreSQL) (Appends)[TCP]
  6. Workflow history (PostgreSQL) → Workflow engine (Confirms)[TCP]
  7. Workflow engine → Message queue (Schedules)[TCP]
  8. Message queue → Competing consumers (Delivers task)[TCP]
  9. Competing consumers → Idempotent sink (Calls with key)[HTTPS]
  10. Idempotent sink → Competing consumers (Returns)[HTTPS]
  11. Competing consumers → Workflow engine (Reports (mTLS))[HTTP]
  12. Workflow engine → Dead-letter queue (DLQ) (Parks failed task)[TCP]
  13. Workflow engine → Time-series database (TSDB) (Exports (OTLP))[OTLP]
  14. Competing consumers → Time-series database (TSDB) (Exports (OTLP))[OTLP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →