Fix Faulted workflow when canceling a dangling parallel branch (e.g. Delay) on trigger-resume#7720
Draft
sfmskywalker with Copilot wants to merge 3 commits into
Draft
Fix Faulted workflow when canceling a dangling parallel branch (e.g. Delay) on trigger-resume#7720sfmskywalker with Copilot wants to merge 3 commits into
sfmskywalker with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
…7717) Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix workflow fails when using Delay activity in Elsa 3.7.0
Fix Faulted workflow when canceling a dangling parallel branch (e.g. Delay) on trigger-resume
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
A flowchart branch that runs in parallel (e.g. a self-looping
Delayreminder) faults the workflow when it is canceled after the workflow is resumed via a trigger.Scope
Select one primary concern:
Description
Problem
Given a flowchart where a blocking branch runs in parallel with a self-looping
Delay:Resuming via the HTTP endpoint sets
TriggerActivityId, which causesFlowGraphto be rooted at the trigger activity rather than the structuralStart. The parallelDelayis then unreachable from that root, soIsDanglingActivityreturnstrue. When the approval branch completes through the terminalEnd, the flowchart completes and cancels the runningDelay;OnCounterFlowActivityCanceledAsync→MaybeScheduleOutboundActivitiesAsyncthrows"Activity ... is not reachable from the flowchart graph", faulting the workflow. Regression vs 3.3.5; 100% repro on 3.7.0.Solution
Flowchart.OnCounterFlowActivityCanceledAsync: return early when the canceled activity is dangling. Dangling activities have no forward outbound connections to propagate, and flowchart completion is already evaluated earlier in the handler.FlowGraphunit test asserting the self-looping branch is dangling only when rooted at the trigger.Verification
Steps:
Start → {HttpEndpoint, Delay(self-loop)},HttpEndpoint → End.Delaybranch runs).TriggerActivityId).Expected outcome: workflow reaches
Finishedinstead ofFaulted; the canceledDelaybranch no longer throws.Screenshots / Recordings (if applicable)
Commit Convention
We recommend using conventional commit prefixes:
fix:– Bug fixes (behavior change)feat:– New featuresrefactor:– Code changes without behavior changedocs:– Documentation updateschore:– Maintenance, tooling, or dependency updatestest:– Test additions or modificationsClear commit messages make reviews easier and history more meaningful.
Checklist