---
title: "工作流编排参考：langgraph - 工作流编排 | 思行致远"
canonical: "https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-langgraph/"
dateModified: "2026-06-30"
datePublished: "2026-06-30"
---

打开 AI·外脑目录  

 

AI·外脑

 [返回专栏首页](https://siyuanailab.com/knowledge/)

 ×

 

站内搜索 

⌕

   

主要栏目

 

- [AI 核心概念](https://siyuanailab.com/knowledge/ai-core/)

- [工作流](https://siyuanailab.com/knowledge/workflows/)

- [工具配置与选型](https://siyuanailab.com/knowledge/toolkits/)

- [信源与标准](https://siyuanailab.com/knowledge/sources/)

- [场景案例 待开发](https://siyuanailab.com/knowledge/scenarios/)

- [职业与能力](https://siyuanailab.com/knowledge/career/)

 

专题

 

- [从这里开始](https://siyuanailab.com/knowledge/start/)

- [获取与安装](https://siyuanailab.com/knowledge/install/)

- [建设日志](https://siyuanailab.com/knowledge/ops/)

  

[工作流子目录](https://siyuanailab.com/knowledge/workflows/) 

基础设施层

 

- [浏览器自动化 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/browser-automation/)

- [MCP 工具 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/mcp-tools/)

- [文件系统与本地执行 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/filesystem-local/)

- [API 网关与工具路由 **5**](https://siyuanailab.com/knowledge/workflows/infrastructure/api-tool-routing/)

Skill 生产线

 

- [目标明确 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/goal-definition/)

- [Skill 设计 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/skill-design/)

- [代码实现 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/implementation/)

- [测试评估 **5**](https://siyuanailab.com/knowledge/workflows/skill-forge/testing-evaluation/)

Skill 参考库

 

- [写作与内容 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/writing-content/)

- [研究与知识 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/research-knowledge/)

- [沟通与协作 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/communication-collaboration/)

- [产品与项目 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/product-project/)

- [数据与分析 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/data-analysis/)

- [创意与设计 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/creative-design/)

- [商业与营销 **5**](https://siyuanailab.com/knowledge/workflows/skill-library/business-marketing/)

Agent Building

 

只收录有多步工作流、工作标准、Loop、Harness、工具链或通信机制的真 Agent；不收纯 persona、profile、curated list 或只有 system prompt 的仓库。

 

- [多 Agent 框架 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/multi-agent-frameworks/)

- [工作流编排 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/) 

- [WF-081 工作流编排参考：claude orchestration](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-claude-orchestration/)

- [WF-082 工作流编排参考：crewAI](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-crewai/)

- [WF-083 工作流编排参考：glink engine](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-glink-engine/)

- [WF-084 工作流编排参考：langgraph](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-langgraph/)

- [WF-085 工作流编排参考：multiagent business automation](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-multiagent-business-automation/)

- [Sub-agent 模式 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/sub-agent-patterns/)

- [Harness 与评估 **5**](https://siyuanailab.com/knowledge/workflows/agent-building/harness-evaluation/)

  

Agent Building · 工作流编排 · Agent Building 参考 · WF-084

 

# 工作流编排参考：langgraph

 

思行致远 · 2026/6/30 · 置信度：高

 

工作流编排状态机handoff任务路由

 

LangChain 旗下低层状态图编排框架，用 durable execution、memory、interrupt 和 LangSmith trace 支撑长时、可恢复 Agent 工作流。

 

# langgraph

 

> LangChain 旗下低层状态图编排框架，用 durable execution、memory、interrupt 和 LangSmith trace 支撑长时、可恢复 Agent 工作流。

 

## 这个能力解决什么问题

 

LangGraph 解决的是 Agent 工作流一旦变长就需要状态、分支、恢复和人工介入的问题。传统链式调用适合短流程，但遇到多轮工具使用、审批中断、失败重跑、长期记忆和多分支状态时，普通函数链会变成难维护的 spaghetti code。LangGraph 把 Agent 运行看成状态图：节点处理状态，边决定下一步，持久层让流程能从中断点继续。

 

## 核心逻辑

 

输入是一份图定义、初始 state、用户消息和可选持久化/记忆配置。运行时节点读取 state，调用模型、工具或子图，把结果写回 state；边根据条件把控制流送到下一节点。中途可以插入 human-in-the-loop interrupt，人工查看或修改 state 后继续。输出是最终 state、节点结果、持久化检查点、LangSmith trace 或部署后的长时 workflow。

 

## 技术结构

 

- 关键模块：state graph 是核心抽象；durable execution 负责失败后从上次状态恢复；interrupt 支撑人审；memory 分短期工作记忆和长期持久记忆；subgraph/branching 支撑复杂流程；LangSmith 提供路径可视化、trace、eval 和部署。
 
- 调用链路：应用构建图 → 初始输入进入节点 → 节点更新 state → 条件边选择后继 → 检查点保存状态 → interrupt/恢复/部署环境继续运行。
 
- 输入输出：输入是 state schema、节点函数、边条件、用户消息和配置；输出是更新后的 state、运行事件、检查点和 trace。
 
- 核心依赖：Python `langgraph`，可独立使用，也可与 LangChain、Deep Agents、LangSmith、LangGraph.js 配套。

 

## 为什么值得参考

 

LangGraph 的参考价值在“低层而不低质”：它不强迫你接受某种角色模型，而是提供状态图、检查点、人审和可观测性这些 Agent 工作流的骨架。对需要把复杂流程拆清楚的人来说，它比“多 Agent 框架”更适合作为内部工作流 DSL 的参照。

 

## 为什么不建议直接套用

 

LangGraph 是低层框架，很多业务约束要自己写：state schema、节点幂等、错误恢复、版本迁移、人工审批 UI、记忆策略都不是自动来的。若没有 LangSmith 或自建 observability，状态图也可能只是更复杂的调用链。对简单线性任务，LangGraph 的心智负担会超过收益。

 

## 如何改造成自己的版本

 

- 先把内部流程画成 5 个以内节点的 state graph，不要一开始做大图。
 
- 为 state 明确定义字段：原始输入、中间证据、当前决策、异常、最终输出。
 
- 每个节点只做一种转换，并保证重复执行不会破坏结果。
 
- 在高风险节点前加 interrupt：外部写入、发布、费用、客户承诺。
 
- 用 trace 记录每次 state 变化，后续再考虑 LangSmith 或自建 dashboard。

 

## 适用场景

 

- 长时、多分支、有状态、有人工审批的 Agent workflow。
 
- 需要从失败点恢复，或需要保存/回放运行状态。
 
- 想把 Agent 流程做成图而不是线性链。

 

## 不适用场景

 

- 一次性短任务、简单 prompt chain、无状态问答。
 
- 没有能力维护 state schema 和可观测系统的团队。
 
- 希望框架自动提供完整业务角色和 UI 的场景。

 

## Agent Building 判断

 

- 多步工作流：state graph 节点/边驱动多步执行，支持 branching、subgraphs、interrupt。
 
- 工作标准：每个节点围绕 state schema 读写，边条件决定可解释的流转。
 
- Loop 标准：durable execution、checkpoint、resume 和 human-in-the-loop 构成可恢复循环。
 
- Harness 标准：LangSmith 可追踪路径、状态变化、eval 和部署；本地也可用检查点做回放。
 
- 工具调用链路或 Agent 间通信：节点内可调用模型/工具/子图，多 Agent 可作为图节点或 Deep Agents 上层封装。
 
- 为什么不是 persona / profile / system prompt only：核心是状态图运行时与持久执行机制，不依赖固定 persona。

 

## 参考信息

 

- 原项目：[langgraph](https://github.com/langchain-ai/langgraph)
 
- 作者：langchain-ai
 
- 相关概念：[[Agent编排]]、[[状态机工作流]]
 
- 相关卡片：[workflow-read-082](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-crewai/)

 

## 参考对象信息

 

**名称：**langgraph

 

**作者：**langchain-ai

 

**链接：**[https://github.com/langchain-ai/langgraph](https://github.com/langchain-ai/langgraph)

 

## 适用场景与行动

 

**场景：**Agent Building / 工作流编排

 

**适合谁：**关注 AI 工作流、Skill 生产和 Agent Building 的读者

 

**下一步：**先阅读边界说明，再判断它是否适合改造成自己的工作流编排流程。

 

当前内容按公开来源和已审核草稿整理，只作为工作流理解与方法论参考。

 

涉及客户数据、外部平台、会议记录和业务系统的场景，必须保留人工确认与授权边界。

  

[上一张：工作流编排参考：glink engine](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-glink-engine/) [下一张：工作流编排参考：multiagent business automation](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/agent-building-orchestration-multiagent-business-automation/)

 

[返回当前分类](https://siyuanailab.com/knowledge/workflows/agent-building/workflow-orchestration/) [返回工作流专栏](https://siyuanailab.com/knowledge/workflows/)
