Skip to content

Commit 4d1484d

Browse files
RiskeyLCopilot
andauthored
docs: rewrite orchestration logic for cross-workflow node copy-paste (#759)
* docs: rewrite orchestration logic and extend workflow-chatflow overview * translate: update zh and ja for orchestration logic and overview * docs: refine orchestration logic node reuse section * docs: clarify MAX_TREE_DEPTH env var description * fix: align zh title and body references with the glossary UI label * fix: align EN node reuse text with zh/ja translations (User Input exception) Agent-Logs-Url: https://github.com/langgenius/dify-docs/sessions/00e54676-8a43-4b6f-99f8-fef2495b054f Co-authored-by: RiskeyL <36894937+RiskeyL@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 64aa446 commit 4d1484d

13 files changed

Lines changed: 105 additions & 109 deletions

File tree

docs.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"group": "Workflow & Chatflow",
4444
"pages": [
4545
"en/use-dify/build/workflow-chatflow",
46+
"en/use-dify/build/orchestrate-node",
4647
{
4748
"group": "Nodes",
4849
"expanded": false,
@@ -78,7 +79,6 @@
7879
"en/use-dify/nodes/tools"
7980
]
8081
},
81-
"en/use-dify/build/orchestrate-node",
8282
"en/use-dify/build/shortcut-key",
8383
"en/use-dify/build/mcp",
8484
"en/use-dify/build/version-control",
@@ -476,6 +476,7 @@
476476
"group": "工作流与对话流",
477477
"pages": [
478478
"zh/use-dify/build/workflow-chatflow",
479+
"zh/use-dify/build/orchestrate-node",
479480
{
480481
"group": "节点",
481482
"expanded": false,
@@ -511,7 +512,6 @@
511512
"zh/use-dify/nodes/tools"
512513
]
513514
},
514-
"zh/use-dify/build/orchestrate-node",
515515
"zh/use-dify/build/shortcut-key",
516516
"zh/use-dify/build/mcp",
517517
"zh/use-dify/build/version-control",
@@ -909,6 +909,7 @@
909909
"group": "ワークフローとチャットフロー",
910910
"pages": [
911911
"ja/use-dify/build/workflow-chatflow",
912+
"ja/use-dify/build/orchestrate-node",
912913
{
913914
"group": "ノード",
914915
"expanded": false,
@@ -944,7 +945,6 @@
944945
"ja/use-dify/nodes/tools"
945946
]
946947
},
947-
"ja/use-dify/build/orchestrate-node",
948948
"ja/use-dify/build/shortcut-key",
949949
"ja/use-dify/build/mcp",
950950
"ja/use-dify/build/version-control",

en/self-host/configuration/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ These variables are used by the Next.js web frontend container only—they do no
11991199
|---|---|---|
12001200
| `TEXT_GENERATION_TIMEOUT_MS` | `60000` | Frontend timeout for streaming text generation UI. If a stream stalls for longer than this, the UI pauses rendering. |
12011201
| `ALLOW_UNSAFE_DATA_SCHEME` | `false` | Allow rendering URLs with the `data:` scheme. Disabled by default for security. |
1202-
| `MAX_TREE_DEPTH` | `50` | Maximum node tree depth in the workflow editor UI. |
1202+
| `MAX_TREE_DEPTH` | `50` | Maximum number of nodes along a single execution path. Longer paths cannot be published. Changes apply only to newly published workflows. |
12031203

12041204
## Database Service
12051205

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
11
---
2-
title: Flow Logic
2+
title: Orchestration Logic
3+
description: How to arrange, nest, or reuse nodes when building a Workflow or Chatflow
34
---
45

5-
6-
## Serial vs. Parallel execution
6+
## Serial and Parallel Execution
77

88
<Frame>
9-
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/3984e13db72e2bd19870f5764ec000cf.jpeg)
9+
![Serial vs. Parallel Execution](/images/use-dify/workflow/serial-vs-parallel-execution.png)
1010
</Frame>
1111

