Skip to content

[dotnet-port-api] Add subworkflow host output forwarding gates - #1344

Merged
Quim Muntal (qmuntal) merged 3 commits into
mainfrom
port-api/subworkflow-output-gates-fa7c591539e06982
Nov 2, 2026
Merged

Quim Muntal (qmuntal) merged 3 commits into
mainfrom
port-api/subworkflow-output-gates-fa7c591539e06982

Conversation

@microsoft-agent-framework-for-go

Copy link
Copy Markdown
Contributor

Summary

Adds inproc.SubworkflowConfig and inproc.BindSubworkflowAsExecutorWithConfig, letting callers independently gate whether a hosted subworkflow's outputs are sent to downstream executors (AutoSendMessageHandlerResultObject) and/or yielded as parent outputs (AutoYieldOutputHandlerResultObject). Both default to true (nil), so BindSubworkflowAsExecutor behavior is unchanged. When yield is disabled, the host also no longer declares the child's output types as yielded, matching WorkflowHostExecutor.ConfigureProtocol.

Ported .NET PRs

None specific. Pinned SHA: 0c9944cc9f577d51277ac7c55dbc388b60a577af. Source: Specialized/WorkflowHostExecutor.cs, ExecutorOptions.cs, ExecutorBindingExtensions.BindAsExecutor(Workflow, string, ExecutorOptions) / ConfigureSubWorkflow. Neither is [Experimental].

Breaking Changes

None.

Tests and Examples

Added TestSubworkflowBindingWithConfig_OutputForwardingGates (default / no-send / no-yield). go vet ./workflow/inproc and go test ./workflow/... pass. No example changes needed.

Notes

Catalog leaves (namespace Microsoft.Agents.AI.Workflows, partial): ExecutorBindingExtensions.BindAsExecutor(Workflow, string, ExecutorOptions) -> ExecutorBinding and ExecutorBindingExtensions.ConfigureSubWorkflow(Workflow, string, ExecutorOptions). Expected assessment change: partial → adapted/mapped to inproc.BindSubworkflowAsExecutorWithConfig. Catalog was left unchanged. Screened 676/676 gap rows; inspected one group (subworkflow host options). Duplicate checks (before and after implementation): issue query returned 0 results; PR query returned only closed #325 (base subworkflow port, not this behavior).

Generated by .NET to Go API Porting Agent · copilot · auto · 46 AIC · ⌖ 0.716 AIC · ⊞ 4.9K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added area:workflow Changes files in the workflow area parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs labels Nov 2, 2026
@github-actions

This comment has been minimized.

@qmuntal

Copy link
Copy Markdown
Member

Copilot break BindSubworkflowAsExecutor by adding the config as last parameter. Then remove BindSubworkflowAsExecutorWithConfig.

Co-authored-by: qmuntal <3747816+qmuntal@users.noreply.github.com>

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Copilot break BindSubworkflowAsExecutor by adding the config as last parameter. Then remove BindSubworkflowAsExecutorWithConfig.

Updated in 0cc4f90: BindSubworkflowAsExecutor now takes SubworkflowConfig as its last parameter, and BindSubworkflowAsExecutorWithConfig has been removed. In-repository callers now pass the config explicitly.

@qmuntal
Quim Muntal (qmuntal) marked this pull request as ready for review November 2, 2026 20:35
Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:35
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner November 2, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change breaks compatibility for existing callers of the public two-argument API, and the tests do not verify that declared output types respect the auto-yield configuration.

2 open issues
What changed in this PR

Adds configurable output forwarding to the in-process subworkflow host, extending the existing subworkflow execution support.

Changes:

  • Adds independent send and yield gates, both enabled by default.
  • Omits child output types from the host’s declared yields when yielding is disabled.
  • Adds forwarding tests and updates callers and catalog examples for the configuration argument.
File Description
workflow/​inproc/​subworkflow.go Adds configuration and gates output forwarding and yield declarations.
workflow/​inproc/​subworkflow_test.go Tests forwarding gates and updates existing binding calls.
workflow/​inproc/​sample_test.go Passes default configuration in sample tests.
workflow/​inproc/​sample_resource_test.go Updates the resource workflow binding call.
workflow/​inproc/​checkpoint_test.go Updates the checkpointed subworkflow binding call.
examples/​03-workflows/​subworkflows/​request_interception/​main.go Passes default configuration for request interception.
examples/​03-workflows/​subworkflows/​nested_order_processing/​main.go Updates nested workflow bindings.
examples/​03-workflows/​01-start-here/​05_subworkflow/​main.go Updates the introductory subworkflow example.
_catalog/​dotnet-go-sdk-symbol-mapping.json Updates four binding examples to include configuration.

Review effort: Balanced

Comment thread workflow/inproc/subworkflow.go Resolved
Comment thread workflow/inproc/subworkflow_test.go Resolved
Add protocol description check for parent in tests

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the area:examples Changes files in the examples area label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

API consistency review

Result Scope
aligned public API, user-visible behavior, examples

Changed Go contract

  • New inproc.SubworkflowConfig with AutoSendMessageHandlerResultObject and AutoYieldOutputHandlerResultObject (*bool; nil means true).
  • inproc.BindSubworkflowAsExecutor(wf, id, cfg) now takes the config as a third parameter. The PR description mentions a separate BindSubworkflowAsExecutorWithConfig, but the head diff does not contain it.
  • When yield is disabled, the host does not declare the child's output types as yielded. When send is disabled, child outputs are not forwarded as messages.
  • The examples were updated for the new signature.

Upstream evidence reviewed

Implementation Source Contract checked
.NET ExecutorOptions.cs (AutoSendMessageHandlerResultObject, AutoYieldOutputHandlerResultObject) Both options default to true.
.NET Specialized/WorkflowHostExecutor.cs Child outputs are yielded only when AutoYieldOutputHandlerResultObject is true; the yield output types are declared only when it is true.

Assessment

The Go behavior matches .NET. Both gates default to enabled, and the yield gate controls both the output-type declaration and the runtime yield. The send gate also matches. I did not find an upstream Python equivalent. The only difference is idiomatic: Go takes a config struct with *bool fields, while .NET takes ExecutorOptions with bool properties. The signature change breaks existing callers of BindSubworkflowAsExecutor. The PR body says there are no breaking changes, so maintainers may want to correct it. This does not affect cross-SDK parity.

The upstream workflow file was read at the pinned SHA, but only through truncated tool output. The default-true option and the yield-gate snippets were confirmed from search fragments. The send gate in WorkflowHostExecutor.cs was not directly confirmed.

Generated by Go API Consistency Review Agent for #1344 · copilot · auto · 32.4 AIC · ⌖ 0.62 AIC · ⊞ 4.9K · ◷

@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 273c85b Nov 2, 2026
23 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the port-api/subworkflow-output-gates-fa7c591539e06982 branch November 2, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:examples Changes files in the examples area area:workflow Changes files in the workflow area parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants