feat(composition): allow sub-workflows in for_each groups (#102)#110
Open
PolyphonyRequiem wants to merge 4 commits intomicrosoft:mainfrom
Open
feat(composition): allow sub-workflows in for_each groups (#102)#110PolyphonyRequiem wants to merge 4 commits intomicrosoft:mainfrom
PolyphonyRequiem wants to merge 4 commits intomicrosoft:mainfrom
Conversation
…rosoft#101) Add input_mapping field to AgentDef for type='workflow' agents. When present, each value is a Jinja2 expression rendered against the parent context to build sub-workflow inputs. When absent, existing behavior (forwarding parent's workflow.input.*) is preserved. - Schema: Add input_mapping to AgentDef with validation for workflow-only - Engine: Render input_mapping templates in _execute_subworkflow() - Tests: Schema validation for all agent types - Experimental workflows: test-input-mapping parent/child pair Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
) Remove validator restriction blocking type='workflow' in for_each groups. Wire execute_single_item() to call _execute_subworkflow_with_inputs() for workflow agents, rendering input_mapping with loop variables in scope. - Validator: Remove workflow rejection in for_each validation - Engine: Add workflow branch in execute_single_item(), new helper _execute_subworkflow_with_inputs() for pre-built inputs - Tests: Update test_workflow_in_for_each to validate (not reject) - Experimental workflows: test-for-each-workflow parent/child pair Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Converted to draft — lint check failing. Schema and type check pass. Needs lint fixes before merging. Depends on PR #109 (input_mapping) landing first. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
=======================================
Coverage ? 84.66%
=======================================
Files ? 53
Lines ? 7195
Branches ? 0
=======================================
Hits ? 6092
Misses ? 1103
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove json.loads coercion from input_mapping rendering (values stay
as strings; use {{ expr | json }} filter for structured data)
- Add error context identifying which input_mapping key failed to render
- Fix falsy check: use 'is not None' instead of truthiness for input_mapping
- Deduplicate _execute_subworkflow_with_inputs into _execute_subworkflow
with an optional sub_inputs parameter
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Removes the validator restriction that prevented
type: workflowagents infor_eachgroups, enabling dynamic fan-out to sub-workflows.Closes #102
Example
Changes
_execute_subworkflow()for workflow agentssubworkflow_started/subworkflow_completedevents per iterationDependency
Builds on #101 (input_mapping) — PR #109. Foundation for #103 (self-referential workflows).