Skip to content

Conversation

@moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Dec 12, 2025

Motivation and Context

Adds a graph-based runtime for executing declarative YAML workflows, enabling multi-agent orchestration without writing Python code.

Features

  • Workflow Graph Builder: Transforms YAML workflow definitions into executable directed graphs
  • Action Executors: SetValue, SendActivity, Foreach, If/Switch, RepeatUntil, GotoAction, InvokeAzureAgent, and more
  • Expression Evaluation: PowerFx-style expressions with namespace support (Local., System., Workflow.)
  • Human-in-the-Loop: Question, WaitForInput, and RequestExternalInput actions for interactive workflows
  • Schema Validation: Required field checking, duplicate ID detection, and self-referencing goto detection

Samples

  • simple_workflow: Basic variables, conditionals, and loops
  • conditional_workflow: Nested branching based on user input
  • human_in_loop: Interactive workflows requesting user input
  • function_tools: Invoking Python functions from workflows
  • customer_support, marketing, deep_research, student_teacher: Multi-agent patterns

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 self-assigned this Dec 12, 2025
Copilot AI review requested due to automatic review settings December 12, 2025 08:02
@moonbox3 moonbox3 added python workflows Related to Workflows in agent-framework declarative-workflow labels Dec 12, 2025
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Dec 12, 2025
@moonbox3 moonbox3 moved this to In Review in Agent Framework Dec 12, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Dec 12, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _edge.py2333186%36, 58–59, 61, 142, 195, 213–214, 216, 464–465, 470, 474–479, 481–483, 601, 715, 722–724, 771, 799, 825, 879, 893
   _edge_runner.py1681690%53, 58, 71, 117, 142–143, 147, 154, 203, 214, 219, 241, 367–368, 372, 413
   _workflow_builder.py2783687%259, 600, 699, 706–707, 808, 811, 816, 818, 825, 828–832, 834, 896, 971, 974, 1034–1035, 1178, 1192–1199, 1201, 1204, 1206–1208, 1216
packages/core/agent_framework/openai
   _chat_client.py2334381%110–111, 115, 133, 143–144, 146, 157, 171, 173–176, 185, 197, 233, 264, 269–283, 290–292, 367, 374, 376, 378, 398–399, 405, 421
TOTAL16609256384% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2741 130 💤 0 ❌ 0 🔥 1m 1s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

self,
*,
agent_factory: AgentFactory | None = None,
agents: Mapping[str, Any] | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

can't we tighten this? AgentProtocol and AgentExecutor?

if "kind" in agent_def:
# Convert to YAML and use AgentFactory
yaml_str = yaml.dump(agent_def)
return self._agent_factory.create_agent_from_yaml(yaml_str)
Copy link
Member

Choose a reason for hiding this comment

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

I think we could just add a create_agent_from_dict method to the agent factory, so that we don't have to yaml dump first?

import asyncio
from pathlib import Path

from agent_framework_declarative import WorkflowFactory
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from agent_framework_declarative import WorkflowFactory
from agent_framework.declarative import WorkflowFactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

declarative-workflow documentation Improvements or additions to documentation python workflows Related to Workflows in agent-framework

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Python runtime for Declarative Workflows (Epic)

3 participants