Siglo. Workflows can export their topological structure as diagrams, emit telemetry spans to OpenTelemetry collectors, record granular execution traces, and stream real-time events to an interactive React DevTools dashboard.
1. Graph Inspection & Visualization
Every workflow can export its AST directly:Visual Badges in Diagrams
toMermaid() and toDot() automatically embed badges for execution policies:
- ⏱️
timeoutMs: Execution deadline - 🔁
retry(N): Retry count policy - ⏪
saga: Compensation rollback registered - 💾
cache: Step output caching enabled - ⏳
wait: Durable suspension or timer sleep
2. OpenTelemetry Distributed Tracing
Install@siglo/opentelemetry:
3. W3C Trace Context Propagation
Propagate trace headers (traceparent, tracestate) across distributed boundaries (HTTP, Kafka, SQS):
4. Real-Time Live Monitoring & DevTools
In addition to OpenTelemetry distributed tracing, Siglo provides a real-time monitoring engine with a built-in React 18 + Vite + Tailwind CSS web dashboard, SSE/WebSocket streaming, and Prometheus metrics via@siglo/monitor:
- React DevTools Dashboard: Interactive DAG graph topology visualizer, step latency waterfalls, context mutation diff inspector, and live event log at
http://localhost:4000. - Flexible Attachment: Connect workflows to a local or remote monitor server via
attachToMonitorServer(urlOrPort), or usecreateMonitorClientfor buffered high-throughput worker fleets. - Interactive Resumption & Replay: Unblock suspended workflows (
waitForEvent) directly from the browser UI or trigger instant replays. - Prometheus Metrics: Live metrics exported on
/metricsfor active workflows, execution duration, and retry counts. - Framework Middleware: Built-in support for Express, Fastify, and Hono.
Runnable Sample Project
A turnkey sample application showcasing@siglo/monitor is available at examples/live-monitoring:
- Launches the live monitoring DevTools server at
http://localhost:4000/. - Simulates an e-commerce order fulfillment pipeline with transient errors, retry backoff (
onFail), conditional step skips (onBefore), and credential masking. - Demonstrates durable workflow suspension (
waitForEvent('order.approved')) and automated resumption. - Streams live events over Server-Sent Events (
/events) and WebSockets (/ws). - Exposes Prometheus metrics at
/metrics.
5. Minimal Example
6. Failure Example: OpenTelemetry Exception Recording
When an error occurs,@siglo/opentelemetry records the exception and marks the span status as ERROR:
7. Testing Example
8. Operational Caveats
- Context Redaction in Telemetry: Always specify
redactHookor configureallowContextFieldswhen capturing span attributes or monitoring streams to ensure PII, tokens, and secrets are excluded from logs and tracing dashboards. - Span Limiters: In loops or deep recursive pipelines, avoid creating unbounded spans. Use bounded batching with
map(items, step, { concurrency }).
