elsa-workflows / elsa-workflows/elsa-foundation
RB4 (decision): does delayed-but-complete beat immediate-but-coarse for inspection reads?
- Dominant language
- C#
- Stars
- 5
- Forks
- 1
- Avg merge
- 3h 56m
- Merged PRs (30d)
- 210
Description
**Backlog item RB4** (Robustness) from [the Elsa 4 improvement recommendations backlog](https://github.com/elsa-workflows/elsa-foundation/blob/main/docs/reports/elsa-4-improvement-recommendations-2026-08.md), `docs/reports/elsa-4-improvement-recommendations-2026-08.md` (landing via #1224).
**This is a decision request, not an implementation task.** The report states the precondition: a product call that "delayed but complete" beats "immediate but coarse" for inspection reads. Do not implement until it is made.
**Cost:** L. **Confidence:** Read.
## Problem
Inspection projections fold into the same commit as state, so relaxing commit cadence coarsens observability: throughput and inspection fidelity are on one dial. ADR 0032 R3 handles this honestly by projecting the granularity so consumers can render the truth, but the coupling remains. Zeebe does not have this trade at all, because the log is written for correctness and exporters read it for observability.
## The question
**For inspection reads, is delayed-but-complete better than immediate-but-coarse?**
Today, turning up coalescing to gain throughput coarsens the timeline to boundary-level. The proposed alternative keeps every activity's evidence but makes it appear after a lag, because a projector consumes it from the post-commit outbox.
## Options
**A. Decouple (the report's proposal).** Move inspection evidence onto the post-commit outbox that [ADR 0020](https://github.com/elsa-workflows/elsa-foundation/blob/main/docs/adr/0020-runtime-checkpoint-commit-post-commit-work.md) already established, and let a projector consume it. Commit cadence and inspection granularity become independently configurable.
*Cost:* L. *Gains:* the dials separate. *Costs to users:* a live timeline lags the run; "the instance says Completed but the last activity is not shown yet" becomes a state the UI must express, and evidence can now be lost in a way state cannot if the projector fails behind the commit.
**B. Keep the coupling and rely on ADR 0032 R3's badge.** The backend already projects `checkpointCadence` and `inspectionGranularity`, so a consumer can say "this run was coalesced, evidence is boundary-level". Honest, shipped, and cheap.
*Cost:* zero beyond U3 (confirming Studio renders it). *Risk:* users who want both throughput and per-activity evidence cannot have both.
**C. Decouple only for `Immediate`-cadence workflows,** where the fold buys nothing.
*Cost:* M. *Risk:* two projection paths to maintain, for the configuration that has the problem least.
## Recommendation
**B until the sizing question is answered, then reconsider A.** The report names the sizing directly: how often is `Immediate` chosen for observability reasons rather than durability ones? If the answer is "rarely", the coupling costs almost nobody anything and an L-sized program buys a dial nobody turns. If it is "often", A is worth its cost and B is a workaround. That number is the decision.
U3 is a cheap prerequisite for judging B: if Studio does not render the badge, B is not actually shipped, it is only implemented.
## If it is built
**Start at:**
- `src/Elsa/Workflows/Runtime/Services/RuntimeCheckpointCommitter.cs` (the fold)
- `RuntimePostCommitOutboxItems`
- `IRuntimeActivityExecutionInspectionAccumulator`
**Done when:** commit cadence and inspection granularity are independently configurable.
## Note
The report frames this as the one Zeebe idea worth importing, in its narrow form: take the exporter's *decoupling*, not its log. Making an append-only command log the source of truth is explicitly a non-recommendation.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with docs/reports/elsa-4-improvement-recommendations-2026-08.md and ADR 0020, then review ADR 0032 R3 and the usage of RuntimeCheckpointCommitter.cs, RuntimePostCommitOutboxItems, and IRuntimeActivityExecutionInspectionAccumulator. This issue is a decision request, so first establish how often Immediate cadence is chosen for observability; implementation would be done when commit cadence and inspection granularity are independently configurable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100