12-
Flows execute differently depending on how you connect the nodes.
13-
14-
When you connect nodes one after another, they execute in sequence. Each node waits for the previous one to finish before starting. Each node may use variables from any node that ran before it in the chain.
15-
16-
<Frame>
17-
![When You Connect Nodes One After Another, They Execute in Sequence](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/e8e884e146994b5f95cb16ec31cdd81b.png)
18-
</Frame>
19-
20-
When you connect multiple nodes to the same starting node, they all run at the same time. Nodes may not reference parallel node outputs.
21-
22-
<Frame>
23-
![When You Connect Multiple Nodes to the Same Starting Node, They All Run at The](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/5ba85864454880561ec95a37db382f20.png)
24-
</Frame>
12+
When building a workflow, you can arrange nodes in series or in parallel:
2513

26-
<Note>
27-
You can have a maximum of 10 parallel branches from one node, and up to 3 levels of nested parallel structures.
28-
</Note>
14+
- **In series**, nodes run one after another. Each node can read variables from any node earlier in the chain.
2915

30-
## Variable access
16+
- **In parallel**, nodes run at the same time. They can't read each other's variables, but where parallel branches converge, the downstream node can read from all of them.
3117

32-
In serial flows, nodes can access variables from any previous node in the chain.
18+
<Info>
19+
A single execution path supports up to 50 nodes. Self-hosted deployments can change this limit with the `MAX_TREE_DEPTH` environment variable.
20+
</Info>
3321

34-
In parallel flows, nodes can access variables from nodes that ran before the parallel split, but they cannot access variables from other parallel nodes since they're running simultaneously.
22+
## Node Reuse
3523

36-
After parallel branches finish, downstream nodes can access variables from all the parallel outputs.
24+
All nodes except User Input can be copied and pasted within the same workflow, across workflows, or across Dify instances, though there might be compatibility issues between Dify versions.
3725

38-
## Answer node streaming
26+
When you paste a node, its configuration moves with it, but the availability of anything that depends on the surrounding environment is re-evaluated at the destination:
3927

40-
Answer nodes handle parallel outputs differently. When an Answer node references variables from multiple parallel branches, it streams content progressively:
28+
- **Workflow-specific resources**, such as variables
29+
- **Workspace-specific resources**, such as tools, plugins, and knowledge bases
4130

42-
- Content streams up to the first unresolved variable
43-
- Once that variable's node completes, streaming continues to the next unresolved variable
44-
- The order of variables in the Answer node determines the streaming sequence, not the node execution order
31+
## Iteration and Loop
4532

46-
For example, in a flow where `Node A -> Node B -> Answer` with the Answer containing `{{B}}` then `{{A}}`, the Answer will wait for Node B before streaming any content, even if Node A completes first.
33+
For nodes that should run multiple times (once per item in a list or until a condition is met), place them inside an [Iteration](/en/use-dify/nodes/iteration) or [Loop](/en/use-dify/nodes/loop) node.

en/use-dify/build/workflow-chatflow.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ Their core difference is how users interact with the app:
3232
Chatflows support optional features like content moderation, text to speech, and more. See [App Toolkit](/en/use-dify/build/additional-features) for details.
3333
</Tip>
3434

35+
They also start and end with different nodes:
36+
37+
| | Workflow | Chatflow |
38+
|:---|:---|:---|
39+
| Starts with | [User Input](/en/use-dify/nodes/user-input) or [Trigger](/en/use-dify/nodes/trigger/overview) | User Input |
40+
| Ends with | [Output](/en/use-dify/nodes/output) node (optional) | [Answer](/en/use-dify/nodes/answer) node (required) |
41+
42+
A Trigger runs a workflow automatically: on a schedule, when a webhook fires, or from a plugin event. Chatflows always start from a user message, so they don't have Triggers.
43+
44+
For how to compose either type, see [Orchestration Logic](/en/use-dify/build/orchestrate-node).
45+
207 KB
Loading

