Skip to content

feat: Workflow Composition (Sub-Workflows) via type: workflow#87

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/feature-workflow-composition
Draft

feat: Workflow Composition (Sub-Workflows) via type: workflow#87
Copilot wants to merge 3 commits intomainfrom
copilot/feature-workflow-composition

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 10, 2026

Adds a new type: workflow agent type that references external workflow YAML files as sub-workflows, enabling composable and reusable workflow building blocks.

agents:
  - name: deep_research
    type: workflow
    workflow: ./research-pipeline.yaml
    input:
      - workflow.input.topic
    output:
      findings:
        type: string
    routes:
      - to: synthesizer

Sub-workflows run as black boxes — internal agents aren't visible to the parent. Output is stored in context like any other agent ({{ deep_research.output.findings }}).

Schema (config/schema.py)

  • AgentDef.type extended with "workflow" literal
  • New workflow: str | None field for sub-workflow YAML path
  • Model validator: requires workflow path, forbids prompt, model, provider, tools, system_prompt, command, options

Engine (engine/workflow.py)

  • _execute_subworkflow() — loads referenced YAML, creates child WorkflowEngine inheriting parent's provider/registry, runs it, returns output
  • MAX_SUBWORKFLOW_DEPTH = 10 with depth tracking via _subworkflow_depth constructor param
  • Self-referencing circular detection via resolved file path comparison
  • Dispatch branch in main loop with subworkflow_started/completed/failed events, context storage, routing, interrupt support

Validator (config/validator.py)

  • Workflow agents rejected in parallel groups and for-each groups (same restrictions as script steps)

Tests (31 new)

  • 22 schema validation tests (valid configs, forbidden fields, parallel/for-each restrictions, backward compat)
  • 9 engine integration tests (linear execution, output propagation, depth limit, file-not-found, circular ref, routing, mixed workflows, dry-run plan, iteration counting)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/copilot_internal/user
    • Triggering command: /home/REDACTED/.local/lib/python3.12/site-packages/copilot/bin/copilot /home/REDACTED/.local/lib/python3.12/site-packages/copilot/bin/copilot --headless --no-auto-update --log-level info --stdio (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 10, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 10, 2026 19:30
Implement workflow composition allowing agents to reference external
workflow YAML files as sub-workflows. Key changes:

- Schema: Add 'workflow' to AgentDef type literal, add 'workflow' field
  for sub-workflow path, add model validation for workflow type
- Engine: Add _execute_subworkflow method with depth limit enforcement,
  circular reference detection, and provider inheritance
- Validator: Reject workflow agents in parallel groups and for-each groups
- Tests: Add schema validation tests and engine integration tests
- Docs: Update workflow-syntax.md and schema references

Agent-Logs-Url: https://github.com/microsoft/conductor/sessions/7dfbaf29-06cd-448f-89f1-f0289a3466a8

Co-authored-by: jrob5756 <7672803+jrob5756@users.noreply.github.com>
…nested conditionals

Agent-Logs-Url: https://github.com/microsoft/conductor/sessions/7dfbaf29-06cd-448f-89f1-f0289a3466a8

Co-authored-by: jrob5756 <7672803+jrob5756@users.noreply.github.com>
Copilot AI changed the title [WIP] Add sub-workflows support via workflow agent type feat: Workflow Composition (Sub-Workflows) via type: workflow Apr 10, 2026
Copilot AI requested a review from jrob5756 April 10, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Workflow Composition (Sub-Workflows)

2 participants