Zing Forum

Reading

Reasonflow: An SDK-First Multi-Agent Workflow Orchestration Framework

An SDK-first, natively MCP-supported agent orchestration framework that provides DAG construction, parallel execution, automatic retries, and cost tracking features, supporting LLM nodes, code nodes, decision nodes, and MCP tool nodes.

智能体编排工作流SDKMCPDAGLLM并行执行成本追踪
Published 2026-04-05 11:44Recent activity 2026-04-05 11:51Estimated read 6 min
Reasonflow: An SDK-First Multi-Agent Workflow Orchestration Framework
1

Section 01

Reasonflow: Guide to the SDK-First Multi-Agent Workflow Orchestration Framework

Reasonflow is an SDK-first, natively MCP-supported agent orchestration framework designed to address the challenges of defining and managing complex AI workflows. It offers DAG construction, parallel execution, automatic retries, and cost tracking features, supporting LLM nodes, code nodes, decision nodes, and MCP tool nodes, helping developers build multi-agent workflows using native Python syntax.

2

Section 02

Background and Challenges of Agent Orchestration

As LLM capabilities advance, AI applications have evolved from simple Q&A to complex multi-step workflows involving multi-model collaboration, external tool calls, conditional branching, and parallel task execution. How to elegantly define and manage these workflows has become a core challenge. Reasonflow proposes an SDK-first solution, building workflows through a code-as-configuration approach.

3

Section 03

Core Concepts and Core Node Design

Reasonflow's core concepts include:

  1. SDK-first: Define workflows using Python code, leveraging IDE features, seamless integration with business code, and support for Git version control.
  2. Natively MCP-supported: Built-in MCP protocol support, standardizing interactions between AI models and external tools, simplifying tool integration. Core node types:
  • LLMNode: Calls LLMs (cloud services or local Ollama models).
  • CodeNode: Executes Python code to process data.
  • DecisionNode: Conditional branching judgment.
  • MCPNode: Calls MCP tools. Workflows are built via DAGs, with nodes connected using >>, and parallel execution achieved through the parallel() function.
4

Section 04

Advanced Features: Reliability and Observability

Advanced features:

  • Automatic retries: Adopts exponential backoff or fast failure strategies based on error types (retryable/deterministic).
  • Cost tracking: Automatically records token consumption and API costs, generates JSON execution traces, and supports CLI viewing.
  • Debugging support: Multiple modes (--debug flag, debug=True parameter, .debug() method) to print node inputs and outputs.
5

Section 05

Rich Example Scenarios

The project provides multiple example scenarios:

  • Research pipeline: Parallel data collection + LLM report generation.
  • Multi-model debate: Three LLMs debating + judge model synthesizing views.
  • Code review: Analyzing git diff to generate reports.
  • CSV analysis: Code node computing statistics + LLM generating insights.
  • Web scraping: Fetching web pages + cleaning HTML + generating summaries.
  • Health check: Parallel system checks + DecisionNode determining alerts/reports.
  • Docker cleanup: Parallel container info collection + decision-based cleanup.
6

Section 06

Quick Start and Deployment Guide

Quick start steps:

  1. Installation: pip install reasonflow.
  2. Configuration: Copy .env.example to .env and fill in API keys.
  3. Execution: reasonflow run <script path>, pass variables via -v (e.g., -v topic="AI safety"), supports integration into CI/CD or scheduled tasks.
7

Section 07

Application Scenarios and Ecosystem Value

Application scenarios:

  • Data science teams: Automated data analysis and report pipelines.
  • DevOps teams: Intelligent operations (log analysis, fault diagnosis, resource cleanup).
  • Product teams: Rapid prototyping of AI features. Ecosystem value: Promotes the development of the MCP ecosystem, reuses community MCP servers, and lowers the threshold for AI application development.
8

Section 08

Summary: Reasonflow's Value and Future

Reasonflow represents a new direction in AI workflow orchestration: SDK-first code definition, native MCP tool integration, and production-grade reliability features. Through its concise API and rich functionality, it allows developers to focus on business logic. As LLM applications expand, such orchestration tools will play an increasingly important role.