ja/self-host/configuration/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ DifyからのすべてのアウトバウンドHTTPリクエスト(HTTPノー
12011201
|---|---|---|
12021202
| `TEXT_GENERATION_TIMEOUT_MS` | `60000` | ストリーミングテキスト生成UIのフロントエンドタイムアウト。ストリームがこの時間以上停止した場合、UIはレンダリングを一時停止します。 |
12031203
| `ALLOW_UNSAFE_DATA_SCHEME` | `false` | `data:`スキームのURLレンダリングを許可。セキュリティのためデフォルトでは無効です。 |
1204-
| `MAX_TREE_DEPTH` | `50` | ワークフローエディターUIの最大ノードツリー深度|
1204+
| `MAX_TREE_DEPTH` | `50` | 1 つの実行パスの最大ノード数。上限を超えるワークフローは公開できません。変更は新たに公開するワークフローにのみ適用されます|
12051205

12061206
## データベースサービス
12071207

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,35 @@
11
---
2-
title: "フローロジック"
2+
title: オーケストレーションロジック
3+
description: ワークフローまたはチャットフローを構築する際の、ノードの配置、ネスト、再利用方法
34
---
45

56
<Note> ⚠️ このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/use-dify/build/orchestrate-node)を参照してください。</Note>
67

7-
88
## 直列実行と並列実行
99

1010
<Frame>
11-
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/3984e13db72e2bd19870f5764ec000cf.jpeg)
11+
![直列実行と並列実行](/images/use-dify/workflow/serial-vs-parallel-execution.png)
1212
</Frame>
1313

14-
フローは、ノードの接続方法によって異なる方式で実行されます。
15-
16-
ノードを一つずつ順番に接続すると、シーケンシャルに実行されます。各ノードは、前のノードが完了するまで待機してから開始します。各ノードは、チェーン内で前に実行されたノードの変数を使用できます。
17-
18-
<Frame>
19-
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/e8e884e146994b5f95cb16ec31cdd81b.png)
20-
</Frame>
21-
22-
複数のノードを同じ開始ノードに接続すると、それらはすべて同時に実行されます。ノードは並列ノードの出力を参照できません。
23-
24-
<Frame>
25-
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/5ba85864454880561ec95a37db382f20.png)
26-
</Frame>
14+
ワークフロー構築時、ノードは直列または並列に配置できます。
2715

28-
<Note>
29-
一つのノードから最大10個の並列ブランチを持つことができ、ネストした並列構造は最大3レベルまで可能です。
30-
</Note>
16+
- **直列の場合**、ノードは順番に実行されます。各ノードは、チェーン内で先に実行されたノードの変数を参照できます。
3117

32-
## 変数アクセス
18+
- **並列の場合**、ノードは同時に実行されます。互いの変数は参照できませんが、並列ブランチの合流先のノードは、すべてのブランチの変数を参照できます。
3319

34-
直列フローでは、ノードはチェーン内の前のノードの変数にアクセスできます。
20+
<Info>
21+
1 つの実行パスには最大 50 ノードまで配置できます。セルフホスト環境では `MAX_TREE_DEPTH` 環境変数でこの上限を変更できます。
22+
</Info>
3523

36-
並列フローでは、ノードは並列分岐前に実行されたノードの変数にはアクセスできますが、同時に実行されているため他の並列ノードの変数にはアクセスできません。
24+
## ノードの再利用
3725

38-
並列ブランチが完了した後、下流のノードはすべての並列出力の変数にアクセスできます
26+
ユーザー入力ノードを除き、すべてのノードは同じワークフロー内、ワークフロー間、または Dify インスタンス間でコピー&ペーストできます。ただし、Dify のバージョンが異なる場合は互換性の問題が発生する可能性があります
3927

40-
## 回答ノードのストリーミング
28+
別のワークフローにノードをペーストすると、設定はそのまま引き継がれますが、周辺環境に依存する部分はペースト先で再評価されます:
4129

42-
回答ノードは並列出力を異なる方法で処理します。回答ノードが複数の並列ブランチからの変数を参照する場合、コンテンツを段階的にストリーミングします:
30+
- **ワークフロー固有のリソース**(変数など)
31+
- **ワークスペース固有のリソース**(ツール、プラグイン、ナレッジベースなど)
4332

44-
- 最初の未解決の変数までコンテンツがストリーミングされます
45-
- その変数のノードが完了すると、次の未解決の変数へのストリーミングが続行されます
46-
- 回答ノード内の変数の順序がストリーミングシーケンスを決定し、ノードの実行順序ではありません
33+
## イテレーションとループ
4734

