Repository navigation
feat(workflow-executor): use a sub-workflow's end as a decision condition source - #2070
Open
christophebrun-forest wants to merge 3 commits into
Open
christophebrun-forest wants to merge 3 commits into
christophebrun-forest wants to merge 3 commits into
Conversation
…ce type (#2067) * refactor(workflow-executor): resolve a decision condition by its source type A condition carries an optional sourceType, absent meaning get-data, so later source kinds plug in their own resolver. No behaviour change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ondition source (#2068) * feat(workflow-executor): resolve a sub-workflow's end as a decision condition source A condition with sourceType sub-workflow and field end reads the id of the End the most recent call of that Sub-workflow step returned from, among the calls the pending step's own workflow made. Not reached means not met. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 new issue
|
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (4)
🛟 Help
|
Resolves the conflict with #2064 (nested condition groups): - the server condition node carries `sourceType`, nullable like the schema; - a condition node is dispatched on its shape instead of through z.union, so an unknown source type, operator or sub-workflow End rule names the field at fault instead of a bare "Invalid input"; - tests cover a sub-workflow End condition inside a group, mixed with Get Data, and a second call of a workflow not seeing the Ends of the first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
christophebrun-forest
marked this pull request as ready for review
November 10, 2026 15:44
This branch has not been deployed
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.

Part of PRD-988. Integration branch for the epic in agent-nodejs. Draft until the orchestrator and front lots are ready.
What this delivers
Lot 2 of PRD-988 (PRD-2028): a deterministic Decision condition can read which End an upstream Sub-workflow step returned from, for example "if Sub-workflow 1 › End is Approved, then A".
Already reviewed and merged here (main, with #2064's nested condition groups, merged in since; an End condition works at any depth of a group):
sourceType(absent ornullmeansget-data). No behaviour change.sub-workflowsource:fieldName: 'end', operatorsequal/not_equal/in/not_in;source-step-not-reached.Existing Get Data conditions are unchanged. Nothing sends a
sub-workflowsource until the orchestrator does, so this code does nothing on its own.Contract with the other lots
{ sourceType: 'sub-workflow', sourceStepId: <Sub-workflow step id>, fieldName: 'end', operator, value }valueis an End id, or a non-empty list of End ids forin/not_in.stepNamebeing the End's BPMN element id.Before marking ready
stepNameis the End's id, and each operator routes as named.Rollout
Merging this publishes a new
@forestadmin/workflow-executorminor, and that published version is the floor PRD-2029 sets: executors older than it stripsourceTypeand would read such a condition as Get Data, routing to the fallback.1.36.0already shipped from main (feat(wf nested condition): allow nested condition on gateway step #2064) without this source, so the orchestrator'sDEFAULT_MIN_SUB_WORKFLOW_END_CONDITION_EXECUTOR_VERSION = '1.36.0'is too low and must be raised to the version this merge publishes. Order: this branch → orchestrator floor → front (PRD-2030, PRD-1941).🤖 Generated with Claude Code
Note
Add sub-workflow End as a condition source type in workflow-executor
ConditionStepExecutor.resolveConditionValuedispatches on the condition's source type, which defaults toget-datawhen absent or null. See condition-step-executor.ts.endfield and theequal,not_equal,in, andnot_inoperators. List operators require a non-empty list of non-empty strings; scalar operators require a non-empty string. Validation lives in step-definition.ts.ExecutionContextassubWorkflowEnds.sourceTyperaisesInvalidStepDefinitionErrorin bothtoStepDefinitionand condition execution, so existing condition definitions with unknown source-type values that previously parsed will now fail validation.Macroscope summarized 5073c7f.