diff --git a/en/use-dify/nodes/output.mdx b/en/use-dify/nodes/output.mdx index 4c2dabead..c5542e95d 100644 --- a/en/use-dify/nodes/output.mdx +++ b/en/use-dify/nodes/output.mdx @@ -1,16 +1,88 @@ --- title: "Output" -description: "Define workflow outputs and termination points" +description: "Return workflow results to the end user or API caller" --- +Use the Output node to deliver specific variable values from your workflow to the end user or API caller. Add it where you need to surface results. + - The Output node was previously called End. It's now *optional* in a workflow and used only to explicitly output data to the end user. +The Output node was previously named *End* and was required in every workflow. + +It is now optional—workflows run successfully without one, but any workflow or branch without an Output node returns no data to the caller. + +Output nodes are only available in Workflows. Chatflows use the [Answer](/en/use-dify/nodes/answer) node instead. + + +## Configure Output Variables + +Each Output node requires at least one output variable. To add a variable, assign a name and select the source from any upstream node's output. - End nodes are only for Workflow applications. Chatflows use the [Answer](/en/use-dify/nodes/answer) node instead to deliver responses during the conversation flow. + + The variable name you assign becomes the key in API responses. +You can add multiple output variables to a single Output node and reorder them by dragging. + +## Supported Variable Types + +Output variables support the following types: + +`string`, `number`, `integer`, `boolean`, `object`, `file`, `array[string]`, `array[number]`, `array[object]`, `array[boolean]`, `array[file]` + +## Multiple Output Nodes + +A workflow can contain more than one Output node. The Output node does not stop workflow execution—other parallel branches (if any) continue running after it completes. + +All output variables from every executed Output node are combined into one final result. Each Output node adds its variables to the result as the workflow reaches it: + +- On the **same branch**, variables are added in the order the Output nodes are placed. + +- On **parallel branches**, whichever Output node executes first adds its variables first. + + +Always use unique variable names across all Output nodes in a workflow. + +When two Output nodes use the same output variable name, the later one overwrites the earlier value. + + +## API Response Structure + +When you call a workflow through the API, output variables appear in the `outputs` object of the response. + + + + All outputs return in a single response once the workflow completes: + + ```json + { + "workflow_run_id": "...", + "status": "succeeded", + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + ``` + + + Outputs arrive in the final `workflow_finished` event: + + ```json + { + "event": "workflow_finished", + "data": { + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + } + ``` + + + +Each output variable name maps directly to a key in the `outputs` object. -## Output Configuration -In an Output node, you can define what data from your workflow should be returned to users by adding output variables, such as an LLM's response. At least one output variable must be specified; otherwise, nothing will be returned. +## For Workflow Tools -When exposed as a backend service API, workflows without an Output node will not return any values to API callers. \ No newline at end of file +When you [publish a workflow as a tool](/en/use-dify/workspace/tools#workflow-tool), the Output node defines the tool's return schema. Each output variable name becomes a key in the tool's result, accessible to the parent workflow that invokes the tool. diff --git a/ja/use-dify/nodes/output.mdx b/ja/use-dify/nodes/output.mdx index cf03a1d42..6f0805365 100644 --- a/ja/use-dify/nodes/output.mdx +++ b/ja/use-dify/nodes/output.mdx @@ -1,18 +1,90 @@ --- title: "出力" -description: "ワークフローの出力と終了ポイントを定義する" +description: "ワークフローの結果をエンドユーザーまたは API 呼び出し元に返す" --- - ⚠️ このドキュメントは AI によって自動翻訳されています。不正確な点がある場合は、[英語版](/en/use-dify/nodes/output)を参照してください。 + ⚠️ このドキュメントは AI によって自動翻訳されています。不正確な点がある場合は、[英語版](/en/use-dify/nodes/output) を参照してください。 + +出力ノードは、ワークフロー内の特定の変数値をエンドユーザーまたは API 呼び出し元に返します。結果を表示したい箇所に追加してください。 - 出力ノードは以前は終了ノードと呼ばれていました。現在、ワークフローでは*オプション*であり、エンドユーザーにデータを明示的に出力する場合にのみ使用されます。 +出力ノードは以前「終了」ノードと呼ばれ、すべてのワークフローで必須でした。 + +現在はオプションです。出力ノードがなくてもワークフローは正常に実行されますが、呼び出し元にデータは返されません。 + +出力ノードはワークフローアプリケーションでのみ使用できます。チャットフローアプリケーションでは、代わりに [回答](/ja/use-dify/nodes/answer) ノードを使用してください。 + + +## 出力変数の設定 + +各出力ノードには少なくとも 1 つの出力変数が必要です。変数を追加するには、名前を指定し、上流ノードの出力からデータソースを選択します。 - 終了ノードはワークフローアプリケーション専用です。チャットフローは、会話フロー中に応答を配信するために[回答](/ja/use-dify/nodes/answer)ノードを使用します。 + + 設定した変数名は、API レスポンスのキーとして使用されます。 +1 つの出力ノードに複数の出力変数を追加し、ドラッグで順序を変更できます。 + +## サポートされる変数型 + +出力変数は以下の型をサポートしています: + +`string`、`number`、`integer`、`boolean`、`object`、`file`、`array[string]`、`array[number]`、`array[object]`、`array[boolean]`、`array[file]` + +## 複数の出力ノード + +ワークフローには複数の出力ノードを配置できます。出力ノードはワークフローの実行を停止しません。他の並列ブランチ(ある場合)は、出力ノードの完了後も引き続き実行されます。 + +実行されたすべての出力ノードの変数は、1 つの最終結果に統合されます。各出力ノードは、ワークフローがそのノードに到達した時点で変数を結果に追加します: + +- **同一ブランチ** では、出力ノードの配置順に変数が追加されます。 + +- **並列ブランチ** では、先に実行が完了した出力ノードの変数から順に追加されます。 + + +ワークフロー内のすべての出力ノードで、変数名が重複しないようにしてください。 + +2 つの出力ノードが同じ出力変数名を使用している場合、後に実行されたノードの値で上書きされます。 + + +## API レスポンス構造 + +API 経由でワークフローを呼び出すと、出力変数はレスポンスの `outputs` オブジェクトに含まれます。 + + + + ワークフロー完了後、すべての出力が単一のレスポンスで返されます: + + ```json + { + "workflow_run_id": "...", + "status": "succeeded", + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + ``` + + + 出力は最後の `workflow_finished` イベントで到着します: + + ```json + { + "event": "workflow_finished", + "data": { + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + } + ``` + + + +各出力変数名は、`outputs` オブジェクト内のキーに直接対応します。 -## 出力設定 -出力ノードでは、LLM の応答などの出力変数を追加することで、ワークフローからユーザーに返すデータを定義できます。少なくとも 1 つの出力変数を指定する必要があります。指定しない場合、何も返されません。 +## ワークフローツールとしての公開 -バックエンドサービス API として公開される場合、出力ノードのないワークフローは API 呼び出し元に値を返しません。 +[ワークフローをツールとして公開](/ja/use-dify/workspace/tools#ワークフローツール) すると、出力ノードがツールの返却スキーマを定義します。各出力変数名がツール結果のキーとなり、ツールを呼び出す親ワークフローからアクセスできます。 diff --git a/tools/translate/formatting-ja.md b/tools/translate/formatting-ja.md index 9a1bfa7d6..1b38bdd20 100644 --- a/tools/translate/formatting-ja.md +++ b/tools/translate/formatting-ja.md @@ -75,6 +75,15 @@ No space is needed when bold text is adjacent to punctuation or the start of a l ## Links +When link text is adjacent to Japanese characters, insert a space on each side: + +| Correct | Incorrect | +|:--------|:----------| +| 詳細は [環境変数](/path) を参照してください | 詳細は[環境変数](/path)を参照してください | +| 代わりに [回答](/path) ノードを使用 | 代わりに[回答](/path)ノードを使用 | + +No space is needed when link text is adjacent to punctuation. + For cross-links to other documentation pages, change the `/en/` path prefix in the English source to `/ja/`. ### API Reference Cross-Links @@ -166,7 +175,7 @@ These elements must be translated, not left in English: - **Frame captions and image alt text:** Translate both `` and `![alt text]`. - **Bold UI labels:** When a UI label appears in **bold**, use the official Japanese translation from `web/i18n/ja-JP/`. Refer to the glossary. - **Prompt examples:** Translate natural language text inside code blocks (using です/ます form). Keep variable placeholders (`{{variable_name}}`) unchanged. -- **Cross-reference heading anchors:** When a link includes `#heading-slug`, update the slug to match the translated heading. +- **Cross-reference anchors:** When a link includes `#slug`, update the slug to match the translated text. This applies to both heading anchors and Tab title anchors (Mintlify generates anchors from `` values). ## Em Dashes diff --git a/tools/translate/formatting-zh.md b/tools/translate/formatting-zh.md index 426ec5092..9e87f7cb7 100644 --- a/tools/translate/formatting-zh.md +++ b/tools/translate/formatting-zh.md @@ -139,7 +139,7 @@ These elements must be translated, not left in English: - **Frame captions and image alt text:** Translate both `` and `![alt text]`. - **Bold UI labels:** When a UI label appears in **bold**, use the official Chinese translation from `web/i18n/zh-Hans/`. Refer to the glossary. - **Prompt examples:** Translate natural language text inside code blocks. Keep variable placeholders (`{{variable_name}}`) unchanged. -- **Cross-reference heading anchors:** When a link includes `#heading-slug`, update the slug to match the translated heading. +- **Cross-reference anchors:** When a link includes `#slug`, update the slug to match the translated text. This applies to both heading anchors and Tab title anchors (Mintlify generates anchors from `` values). ## Em Dashes diff --git a/writing-guides/glossary.md b/writing-guides/glossary.md index 316dc03d5..4b1b40a92 100644 --- a/writing-guides/glossary.md +++ b/writing-guides/glossary.md @@ -120,6 +120,8 @@ Terms appear in body text exactly as written in this table. Capitalize them furt | input field | 输入字段 | 入力フィールド | Form fields where people provide requested information | | request form | 请求表单 | リクエストフォーム | The form sent to recipients asking for input/review; use "request form" not "request page" | | Assemble Variable | 变量组装 | 変数アセンブル | On-demand data transformation using natural language descriptions | +| blocking mode | 阻塞式返回 | ブロッキングモード | API `response_mode` value; returns results after execution completes | +| streaming mode | 流式返回 | ストリーミングモード | API `response_mode` value; returns results progressively via SSE | ### Agent diff --git a/zh/use-dify/nodes/output.mdx b/zh/use-dify/nodes/output.mdx index 10be69f1e..b15c16bca 100644 --- a/zh/use-dify/nodes/output.mdx +++ b/zh/use-dify/nodes/output.mdx @@ -1,18 +1,90 @@ --- title: "输出" -description: "定义工作流输出和终止点" +description: "将工作流结果返回给终端用户或 API 调用者" --- ⚠️ 本文档由 AI 自动翻译。如有任何不准确之处,请参考 [英文原版](/en/use-dify/nodes/output)。 +使用输出节点将工作流中的特定变量值传递给终端用户或 API 调用者。在需要呈现结果的位置添加该节点。 + - 输出节点以前称为结束节点。它现在在工作流中是*可选的*,仅用于显式地向最终用户输出数据。 +输出节点的前身是「结束」节点,曾是每个工作流的必需组件。 + +现在它是可选的,没有输出节点的工作流仍然可以正常运行,但不会向调用者返回任何数据。 + +输出节点仅适用于工作流应用。对话流应用请使用 [直接回复](/zh/use-dify/nodes/answer) 节点。 + + +## 配置输出变量 + +每个输出节点至少需要一个输出变量。添加变量时,指定一个名称并从上游节点的输出中选择数据来源。 - 结束节点仅适用于工作流应用程序。对话流使用[回答](/zh/use-dify/nodes/answer)节点在对话流程中传递响应。 + + 你设置的变量名称将作为 API 响应中的键名。 +你可以在单个输出节点中添加多个输出变量,并通过拖拽调整顺序。 + +## 支持的变量类型 + +输出变量支持以下类型: + +`string`、`number`、`integer`、`boolean`、`object`、`file`、`array[string]`、`array[number]`、`array[object]`、`array[boolean]`、`array[file]` + +## 多个输出节点 + +一个工作流可以包含多个输出节点。输出节点不会终止工作流执行,其他并行分支(如果有)会在该节点完成后继续运行。 + +所有已执行的输出节点的变量会合并为一个最终结果。每个输出节点在工作流执行到它时将变量添加到结果中: + +- 在 **同一分支** 上,变量按输出节点的排列顺序依次添加。 + +- 在 **并行分支** 上,先执行完成的输出节点先添加其变量。 + + +请确保工作流中所有输出节点的变量名称互不重复。 + +当两个输出节点使用相同的输出变量名称时,后执行的节点会覆盖先前的值。 + + +## API 响应结构 + +通过 API 调用工作流时,输出变量会出现在响应的 `outputs` 对象中。 + + + + 工作流完成后,所有输出以单次响应返回: + + ```json + { + "workflow_run_id": "...", + "status": "succeeded", + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + ``` + + + 输出在最终的 `workflow_finished` 事件中到达: + + ```json + { + "event": "workflow_finished", + "data": { + "outputs": { + "result_text": "The processed output...", + "score": 95 + } + } + } + ``` + + + +每个输出变量名称直接对应 `outputs` 对象中的一个键。 -## 输出配置 -在输出节点中,你可以通过添加输出变量(例如 LLM 的响应)来定义应从工作流返回给用户的数据。必须至少指定一个输出变量;否则,不会返回任何内容。 +## 发布为工具 -当作为后端服务 API 公开时,没有输出节点的工作流不会向 API 调用者返回任何值。 +当你将 [工作流发布为工具](/zh/use-dify/workspace/tools#工作流工具) 时,输出节点定义了工具的返回结构。每个输出变量名称会成为工具结果中的一个键,供调用该工具的工作流使用。