48-
たとえば、`ノード A -> ノード B -> 回答`というフローで、回答に `{{B}}` 、次に `{{A}}` が含まれている場合、ノード A が先に完了しても、回答はノード B が完了するまでコンテンツをストリーミングしません
35+
複数回実行する必要のあるノード(リストの項目ごとに 1 回、または条件を満たすまで)は、[イテレーション](/ja/use-dify/nodes/iteration) または [ループ](/ja/use-dify/nodes/loop) ノード内に配置します

ja/use-dify/build/workflow-chatflow.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,14 @@ Dify は Agentic ワークフローを構築するために、**ワークフロ
3333
<Tip>
3434
チャットフローはコンテンツモデレーション、テキスト読み上げなどのオプション機能をサポートしています。詳細は[アプリツールキット](/ja/use-dify/build/additional-features)を参照してください。
3535
</Tip>
36+
37+
起点と終点のノードも異なります:
38+
39+
| | ワークフロー | チャットフロー |
40+
|:---|:---|:---|
41+
| 開始ノード | [ユーザー入力](/ja/use-dify/nodes/user-input) または [トリガー](/ja/use-dify/nodes/trigger/overview) | ユーザー入力 |
42+
| 終了ノード | [出力](/ja/use-dify/nodes/output)(任意) | [回答](/ja/use-dify/nodes/answer)(必須) |
43+
44+
トリガーは、スケジュール、Webhook、プラグインイベントによってワークフローを自動実行します。チャットフローは常にユーザーメッセージから開始されるため、トリガーはありません。
45+
46+
両方の構築方法については、[オーケストレーションロジック](/ja/use-dify/build/orchestrate-node) を参照してください。

writing-guides/glossary.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Terms appear in body text exactly as written in this table. Capitalize them furt
1414
|:--------|:--------|:---------|:------|
1515
| Workflow | 工作流 | ワークフロー | |
1616
| Chatflow | 对话流 | チャットフロー | |
17+
| workflow | 工作流 | ワークフロー | Always lowercase in English. Collective term covering both Workflow and Chatflow apps. Chinese and Japanese reuse the Workflow app-type translation. |
1718
| Agent | Agent | Agent | Dify App type (alongside Workflow, Chatflow, etc.) that autonomously uses tools|
1819
| Text Generator | 文本生成应用 | テキストジェネレーター | |
1920
| knowledge base | 知识库 | ナレッジベース | Always lowercase unless at sentence start |
@@ -73,6 +74,7 @@ Terms appear in body text exactly as written in this table. Capitalize them furt
7374
| List Operator | 列表操作 | リスト処理 | Filters, sorts, and limits list data |
7475
| Agent | Agent | Agent | Workflow node (distinct from Agent app type above) |
7576
| Human Input | 人工介入 | 人間の入力 | Pauses workflow execution to request human review or decisions |
77+
| Trigger | 触发器 | トリガー | Umbrella term for entry nodes that start a workflow automatically. Concrete types: Schedule Trigger, Webhook Trigger, Plugin Trigger. |
7678
| Schedule Trigger | 定时触发器 | スケジュールトリガー | Triggers workflow execution on a cron schedule |
7779
| Webhook Trigger | Webhook 触发器 | Webhook トリガー | Triggers workflow execution via incoming HTTP webhook |
7880
| Plugin Trigger | 插件触发器 | プラグイントリガー | Triggers workflow execution from a plugin |

zh/self-host/configuration/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ Dify 的所有出站 HTTP 请求(HTTP 节点、图片下载等)都通过代
12011201
|---|---|---|
12021202
| `TEXT_GENERATION_TIMEOUT_MS` | `60000` | 流式文本生成 UI 的前端超时。如果流中断超过此时间,UI 暂停渲染。 |
12031203
| `ALLOW_UNSAFE_DATA_SCHEME` | `false` | 允许渲染 `data:` 协议的 URL。出于安全考虑默认禁用。 |
1204-
| `MAX_TREE_DEPTH` | `50` | 工作流编辑器 UI 中的最大节点树深度|
1204+
| `MAX_TREE_DEPTH` | `50` | 单条执行路径中的最大节点数。超过此限制的工作流无法发布。调整仅对新发布的工作流生效|
12051205

12061206
## 数据库服务
12071207

0 commit comments

Comments
 (0)