Operational reliability and observability
Elsa uses a set of cross-cutting services to show what workflows are doing and to keep work moving when external systems fail. Logging, OpenTelemetry, dashboards, caching, scheduling, health checks, and fault handling work together across the host, workflow runtime, and operator tools.
Operational model
The operational model separates three concerns: collect signals, protect workflow work, and give operators a useful view of system state. These concerns share workflow and tenant context but remain optional modules, so a host can choose the level of operational support it needs.
Signal and control paths
Elsa produces workflow signals during execution. Hosts can send those signals to external observability systems or keep a bounded local view for focused diagnosis. Operators use dashboard and diagnostic read paths to inspect the result, while scheduling and resilience services control when work runs and how transient failures are handled.
This diagram shows the relationship between workflow execution, operational controls, and operator views.
flowchart LR
Workflow[Workflow execution] --> Logs[Structured logs]
Workflow --> Telemetry[OpenTelemetry signals]
Workflow --> Schedules[Schedules and triggers]
Workflow --> Retry[Resilience and fault state]
Logs --> Dashboard[Operational dashboard]
Telemetry --> Dashboard
Retry --> Dashboard
Schedules --> Runtime[Workflow runtime]
Retry --> Runtime
Cache[Cache and invalidation] --> Runtime
Cache --> Logs
References: src/…/Program.cs• L58-156 src/…/Program.cs• L38-58 src/…/README.md• L74-90
Module boundaries
The dashboard composes data from the modules that own each signal. Diagnostics modules provide diagnostic summaries, the runtime provides workflow state, and resilience-aware activities provide retry information. This boundary lets a host add or remove an operational feature without changing the workflow dashboard contract.
References: src/…/README.md• L63-90 src/…/StructuredLogsFeature.cs• L9-22 src/…/OpenTelemetryFeature.cs• L9-22
Observability signals
Observability gives an operator evidence about workflow execution and the host that runs it. Elsa supports semantic logs for recent diagnosis and OpenTelemetry signals for traces, metrics, and logs that can be viewed locally or sent to a wider observability system.
Structured logs
Structured logs are semantic ILogger events that Elsa captures for recent and live inspection. The service removes configured sensitive values before it stores or streams events, then exposes recent logs, source information, and live updates for Studio. Storage is bounded, so operators must treat the local view as a recent diagnostic window rather than a full audit record.
The default view is process-local. A durable store can support shared or longer-lived views in a clustered deployment, while the client-facing REST and live-stream contracts stay the same. Access is protected by a diagnostics permission because log events can contain sensitive operational context.
References: src/…/README.md• L1-5 src/…/README.md• L31-61 src/…/README.md• L63-65
OpenTelemetry signals
OpenTelemetry is the standard path for workflow traces and metrics. Elsa workflow instrumentation emits activity spans and workflow metrics, while the diagnostics collector can receive OTLP traces, metrics, and logs for local inspection and Studio views. The collector is a read-side diagnostics service; production deployments normally send signals to an external collector or observability back end when local capacity and retention are not enough.
Workflow spans carry identifiers and status needed to follow execution without adding workflow inputs, outputs, headers, or variable values to telemetry. Outbound HTTP work can continue the same W3C trace, which connects Elsa activity to downstream services.
References: doc/…/opentelemetry-workflows.md• L1-25 doc/…/opentelemetry-workflows.md• L29-46 src/…/README.md• L7-11
Source and storage state
Diagnostic views include the source that produced a signal and the health of its storage. In a clustered host, source identity helps an operator distinguish one process or container from another. Bounded stores report dropped data when their signal buffers are full, so a dashboard or diagnostic page can show when its evidence is incomplete.
References: src/…/README.md• L35-47 src/…/README.md• L39-41
Operational dashboard
The dashboard is a read-only summary of workflow and host activity. It turns workflow state and diagnostic contributions into time-based views that help an operator find faults, unusual activity, and workflows that need attention.
Dashboard views
The dashboard supports a small set of views with shared time ranges. Each view answers a different operational question:
| View | Operational question |
|---|---|
| Overview | Is the runtime accepting work, and what is its current workflow and diagnostic state? |
| Workflow trends | How are starts, finishes, faults, suspensions, and incidents changing over time? |
| Needs attention | Which findings should an operator inspect first? |
| Recent activity | Which workflow instances changed most recently? |
| Workflow hotspots | Which definitions account for faults, executions, incidents, or long duration? |
The dashboard resolves ranges such as one hour, one day, and seven days. It can exclude system workflows so that product-level workflow behavior is not hidden by internal activity.
References: src/…/README.md• L5-61
Capability degradation
Each diagnostic summary reports whether its provider is available, not installed, unauthorized, or unavailable. The dashboard isolates these states by capability, so a structured-log problem does not hide runtime status or workflow metrics. This makes an incomplete dashboard an explicit signal rather than a misleading empty result.
References: src/…/README.md• L63-72
Cache coherence
Caching reduces repeated reads of workflow definitions, triggers, and HTTP endpoint lookups. The cache service gives these consumers a common expiration policy and a change signal so that data can be refreshed after a workflow or trigger changes.
Cached workflow data
Workflow definition queries and trigger queries use cache keys that include the tenant context. Writes signal the related cache group before or after the backing store changes, depending on the data path. This keeps cached definitions and trigger matches from surviving a change for the full cache lifetime.
HTTP workflow lookup adds a second level of invalidation: a changed HTTP trigger evicts its route lookup, and a changed workflow definition evicts lookups that depend on that definition. The result is faster request routing without treating the cache as the source of truth.
References: src/…/WorkflowDefinitionCacheManager.cs• L9-53 src/…/CachingWorkflowDefinitionStore.cs• L96-149 src/…/CachingTriggerStore.cs• L21-86 src/…/CachingHttpWorkflowLookupService.cs• L17-43
Cache limits
The shared cache uses memory and a configurable entry duration. Cache entries are a performance aid, so a host must size the process and duration for its workload and must not use cached workflow data as durable state.
References: src/…/MemoryCacheFeature.cs• L9-29 src/…/CachingOptions.cs• L3-12 src/…/CacheManager.cs• L8-43
Workflow scheduling
Scheduling turns time-based workflow triggers into runtime work. A trigger can start a new workflow or resume an existing one at a specific instant, on a recurring interval, or from a cron expression.
Schedule lifecycle
When a host starts or workflow definitions change, Elsa discovers the tenant's stored schedules and makes them active. The scheduler then wakes the runtime at the requested time and passes the trigger context into the workflow. Tenant activation and deletion update the schedules that belong to that tenant.
This diagram shows the high-level scheduling path from a stored trigger to workflow execution.
sequenceDiagram
participant Trigger as Stored trigger
participant Scheduler as Workflow scheduler
participant Clock as Time source
participant Runtime as Workflow runtime
Trigger->>Scheduler: Register time or cron rule
Scheduler->>Clock: Wait for next occurrence
Clock-->>Scheduler: Occurrence is due
Scheduler->>Runtime: Start or resume workflow
Runtime-->>Scheduler: Work completes or remains scheduled
References: src/…/SchedulingFeature.cs• L31-75 src/…/DefaultTriggerScheduler.cs• L17-106 src/…/DefaultWorkflowScheduler.cs• L9-60
Schedule recovery
Past-due schedules are treated as catch-up work, and invalid cron data is reported without allowing that trigger to block the rest of scheduling. Scheduled triggers also register as runtime ingress sources, which lets graceful shutdown pause new scheduled work and expose its state to runtime diagnostics.
References: src/…/DefaultTriggerScheduler.cs• L40-91 src/…/SchedulingFeature.cs• L55-63 doc/…/http-scheduling-resilience.md• L101-111
Fault handling and resilience
Resilience protects workflow activities that depend on operations such as HTTP calls, databases, or other network services. Fault handling converts workflow incidents into a result that the caller can understand, while retry records and telemetry show how the activity reached that result.
Transient work protection
An activity may select a resilience strategy for its operation. The strategy can retry failures that match known transient conditions, then record each attempt and the applied strategy in workflow execution metadata. This gives operators a way to distinguish a single hard failure from work that succeeded only after repeated attempts.
The default transient detector recognizes common timeout, connection, network, stream, and database failure patterns. Services with different failure semantics can provide their own strategy rather than treating every exception as safe to retry.
References: src/…/ResilientActivityInvoker.cs• L24-80 src/…/DefaultTransientExceptionStrategy.cs• L3-64 src/…/RetryTelemetryListener.cs• L8-26
Resilience operator access
Resilience exposes read and execute paths for operational support. Any signed-in user can view available strategies because the designer needs them to open workflow definitions. Separate permissions protect retry-attempt data and bounded response simulations, so access to those operational actions remains controlled.
The response simulation uses a session to return a chosen sequence of HTTP status codes. It limits the size of the request and the number of active sessions, so it can test fault-handling behavior without becoming an unbounded shared resource.
References: src/…/Endpoint.cs• L9-23 src/…/Endpoint.cs• L9-34 src/…/Endpoint.cs• L14-48 src/…/ResiliencePermissions.cs• L11-31
HTTP fault responses
HTTP workflow faults cross from workflow state into an HTTP response. The default handler maps timeout incidents to 408, bad-request incidents to 400, and other incidents to 500. Hosts can replace this behavior when their API contract needs a different response or a detailed fault body.
References: src/…/DefaultHttpEndpointFaultHandler.cs• L6-43 doc/…/http-scheduling-resilience.md• L61-70
Graceful shutdown
External event sources register with the workflow runtime so shutdown can stop new ingress before it drains active work. HTTP and scheduled-trigger sources use this contract, which connects deployment lifecycle control to runtime status and operational diagnosis.
References: doc/…/http-scheduling-resilience.md• L144-146 src/…/SchedulingFeature.cs• L61-63 src/…/Program.cs• L212-241
For the detailed diagnostic and resilience contracts, see Diagnostics and resilience.
Deployment health
Deployment health checks provide a small control signal separate from workflow diagnostics. Liveness answers whether the process is running, while readiness includes Elsa checks such as runtime dependencies and distributed locks before a host receives traffic.
The server also uses standard OpenTelemetry export for application logs, traces, and metrics. A deployment can therefore combine Elsa's local dashboard with a platform-level view of the host and its downstream services.
References: src/…/Program.cs• L212-241 src/…/Program.cs• L38-58
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to a diagnostic provider must preserve the dashboard capability states so one unavailable signal does not suppress unrelated dashboard data.
- Changes to workflow, trigger, or HTTP lookup writes must preserve the matching cache invalidation signal and tenant scope.
- Changes to schedule payloads or trigger types must keep schedule restoration, validation, and runtime ingress reporting aligned.
- Changes to retry classification must confirm that the activity's retry policy, retry records, workflow metadata, and telemetry still describe the same attempts.
- Changes to resilience endpoints or permission descriptors must keep each operator action tied to the intended resource and verb.
- Changes to fault-to-response mapping must preserve the boundary between workflow incidents and the HTTP status contract.
- Changes to OTLP routes or headers must keep exporter configuration, collector security, and diagnostic read access consistent.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A bounded diagnostic store reaches capacity | Older logs, spans, metrics, or live events are dropped and the operator sees an incomplete window | Monitor storage diagnostics and use an external collector or durable store when the local window is not enough |
| A workflow or trigger changes without its cache token being signaled | Requests can use an old definition, trigger, or HTTP route until expiration | Keep write paths paired with the cache manager's invalidation signal |
| A cron payload is missing or invalid | That trigger is skipped, so the expected workflow does not start on schedule | Validate cron payloads and inspect scheduler warnings |
| A non-transient failure is classified as retryable | The activity repeats unsafe work and can delay or duplicate an external action | Use a strategy that matches the operation's failure and idempotency rules |
| A resilience action lacks its required permission | An operator cannot inspect retry data or run a simulation | Keep endpoint permission names and catalog descriptors aligned; do not add a permission requirement to strategy browsing unless its access contract changes |
| A readiness check fails | The deployment reports 503 readiness and should not receive traffic | Treat readiness as a deployment gate and inspect the failing Elsa dependency or distributed lock |
| OTLP ingestion is exposed without its required key | Untrusted senders can submit diagnostic data | Require the configured API key for non-loopback ingestion and keep its value out of collector metadata |
Key files
| File | Why to read it |
|---|---|
| src/…/Program.cs | Shows how a standard Elsa host composes caching, scheduling, dashboard, health, rate limiting, and optional structured-log services. |
| src/…/Program.cs | Shows how a modular host exports logs, traces, and metrics and enables dashboard and diagnostic shell features. |
| src/…/README.md | Defines the structured-log purpose, access model, source view, bounded storage, and Studio integration. |
| src/…/README.md | Defines the OTLP collector boundary, signal routes, security, and storage behavior. |
| src/…/README.md | Defines the operational dashboard views, capability states, and contributor model. |
| src/…/DefaultTriggerScheduler.cs | Shows how stored time-based triggers become scheduled workflow work. |
| src/…/ResilientActivityInvoker.cs | Shows how activity policies connect retries, workflow metadata, and retry records. |
| src/…/Endpoint.cs | Shows the authenticated path for listing available resilience strategies. |
| src/…/Endpoint.cs | Shows the protected paged read path for retry attempt records. |
| src/…/Endpoint.cs | Shows the controlled response simulation used to exercise fault-handling behavior. |
| src/…/ResiliencePermissions.cs | Defines the separate access boundaries for resilience inspection and simulation. |
| src/…/DefaultHttpEndpointFaultHandler.cs | Shows how workflow incidents become HTTP response status codes. |
| src/…/CachingWorkflowDefinitionStore.cs | Shows the cache and invalidation boundary for workflow definitions. |
| src/…/CachingHttpWorkflowLookupService.cs | Shows how HTTP route lookup cache entries depend on trigger and workflow changes. |