Validate dispatch_workflow safe output functionality and add usage documentation #12904
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.
Investigation of workflow run 21543485044 suggesting dispatch_workflow safe output is unsupported. Found all components fully implemented and functional.
Validation Results
Tool Generation -
generateDispatchWorkflowTool()creates MCP tools with_workflow_namemetadata fromdispatch-workflowfrontmatter configMCP Registration -
registerPredefinedTools()registers tools whenconfig.dispatch_workflowexists, attaches handlers that inject workflow_nameHandler Processing -
dispatch_workflow.cjsvalidates against allowed list, enforces max limits, dispatches viagithub.rest.actions.createWorkflowDispatchSafe Output Flow:
{ "type": "dispatch_workflow", "workflow_name": "worker-workflow", "inputs": { "campaign_id": "bootstrap-123", "payload": "{\"target\": \"repositories\"}" } }→ Handler resolves
workflow_filesmapping → Dispatchesworker-workflow.ymlor.lock.ymlTest Coverage
Configuration Flow
→ Generates
worker_workflowMCP tool → Populatesworkflow_filesmap → Passes to handler viaGH_AW_SAFE_OUTPUTS_HANDLER_CONFIGDocumentation Added
Added clear usage instructions to
test-runtime.mdworkflow demonstrating how to use dispatch_workflow safe output:No code changes required. System operational as designed. If run 21543485044 failed, likely configuration issue (workflow not in allowed list, missing
actions: writepermission, or target workflow lacksworkflow_dispatchtrigger).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.