Digital Twin Workflow Engine
Event-driven microservice and low-latency sensor workflow engine for industrial IIoT
01 — Overview
During a focused engineering engagement at i4twins (June–August 2026), I worked as a Senior Backend Engineer on a no-code industrial automation and digital twin platform[cite: 6].
My primary responsibility was architecting and building a dedicated microservice and low-latency workflow engine capable of ingesting continuous sensor telemetry and triggering automated operational rules in real time[cite: 6].
02 — Business Challenge
Industrial digital twin platforms mirror physical assets—machines, production lines, and environmental sensors—in real time. Supporting no-code automation over live telemetry creates intense backend requirements:
- High-Frequency Ingestion: Continuous streams of sensor readings must be ingested and evaluated without blocking upstream edge gateways.
- Sub-Second State Evaluation: Rules often depend on recent historical context (e.g., "alert if temperature exceeds threshold for 3 consecutive readings"), where disk-bound database queries introduce unacceptable latency.
- Dynamic User Workflows: Platform users configure custom trigger-condition-action workflows visually, requiring the engine to execute dynamic rule graphs safely at runtime.
03 — Architecture
To decouple telemetry ingestion from rule evaluation and downstream actions, I implemented an asynchronous event-driven architecture backed by message brokers and Redis[cite: 6].
Core Components
- Event Broker Ingestion: Incoming sensor payloads are published to partitioned message queues, absorbing traffic spikes and guaranteeing at-least-once delivery[cite: 6].
- Stateless Workflow Workers: Horizontally scalable worker instances consume telemetry events, resolve active no-code workflow definitions, and evaluate condition nodes.
- Redis State & Sliding Windows: Digital twin attributes, recent telemetry windows, and deduplication locks are maintained in Redis for sub-millisecond read/write performance[cite: 6].
- Action Dispatchers: Triggered workflow outputs (alerts, webhook calls, or device commands) are emitted asynchronously to downstream services.
04 — Engineering Decisions
- Redis for Hot Twin State: Storing volatile sensor state and rolling time windows in Redis eliminated relational database lock contention during high-frequency telemetry bursts[cite: 6].
- Broker-Backed Decoupling: Separating ingestion from workflow execution ensured that slow external webhook actions could never back-pressure real-time sensor intake[cite: 6].
- Idempotent Event Processing: Designed state transitions to handle duplicate or slightly out-of-order sensor packets gracefully.
05 — Implementation
- Microservice Design: Built the workflow execution service with clean service boundaries, structured health checks, and observability metrics[cite: 6].
- Rule Graph Execution: Implemented an efficient in-memory evaluation pipeline capable of traversing user-defined workflow graphs with minimal allocation overhead.
- Resilience & Failure Isolation: Configured dead-letter queues and retry policies for transient downstream failures.
06 — Results & Evaluation
- Low-Latency Telemetry Automation: Delivered a responsive workflow engine capable of evaluating live sensor streams and dispatching automated actions in real time[cite: 6].
- Horizontal Scalability: Stateless worker design allows throughput to scale linearly by adding consumer instances behind the event broker.
- Clean Platform Integration: Integrated seamlessly with the broader no-code digital twin ecosystem through well-defined event contracts[cite: 6].