mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
Merge pull request #15 from langgenius/docs/step-by-step-execution
Docs: update step by step run
This commit is contained in:
28
docs.json
28
docs.json
@@ -129,9 +129,8 @@
|
||||
"pages": [
|
||||
"en/guides/workflow/debug-and-preview/preview-and-run",
|
||||
"en/guides/workflow/debug-and-preview/step-run",
|
||||
"en/guides/workflow/debug-and-preview/log",
|
||||
"en/guides/workflow/debug-and-preview/checklist",
|
||||
"en/guides/workflow/debug-and-preview/history"
|
||||
"en/guides/workflow/debug-and-preview/history-and-logs",
|
||||
"en/guides/workflow/debug-and-preview/variable-inspect"
|
||||
]
|
||||
},
|
||||
"en/guides/workflow/publish",
|
||||
@@ -757,9 +756,8 @@
|
||||
"pages": [
|
||||
"zh-hans/guides/workflow/debug-and-preview/preview-and-run",
|
||||
"zh-hans/guides/workflow/debug-and-preview/step-run",
|
||||
"zh-hans/guides/workflow/debug-and-preview/log",
|
||||
"zh-hans/guides/workflow/debug-and-preview/checklist",
|
||||
"zh-hans/guides/workflow/debug-and-preview/history"
|
||||
"zh-hans/guides/workflow/debug-and-preview/history-and-logs",
|
||||
"zh-hans/guides/workflow/debug-and-preview/variable-inspect"
|
||||
]
|
||||
},
|
||||
"zh-hans/guides/workflow/publish",
|
||||
@@ -1415,10 +1413,10 @@
|
||||
{
|
||||
"group": "プレビューとデバッグ",
|
||||
"pages": [
|
||||
"ja-jp/guides/workflow/debug-and-preview/preview-and-run",
|
||||
"ja-jp/guides/workflow/debug-and-preview/step-run",
|
||||
"ja-jp/guides/workflow/debug-and-preview/log",
|
||||
"ja-jp/guides/workflow/debug-and-preview/checklist",
|
||||
"ja-jp/guides/workflow/debug-and-preview/history"
|
||||
"ja-jp/guides/workflow/debug-and-preview/history-and-logs",
|
||||
"ja-jp/guides/workflow/debug-and-preview/variable-inspect"
|
||||
]
|
||||
},
|
||||
"ja-jp/guides/workflow/publish",
|
||||
@@ -2386,18 +2384,6 @@
|
||||
"source": "/guides/workflow/debug-and-preview/step-run",
|
||||
"destination": "/en/guides/workflow/debug-and-preview/step-run"
|
||||
},
|
||||
{
|
||||
"source": "/guides/workflow/debug-and-preview/log",
|
||||
"destination": "/en/guides/workflow/debug-and-preview/log"
|
||||
},
|
||||
{
|
||||
"source": "/guides/workflow/debug-and-preview/checklist",
|
||||
"destination": "/en/guides/workflow/debug-and-preview/checklist"
|
||||
},
|
||||
{
|
||||
"source": "/guides/workflow/debug-and-preview/history",
|
||||
"destination": "/en/guides/workflow/debug-and-preview/history"
|
||||
},
|
||||
{
|
||||
"source": "/guides/workflow/publish",
|
||||
"destination": "/en/guides/workflow/publish"
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: Checklist
|
||||
---
|
||||
|
||||
|
||||
Before publishing the App, you can check the checklist to see if there are any nodes with incomplete configurations or that have not been connected.
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/debug-and-preview/checklist.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20l&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/workflow/debug-and-preview%2Fchecklist.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)
|
||||
|
||||
70
en/guides/workflow/debug-and-preview/history-and-logs.mdx
Normal file
70
en/guides/workflow/debug-and-preview/history-and-logs.mdx
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: History and Logs
|
||||
---
|
||||
|
||||
When you debug a Chatflow or Workflow, Dify automatically records detailed logs — both at the run level and for individual nodes. These logs make it easier to locate issues, understand how data flows through your workflow, and fine-tune performance.
|
||||
|
||||
<Info>
|
||||
To explore logs from real users after your application is published, check out [Logs and Annotation](/en/guides/annotation/logs).
|
||||
</Info>
|
||||
|
||||
There are two dimensions of execution records for applications.
|
||||
|
||||
## Application Run History
|
||||
|
||||
Each time the application runs, a **Run History** is recorded. Each run is versioned and includes the application's **Conversation Log** as well as **Tracing Logs** for all nodes in that version. These logs are displayed chronologically and provide basic information about each interaction, including execution time, status, and a summary of input/output parameters.
|
||||
|
||||

|
||||
|
||||
Click on any log entry to see the detailed execution view. Each run includes three major sections:
|
||||
|
||||
### RESULT
|
||||
|
||||
<Warning>
|
||||
The result section is available only for Workflow applications.
|
||||
</Warning>
|
||||
|
||||
This section displays the final output result of the workflow — the content the user sees. If the workflow failed to execute, this section shows error messages and reasons.
|
||||
|
||||

|
||||
|
||||
### DETAIL
|
||||
|
||||
This section includes comprehensive input parameters, metadata, and configuration context from the execution. You can inspect:
|
||||
|
||||
- The original input provided by the user
|
||||
- Output generated by the application
|
||||
- System-generated metadata
|
||||
|
||||

|
||||
|
||||
### TRACING
|
||||
|
||||
This view provides in-depth visibility into the execution path and system behavior. It includes:
|
||||
|
||||
- **Node execution order**: The actual runtime order of each node in the workflow.
|
||||
- **Data flow tracking**: How variables are passed and transformed between nodes. This can also be explored via the [Variable Inspector](/en/guides/workflow/debug-and-preview/variable-inspect).
|
||||
- **Execution time analysis**: Time spent on each node helps identify performance bottlenecks.
|
||||
- **Resource usage**: Token consumption, API calls, and cost-related data.
|
||||
- **Error tracking**: Identify exactly which node failed and why.
|
||||
|
||||

|
||||
|
||||
The tracing view is especially useful for debugging complex workflows and optimizing performance. If your workflow includes branches or loops, this view helps reveal the actual path taken during execution.
|
||||
|
||||
## Node Execution Logs
|
||||
|
||||
In addition to application-level logs, you can also inspect the **last run log** for each individual node directly within the workflow editor. Click **Last run** in the node’s config panel to view its most recent execution details, including input/output data.
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/debug-and-preview/history-and-logs.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20ry-and-l&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/workflow/debug-and-preview%2Fhistory-and-logs.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: Run History
|
||||
---
|
||||
|
||||
|
||||
In the "Run History," you can view the run results and log information from the historical debugging of the current workflow.
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/debug-and-preview/history.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/workflow/debug-and-preview%2Fhistory.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
title: Conversation/Run Logs
|
||||
---
|
||||
|
||||
|
||||
Clicking **"Run History - View Log — Details"** allows you to see a comprehensive overview of the run in the details section. This includes information on inputs and outputs, metadata, and other relevant data.
|
||||
|
||||
This detailed information enables you to review various aspects of each node throughout the complete execution process of the workflow. You can examine inputs and outputs, analyze token consumption, evaluate runtime duration, and assess other pertinent metrics.
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/debug-and-preview/log.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/workflow/debug-and-preview%2Flog.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)
|
||||
|
||||
@@ -1,17 +1,73 @@
|
||||
---
|
||||
title: Preview and Run
|
||||
title: Introduction
|
||||
---
|
||||
|
||||
Once you’ve created a workflow, it’s important to test it thoroughly before going live. Dify offers a full set of debugging tools that let you troubleshoot issues, track variable flow, and review detailed execution logs — all in one place.
|
||||
|
||||
Dify Workflow offers a comprehensive set of execution and debugging features. In conversational applications, clicking "Preview" enters debugging mode.
|
||||
Dify provides a comprehensive debugging toolset to help you quickly locate issues, inspect variable transmission, and view detailed logs.
|
||||
|
||||

|
||||
This article introduces the full workflow debugging process, including single-node debugging, variable inspection, execution history, and end-to-end testing.
|
||||
|
||||
In workflow applications, clicking "Run" enters debugging mode.
|
||||

|
||||
|
||||

|
||||
## Debugging a Workflow Application
|
||||
|
||||
Once in debugging mode, you can debug the configured workflow using the interface on the right side of the screen.
|
||||
### Single Node Debugging
|
||||
|
||||
If a specific node causes the workflow to fail, you can debug that node individually to quickly identify the issue.
|
||||
|
||||
To test a single node, click the debug icon in its top-right corner. Try entering some simple test data and observe the output. You can gradually introduce more complex input to see how the node responds.
|
||||
|
||||
For more details, see [Debug Node](/en/guides/workflow/debug-and-preview/step-run).
|
||||
|
||||

|
||||
|
||||
### Step-by-Step Node Debugging
|
||||
|
||||
This method lets you trace how data flows through each step — from one node to the next — helping you catch issues in real-time.
|
||||
|
||||
For detailed usage, see [Variable Inspection](/en/guides/workflow/debug-and-preview/variable-inspect).
|
||||
|
||||

|
||||
|
||||
### View Node Execution History
|
||||
|
||||
Click “Last Run” in the node panel to review logs from the most recent execution — including inputs, outputs, timing, and any errors.
|
||||
|
||||
See [Debug History - Node Logs](/en/guides/workflow/debug-and-preview/history-and-logs#node-execution-logs) for more details.
|
||||
|
||||

|
||||
|
||||
### Debugging the Entire Workflow
|
||||
|
||||
After you’ve confirmed that each individual node works as expected, it’s time to test the entire workflow from start to finish.
|
||||
|
||||
Use the Preview feature to experience the final user interface. This mode displays the input fields, output area, and interaction flow — ideal for confirming user experience expectations. During preview, the system performs an auto-check to ensure all nodes are configured correctly and connected.
|
||||
|
||||

|
||||
|
||||
#### Configuration Checklist
|
||||
|
||||
Before you run the full workflow, Dify will automatically check for missing parameters, misconfigurations, or disconnected nodes — and prompt you to fix them.
|
||||
|
||||

|
||||
|
||||
While running the workflow, you can view each node's execution status on the right panel, including input/output and logs. Use the status indicators (green = success) to identify where a failure may have occurred.
|
||||
|
||||
It’s recommended to perform multiple test rounds with varying data types and complexities to verify workflow stability before going live.
|
||||
|
||||

|
||||
|
||||
## View Application Logs
|
||||
|
||||
After publishing your application, you can monitor how it’s performing and how users interact with it. Dify’s logs and monitoring tools help you troubleshoot issues, track performance trends, and better understand user behavior.
|
||||
|
||||

|
||||
|
||||
For more information, see:
|
||||
|
||||
- [History and Logs](/en/guides/workflow/debug-and-preview/history-and-logs)
|
||||
- [Monitoring](/en/guides/monitoring/README)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
@@ -1,15 +1,88 @@
|
||||
---
|
||||
title: Step Run
|
||||
title: Debug Node
|
||||
---
|
||||
|
||||
Workflow or Chatflow application is made up of multiple interconnected nodes. To make sure everything works as intended, it’s crucial to test how each node handles input and produces output — before going live.
|
||||
|
||||
Workflow supports step-by-step debugging of nodes, where you can repetitively test whether the execution of the current node meets expectations.
|
||||
With the Step Run feature, you can catch potential issues early by verifying your application’s behavior step by step — helping you avoid errors before publishing.
|
||||
|
||||

|
||||
There are two types of node debugging: single-step run and step-by-step execution.
|
||||
|
||||
After running a step test, you can review the execution status, input/output, and metadata information.
|
||||
## Single-Step Run
|
||||
|
||||

|
||||
### Overview
|
||||
|
||||
Single-step run allows you to test a specific node in isolation without executing the entire workflow. It is helpful for verifying new nodes, troubleshooting individual node errors, or testing responses to various inputs.
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Select the node you want to debug in the workflow editor
|
||||
2. Provide test input variables in the node’s settings panel
|
||||
3. Click **Run** to execute the node
|
||||
4. Review the output and check if the results are as expected
|
||||
|
||||
### Example
|
||||
|
||||
Suppose you've added an HTTP node. To verify whether it correctly fetches and handles API responses, you can use single-step run to simulate actual conditions and confirm it passes data correctly to downstream nodes.
|
||||
|
||||

|
||||
|
||||
After debugging, you can click "Last run" to check execution status, view inputs/outputs, and inspect metadata. If an error occurs, the message will help you locate and fix the problem to avoid full workflow failure.
|
||||
|
||||
<Warning>
|
||||
Answer and End nodes do not support single-step run.
|
||||
</Warning>
|
||||
|
||||
## Step-by-Step Execution
|
||||
|
||||
### Overview
|
||||
|
||||
Workflow execution relies on proper data flow between nodes. In complex workflows, this process can easily fail due to:
|
||||
|
||||
- Data format mismatches (e.g., text passed to a number input)
|
||||
- Misconfigured variables
|
||||
- JSON parsing failures
|
||||
- Incorrect variable path references
|
||||
|
||||
Step-by-step execution helps developers troubleshoot errors in multi-node workflows.
|
||||
|
||||
During this process, node output variables are cached in the [Variable Inspector](/en/guides/workflow/debug-and-preview/variable-inspect). You can edit upstream variables directly to test how downstream nodes respond to different data values.
|
||||
|
||||
This method is particularly useful when your workflow contains nodes that depend on each other’s outputs. Rather than rerunning the entire chain, you can simulate different scenarios quickly by editing cached variables.
|
||||
|
||||

|
||||
|
||||
After running a node, its output is saved to the Variable Inspector. You can use this tool to:
|
||||
|
||||
1. **View actual data**: Check if the output meets expectations
|
||||
2. **Edit test data**: Modify variable values to test downstream behavior
|
||||
3. **Validate data flow**: Ensure values are correctly passed between nodes
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Run a single node in the workflow
|
||||
2. Open the Variable Inspector at the bottom
|
||||
3. Locate the node and check which variables it references
|
||||
4. Modify those variable values and rerun the node
|
||||
5. Compare results and evaluate impact
|
||||
|
||||
### Example
|
||||
|
||||
Suppose your workflow has the following steps: Data Fetch (Node A) → Data Processing (Node B) → Result Display (Node C).
|
||||
|
||||
Node B depends entirely on the output of Node A, and different inputs will change its behavior.
|
||||
|
||||
After running Node A, its output will be cached in the Variable Inspector. You can modify that data directly and rerun Node B without needing to re-execute Node A.
|
||||
|
||||
This approach lets you observe localized behavior and make timely adjustments to node settings, data flow, and logic, improving overall workflow reliability and accuracy.
|
||||
|
||||
## View Node Execution History
|
||||
|
||||
Every time a node is executed, a record is generated. Click “Last run” on the node details panel to view it.
|
||||
|
||||

|
||||
|
||||
To view the full workflow’s execution history, see [Run History](/en/guides/workflow/debug-and-preview/history-and-logs).
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
95
en/guides/workflow/debug-and-preview/variable-inspect.mdx
Normal file
95
en/guides/workflow/debug-and-preview/variable-inspect.mdx
Normal file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
title: Variable Inspector
|
||||
---
|
||||
|
||||
The **Variable Inspector** is a panel located at the bottom of the workflow editor. It captures the input and output data of each node after execution, helping developers quickly identify issues and verify data flow throughout the workflow.
|
||||
|
||||
## Why It Matters
|
||||
|
||||
[Variables](/en/guides/workflow/variables) act as key connectors between nodes and enable dynamic flow control. In workflow applications, variables store user input as well as outputs from each node — such as LLM responses, tool results, conversation context, and environment parameters.
|
||||
|
||||
The Variable Inspector automatically caches each node's input parameters and output results after execution. It provides the following key features:
|
||||
|
||||
- **Real-time variable monitoring**: Captures and displays all variables right after a node runs, including workflow inputs and outputs.
|
||||
- **Edit cached variables**: Lets you manually change most variable types without re-running upstream nodes — ideal for testing different scenarios.
|
||||
- **Abnormal data tracking**: Displays the actual value and type of each variable, making it easier to identify format issues, missing fields, or type mismatches.
|
||||
- **Global state management**: Displays all variables in a single panel, including system variables, environment variables, and custom-defined node variables.
|
||||
|
||||
With the Variable Inspector, you can easily view and edit the latest output variables from any node to see how changes affect downstream nodes.
|
||||
|
||||
## How to Use
|
||||
|
||||
The Variable Inspector is located at the bottom of the canvas and updates in real time as the workflow runs.
|
||||
|
||||
After a node runs, its output variables show up in the panel so you can quickly inspect or edit them.
|
||||
|
||||

|
||||
|
||||
The following is an example of how to use the Variable Inspector in an "external database query" application. In this workflow, an LLM node receives natural language input, translates it into SQL, sends the query to a remote database, and retrieves the data.
|
||||
|
||||
> Click [here](https://assets-docs.dify.ai/2025/06/ac4da5ed5506f8a34aae7f0b88323f37.yml) to download the DSL workflow file.
|
||||
|
||||
### Viewing
|
||||
|
||||
Once a node is executed, its output variables automatically appear in the Variable Inspector. Click a variable to view its detailed content.
|
||||
|
||||

|
||||
|
||||
### Editing
|
||||
|
||||
Click a variable’s value to edit it. The updated value will be used by downstream nodes during the next run.
|
||||
|
||||
<Info>
|
||||
Editing variable values here does not affect the cached data in the node's “Last run” record.
|
||||
</Info>
|
||||
|
||||
**Example:**
|
||||
|
||||
<Steps>
|
||||
<Step title="Default Result">
|
||||
The user inputs “Show all user data,” and the LLM node generates `SELECT * FROM users;`. The database correctly returns all data.
|
||||
<img src="https://assets-docs.dify.ai/2025/06/dcf4b0048bf1ed802369ab10731a4848.png" />
|
||||
</Step>
|
||||
<Step title="After Editing the Variable">
|
||||
The user manually modifies the SQL in the Variable Inspector to `SELECT username FROM users;` and re-runs only the database node. The system returns a list of usernames.
|
||||
|
||||
This allows the user to test new data by re-running only the downstream database node without restarting the entire workflow.
|
||||
<img src="https://assets-docs.dify.ai/2025/06/fb8c49fc0c8c63866f1a9379e8752d9e.png" />
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Revert
|
||||
|
||||
Click the revert icon at the top-right of the variable edit field to restore the variable to its original value.
|
||||
|
||||

|
||||
|
||||
### Reset All Variables
|
||||
|
||||
Click **Reset all** in the top-left corner to clear every cached variable at once.
|
||||
|
||||
{/*
|
||||
|
||||
### Supported Variable Types
|
||||
|
||||
The following types appear in the Variable Inspector. Some of them can be edited.
|
||||
|
||||
| Type | Example | Description |
|
||||
|-----------------------|-----------------------------------------|--------------------------------------------|
|
||||
| **System Variables** | sys.query, sys.user_id, sys.conversation_id | System-provided runtime context |
|
||||
| **Environment Variables** | OPENAI_KEY, SECRET | Values from environment configuration |
|
||||
| **Custom Variables** | [user-defined name], uploaded file | Inputs defined in the Start node or uploaded by the user |
|
||||
| **Node Output Variables** | output, structured_output, usage, loop_variable, iteration_variable | Outputs generated by each node |
|
||||
|
||||
*/}
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/debug-and-preview/variable-inspect.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?title=Documentation%20Issue%3A%20ble-insp&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fen/guides/workflow/debug-and-preview%2Fvariable-inspect.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: デバッグプレビュー
|
||||
---
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/README.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2FREADME.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: チェックリスト
|
||||
---
|
||||
|
||||
|
||||
調整動作に入る前に、未完了の設定や接続されていないノードがないかチェックリストで確認できます。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/checklist.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20l&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fchecklist.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
70
ja-jp/guides/workflow/debug-and-preview/history-and-logs.mdx
Normal file
70
ja-jp/guides/workflow/debug-and-preview/history-and-logs.mdx
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: 実行履歴とログ
|
||||
---
|
||||
|
||||
チャットフローやワークフローをデバッグする際、Difyは実行レベルと各ノードの両方について詳細なログを自動的に記録します。これらのログにより、問題の特定、ワークフロー内のデータ流れの理解、パフォーマンスの微調整が容易になります。
|
||||
|
||||
<Info>
|
||||
アプリケーションが公開された後の実際のユーザーからのログを調査するには、[ログとアノテーション](/ja-jp/guides/annotation/logs.mdx)をご確認ください。
|
||||
</Info>
|
||||
|
||||
アプリケーションの実行履歴には2つの側面があります。
|
||||
|
||||
## アプリケーション実行履歴
|
||||
|
||||
アプリケーションが実行されるたびに、**実行履歴(Run History)**が記録されます。各実行はバージョン管理され、アプリケーションの**会話ログ(Conversation Log)**やそのバージョンのすべてのノードに関する**追跡ログ(TRACING)**が含まれます。これらのログは時系列で表示され、各インタラクションに関する基本情報(実行時間、ステータス、入出力パラメータの概要など)を提供します。
|
||||
|
||||

|
||||
|
||||
任意のログエントリをクリックすると、詳細な実行ビューが表示されます。各実行には次の3つの主要セクションがあります:
|
||||
|
||||
### 結果(RESULT)
|
||||
|
||||
<Warning>
|
||||
結果セクションはワークフローアプリケーションでのみ利用可能です。
|
||||
</Warning>
|
||||
|
||||
このセクションでは、ワークフローの最終出力結果、つまりユーザーが見るコンテンツを表示します。ワークフローの実行が失敗した場合、このセクションにはエラーメッセージとその理由が表示されます。
|
||||
|
||||

|
||||
|
||||
### 詳細(DETAIL)
|
||||
|
||||
このセクションには、実行からの包括的な入力パラメータ、メタデータ、及び構成コンテキストが含まれています。以下の内容を確認できます:
|
||||
|
||||
- ユーザーから提供された元の入力
|
||||
- アプリケーションによって生成された出力
|
||||
- システム生成のメタデータ
|
||||
|
||||

|
||||
|
||||
### 追跡(TRACING)
|
||||
|
||||
このビューは、実行パスとシステム動作について深い可視性を提供します。以下が含まれます:
|
||||
|
||||
- **ノード実行順序**:ワークフロー内の各ノードの実際の実行時順序。
|
||||
- -**データフローの追跡**:変数がノード間でどのように受け渡され、変換されるか。これは[変数インスペクター](/ja-jp/guides/workflow/debug-and-preview/variable-inspect.mdx)でも調査できます。
|
||||
- **実行時間の分析**:各ノードにかかる時間は、パフォーマンスのボトルネックを特定するのに役立ちます。
|
||||
- **リソース使用量**:トークン消費量、API呼び出し、及びコスト関連データ。
|
||||
- **エラー追跡**:どのノードが失敗し、その理由を正確に特定します。
|
||||
|
||||

|
||||
|
||||
追跡ビューは、複雑なワークフローのデバッグとパフォーマンスの最適化に特に役立ちます。ワークフローに分岐やループが含まれている場合、このビューは実行中に実際に通ったパスを明らかにするのに役立ちます。
|
||||
|
||||
## ノード実行ログ
|
||||
|
||||
アプリケーションレベルのログに加えて、ワークフローエディタ内で各ノードの最終実行ログを直接検査することもできます。ノードの設定パネルで最終実行をクリックすると、入力および出力データを含む最新の実行詳細が表示されます。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/history-and-logs.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20ry-and-l&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fhistory-and-logs.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: 実行履歴
|
||||
---
|
||||
|
||||
|
||||
「実行履歴」では、現在のワークフローのデバッグ履歴の実行結果およびログ情報を確認できます。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/history.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fhistory.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
title: 対話/実行ログ
|
||||
---
|
||||
|
||||
|
||||
「ログを表示—詳細」をクリックすると、詳細情報、入力/出力、メタデータ情報などの実行概要を見ることができます。
|
||||
|
||||

|
||||
|
||||
「ログを表示-追跡」をクリックすると、ワークフローの各ノードの入力/出力、トークン消費、実行時間などの完全な実行過程を見ることができます。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/log.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Flog.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
79
ja-jp/guides/workflow/debug-and-preview/preview-and-run.mdx
Normal file
79
ja-jp/guides/workflow/debug-and-preview/preview-and-run.mdx
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: 機能紹介
|
||||
---
|
||||
|
||||
ワークフローを作成した後、開発者はアプリケーションを公開する前に、各ノードが正常に動作しているかどうかを確認し、変数内のデータが正しく流れているかを検証するためにデバッグを行うことができます。
|
||||
|
||||
Difyは完全なデバッグツールを提供し、問題の迅速な特定、変数の受け渡しの確認、詳細なログの表示をサポートします。
|
||||
|
||||
本記事では、ワークフローアプリケーションのデバッグの全プロセスを紹介します。これには、単一ノードのデバッグ、変数チェック、実行履歴の確認、および全体テスト方法が含まれます。
|
||||
|
||||

|
||||
|
||||
## ワークフローアプリケーションのデバッグ
|
||||
|
||||
### ノードデバッグ
|
||||
|
||||
ワークフロー内の特定のノードに問題が発生し、ワークフローアプリケーションが正常に実行できない場合、そのノードを単独でデバッグして問題を迅速に特定します。
|
||||
|
||||
ノードの右上にあるデバッグボタンをクリックし、テストデータを入力して出力結果を確認します。デバッグの過程では、シンプルなテストデータから始めて、徐々にデータの複雑さを増やし、さまざまな入力状況でノードが正常に動作することを確認することをお勧めします。
|
||||
|
||||
単一ノードのデバッグ方法の詳細については、[ノードのデバッグ](/ja-jp/guides/workflow/debug-and-preview/step-run.mdx)を参照してください。
|
||||
|
||||

|
||||
|
||||
### ステップデバッグ
|
||||
|
||||
ステップデバッグでは、上流ノードの変数に基づいて、下流ノードが変数内のデータを正しく処理し、期待される結果を出力しているかを確認します。
|
||||
|
||||
詳しい使用方法については、変数チェックを参照してください。
|
||||
|
||||

|
||||
|
||||
### ノードの実行記録の確認
|
||||
|
||||
ノードを実行すると、詳細な実行記録が生成され、開発者の問題解決をサポートします。ノードの詳細ページの「前回の実行」をクリックすると、入力パラメータ、出力結果、実行時間、エラー情報などの実行ログを確認できます。詳細については[デバッグ履歴 - ノード実行記録](/ja-jp/guides/workflow/debug-and-preview/history-and-logs#アプリケーション実行履歴)を参照してください。
|
||||
|
||||

|
||||
|
||||
### 全体フローのデバッグ
|
||||
|
||||
すべてのノードのデバッグが完了したら、次にワークフロー全体を実行してエンドツーエンドの実行効果を検証します。
|
||||
|
||||
プレビュー機能を使用してアプリケーションの最終ユーザーインターフェースを体験できます。このモードでは、入力フィールド、出力表示、インタラクションプロセスなどが完全に表示され、主にユーザー体験が期待通りかを検証するために使用されます。システムはプレビュー時に自動チェックを行い、すべてのノードが正しく設定され、接続が完全であることを確認します。
|
||||
|
||||

|
||||
|
||||
#### チェックリスト
|
||||
|
||||
システムはワークフロー設定を自動的にチェックし、ノード接続エラーや必須パラメータの欠落などの問題が見つかった場合、画面右上に通知を表示します。すべての問題を解決した後にのみアプリケーションを実行できます。
|
||||
|
||||

|
||||
|
||||
ワークフローを実行する際には、右側のパネルで各ノードの実行状態(入力パラメータ、出力結果、実行ログを含む)を確認できます。ノード上のステータスインジケーター(緑色は成功を示す)を通じて、フローがどのノードで異常が発生して中断したかを素早く識別できます。
|
||||
|
||||
正式リリース前に複数回のテストを行い、異なる種類や複雑さのデータを使用してワークフローの安定性を検証することをお勧めします。
|
||||
|
||||

|
||||
|
||||
## アプリケーションの実行ログの確認
|
||||
|
||||
アプリケーションを公開した後、開発者はログとモニタリング機能を通じて、ユーザーがアプリケーションを使用した際の対話記録やパフォーマンスデータを確認できます。この履歴記録は、ユーザーの行動パスの確認、アプリケーションのパフォーマンス変化の分析、問題の原因の振り返りに役立ちます。
|
||||
|
||||

|
||||
|
||||
詳細については以下のドキュメントを参照してください:
|
||||
|
||||
- [実行履歴とログ](/ja-jp/guides/workflow/debug-and-preview/history-and-logs)
|
||||
- [モニタリング](/ja-jp/guides/monitoring/README)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/preview-and-run.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20ew-and-&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fpreview-and-run.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
@@ -2,14 +2,87 @@
|
||||
title: ステップ実行
|
||||
---
|
||||
|
||||
ワークフローやチャットフローアプリケーションは通常、複数のノードで構成され、それぞれのノードは相互に関連しています。アプリ全体が正常に動作するためには、各ノードの入出力が期待通りであることを確認する必要があります。
|
||||
|
||||
ワークフローはノードのステップの実行をサポートしており、ステップを実行中に現在のノードの実行が期待通りかどうかを繰り返しテストすることができます。
|
||||
ノードデバッグ機能は、開発者がアプリケーションが設計通りに機能しているかを検証し、潜在的な問題を早期に発見して解決し、本番環境でのエラーを防ぐのに役立ちます。
|
||||
|
||||

|
||||
ノードのデバッグには、単一ステップデバッグと段階的実行の2つの方法があります。
|
||||
|
||||
ステップテスト実行後、実行ステータス、入力/出力、メタデータ情報を確認することができます。
|
||||
## 単一ステップデバッグ
|
||||
|
||||

|
||||
### 方法の概要
|
||||
|
||||
単一ステップデバッグを使用すると、ワークフロー内の特定のノードを独立してテストすることができます。これにより、開発者はアプリケーションに新しいノードを追加する際にその機能を検証したり、特定のノードのエラーを診断したり、異なる入力に対するノードの応答をテストしたりすることができます。
|
||||
|
||||
### 操作手順
|
||||
|
||||
1. ワークフローの編集画面でデバッグしたいノードを選択する
|
||||
2. ノードの設定ページで入力変数を入力する
|
||||
3. 実行ボタンをクリックしてノードを実行する
|
||||
4. ノードの出力結果と実行状態を確認する
|
||||
|
||||
### 例
|
||||
|
||||
ワークフロー内にHTTPノードを追加した場合、そのノードがAPIレスポンスを正しく取得して処理できるかを検証するために、単一ステップデバッグ機能を使用してノードの実際の動作状態をシミュレートし、下流ノードにデータが正しく渡されることを確認できます。
|
||||
|
||||

|
||||
|
||||
デバッグが完了したら、「最終実行」ページで現在のノードの実行状態、入出力、メタデータ情報を確認できます。エラーが発生した場合は、エラーメッセージを通じて問題を迅速に診断し、単一ノードの異常が全体の実行失敗につながるのを防ぐことができます。
|
||||
|
||||
<Warning>
|
||||
応答ノードと終了ノードは単一ステップデバッグをサポートしていません。
|
||||
</Warning>
|
||||
|
||||
## 段階的実行
|
||||
|
||||
### 方法の概要
|
||||
|
||||
ワークフローの運用は、データが一つのノードから次のノードへ正しく流れることに依存しています。ワークフローが複雑な場合、このプロセスはエラーが発生しやすく、よくある問題には以下のようなものがあります:
|
||||
|
||||
- データ形式の不一致(例:テキストが数値を必要とするノードに渡される)
|
||||
- 変数の設定ミス
|
||||
- JSONデータの解析失敗
|
||||
- 変数パスの参照エラー
|
||||
|
||||
段階的実行によるノードデバッグ方法は、開発者が複雑なワークフローアプリケーション内でエラーを素早く特定するのに役立ちます。
|
||||
|
||||
ノードをデバッグしているとき、ノードの出力変数は[変数検査](/ja/guides/workflow/debug-and-preview/variable-inspect)にキャッシュされます。開発者は「変数検査」内で直接変数を修正し、上流変数内のデータを迅速に変更して、異なる値が下流ノードに与える影響を確認できます。
|
||||
|
||||
この方法は、相互に依存する複数のノードをテストするのに適しています。
|
||||
|
||||

|
||||
|
||||
ノードを実行すると、システムは自動的に出力データを「変数検査」ビューに保存します。以下の方法で潜在的な問題を排除できます:
|
||||
|
||||
1. **実際のデータを確認する**:ノード出力のデータが期待通りかを比較する
|
||||
2. **テストデータを修正する**:ビュー内で直接変数値を修正し、後続ノードへの影響をテストする
|
||||
3. **データフローを検証する**:データが下流ノードに正しく伝達されることを確認する
|
||||
|
||||
### 操作手順
|
||||
|
||||
1. デバッグモードでアプリケーションを実行する
|
||||
2. アプリケーション下部の「変数検査」をクリックし、変数キャッシュを確認する
|
||||
3. デバッグが必要なノードを特定し、どの変数を参照しているかを確認する
|
||||
4. 「変数検査」内でその変数の値を修正し、ノードを再実行する
|
||||
5. 実行結果を比較する
|
||||
|
||||
### 例
|
||||
|
||||
例えば、次のようなワークフローがあるとします:データ取得(Aノード) → データ処理(Bノード) → 結果表示(Cノード)。
|
||||
|
||||
Bノードの機能はAノードの出力データに完全に依存しており、異なるデータがBノードの実行状況に影響を与えます。
|
||||
|
||||
Aノードを実行した後の出力変数値は「変数検査」に保存されます。開発者は「変数検査」内のデータを修正し、Aノードを手動で再実行することなく、Bノードへの影響を検証できます。
|
||||
|
||||
段階的実行の過程で、局所的なワークフローの実行状況を観察し、結果に基づいてノードの設定、データフロー、処理ロジックをタイムリーに調整し、ワークフローの効率性と正確性を確保できます。
|
||||
|
||||
## ノードの実行記録の確認
|
||||
|
||||
各ノードの実行完了後に操作記録が生成され、ノード詳細ページの「最終実行」をクリックして確認できます。
|
||||
|
||||

|
||||
|
||||
アプリケーション全体の実行履歴を確認する場合は、[実行履歴](/ja/guides/workflow/debug-and-preview/history-and-logs)を参照してください。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
80
ja-jp/guides/workflow/debug-and-preview/variable-inspect.mdx
Normal file
80
ja-jp/guides/workflow/debug-and-preview/variable-inspect.mdx
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: 変数インスペクター
|
||||
---
|
||||
|
||||
**変数インスペクター**は、ワークフローエディターの下部に配置されているパネルです。このパネルは、実行後の各ノードの入力データと出力データをキャッチし、開発者がワークフロー全体のデータフローにおける問題を素早く特定し、検証するのに役立ちます。
|
||||
|
||||
## なぜ重要か
|
||||
|
||||
[変数](/ja-jp/guides/workflow/variables)はノード間の主要な接続点として機能し、動的なフロー制御を可能にします。ワークフローアプリケーションでは、変数はユーザーからの入力だけでなく、各ノードからの出力(LLMの応答、ツールの結果、会話のコンテキスト、環境パラメータなど)を保存します。
|
||||
|
||||
変数インスペクターは、実行後に各ノードの入力パラメータと出力結果を自動的にキャッシュします。以下の主な機能を提供しています:
|
||||
|
||||
- **リアルタイムの変数監視**:ノードが実行された直後にワークフローの入出力を含むすべての変数を捕捉して表示します。
|
||||
- **キャッシュされた変数の編集**:上流のノードを再実行せずに、ほとんどのタイプの変数を手動で変更することができます — 異なるシナリオをテストするのに最適です。
|
||||
- **異常データの追跡**:各変数の実際の値とタイプを表示し、フォーマットの問題や欠落フィールド、型の不一致を特定しやすくします。
|
||||
- **グローバル状態管理**:システム変数、環境変数、カスタム定義されたノード変数を含むすべての変数を1つのパネルに表示します。
|
||||
|
||||
変数インスペクターを使用することで、任意のノードから最新の出力変数を簡単に確認・編集でき、変更が下流のノードにどのように影響するかを確認できます。
|
||||
|
||||
## 使用方法
|
||||
|
||||
変数インスペクターはキャンバスの下部に位置し、ワークフローが実行されるとリアルタイムで更新されます。
|
||||
|
||||
ノードが実行されると、その出力変数がパネルに表示され、迅速に検査または編集が可能です。
|
||||
|
||||

|
||||
|
||||
以下は、"外部データベースクエリ"アプリケーションにおける変数インスペクターの使用例です。このワークフローでは、LLMノードが自然言語入力を受け取り、それをSQLに変換し、リモートデータベースにクエリを送信してデータを取得します。
|
||||
|
||||
> [こちら](https://assets-docs.dify.ai/2025/06/ac4da5ed5506f8a34aae7f0b88323f37.yml)をクリックしてDSLワークフローファイルをダウンロードできます。
|
||||
|
||||
### 表示
|
||||
|
||||
ノードが実行されると、その出力変数は自動的に変数インスペクターに表示されます。変数をクリックすると、詳細な内容を確認できます。
|
||||
|
||||

|
||||
|
||||
### 編集
|
||||
|
||||
変数の値をクリックして編集します。更新された値は、次回の実行時に下流のノードで使用されます。
|
||||
|
||||
<Info>
|
||||
ここで変数の値を編集しても、ノードの「最終実行」記録内のキャッシュデータには影響しません。
|
||||
</Info>
|
||||
|
||||
**例:**
|
||||
|
||||
<Steps>
|
||||
<Step title="デフォルト結果">
|
||||
ユーザーが「すべてのユーザーデータを表示」と入力すると、LLMノードが`SELECT * FROM users;`を生成します。データベースはすべてのデータを正しく返します。
|
||||
<img src="https://assets-docs.dify.ai/2025/06/dcf4b0048bf1ed802369ab10731a4848.png" />
|
||||
</Step>
|
||||
<Step title="変数編集後">
|
||||
ユーザーが変数インスペクターでSQLを手動で`SELECT username FROM users;`に変更し、データベースノードのみを再実行します。システムはユーザー名のリストを返します。
|
||||
|
||||
これにより、ワークフロー全体を再起動することなく、下流のデータベースノードだけを再実行して新しいデータをテストすることができます。
|
||||
<img src="https://assets-docs.dify.ai/2025/06/fb8c49fc0c8c63866f1a9379e8752d9e.png" />
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### 元に戻す
|
||||
|
||||
変数編集フィールドの右上にある元に戻すアイコンをクリックすると、変数を元の値に復元できます。
|
||||
|
||||

|
||||
|
||||
### すべての変数をリセット
|
||||
|
||||
左上の**すべてリセット**をクリックすると、キャッシュされたすべての変数を一度にクリアできます。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/variable-inspect.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20ble-insp&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fvariable-inspect.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: プレビューと実行
|
||||
---
|
||||
|
||||
|
||||
Difyワークフローでは、完全な実行とデバッグ機能を提供しています。対話型アプリケーションでは、クリック「プレビュー」でデバッグモードに入ります。
|
||||
|
||||

|
||||
|
||||
ワークフローアプリケーションでは、クリック「実行」でデバッグモードに入ります。
|
||||
|
||||

|
||||
|
||||
デバッグモードに入ると、インターフェースの右側で設定済みのワークフローをデバッグできます。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/debug-and-preview/yu-lan-yu-yun-hang.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?title=ドキュメントの問題%3A%20n-yu-yun-h&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fja-jp/guides/workflow/debug-and-preview%2Fyu-lan-yu-yun-hang.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E)
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 141 KiB |
@@ -33,7 +33,7 @@ title: 创建步骤
|
||||
|
||||
#### ETL
|
||||
|
||||
在 RAG 的生产级应用中,为了获得更好的数据召回效果,需要对多源数据进行预处理和清洗,即 ETL (_extract, transform, load_)。为了增强非结构化/半结构化数据的预处理能力,Dify 支持了可选的 ETL 方案:**Dify ETL** 和[**Unstructured ETL**](https://docs.unstructured.io/welcome)[**Unstructured ETL** ](https://unstructured.io/)。Unstructured 能够高效地提取并转换你的数据为干净的数据用于后续的步骤。Dify 各版本的 ETL 方案选择:
|
||||
在 RAG 的生产级应用中,为了获得更好的数据召回效果,需要对多源数据进行预处理和清洗,即 ETL (_extract, transform, load_)。为了增强非结构化/半结构化数据的预处理能力,Dify 支持了可选的 ETL 方案:**Dify ETL** 和[**Unstructured ETL**](https://docs.unstructured.io/welcome)。Unstructured 能够高效地提取并转换你的数据为干净的数据用于后续的步骤。Dify 各版本的 ETL 方案选择:
|
||||
|
||||
* SaaS 版不可选,默认使用 Unstructured ETL;
|
||||
* 社区版可选,默认使用 Dify ETL ,可通过[环境变量](/zh-hans/getting-started/install-self-hosted/environments)开启 Unstructured ETL;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: 检查清单
|
||||
---
|
||||
|
||||
在进入调试运行之前,你可以在检查清单内检查是否有未完成配置或者未连线的节点。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/checklist.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20l&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Fchecklist.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
69
zh-hans/guides/workflow/debug-and-preview/debug-node.mdx
Normal file
69
zh-hans/guides/workflow/debug-and-preview/debug-node.mdx
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: 调试节点
|
||||
---
|
||||
|
||||
Workflow / Chatflow 类型应用通常包含多个节点,每个节点互有关联。若要确保应用整体运行正常,需要确认每个节点的输入输出符合预期。调试节点功能可以帮助开发者检测应用是否按照设计预期提供服务,提前发现并解决潜在问题,避免在生产环境中出现错误。
|
||||
|
||||
你可以通过以下两种模式调试节点。
|
||||
|
||||
## 单步调试
|
||||
|
||||
单步调试允许你对工作流内的特定节点进行独立测试,无需执行整个工作流。它可以帮助开发者在应用内添加新节点时验证其功能、排查特定节点的错误以及测试节点对不同输入的响应。
|
||||
|
||||
### 操作步骤
|
||||
|
||||
1. 在工作流编辑界面选择需要调试的节点
|
||||
2. 点击节点右上角的 **run step** 按钮
|
||||
3. 在弹出的调试面板中填写该节点的输入变量
|
||||
4. 点击执行按钮触发节点运行
|
||||
5. 查看节点的输出结果及运行状态
|
||||
|
||||
例如,在工作流内添加了一个 HTTP 节点,为验证该节点能否正确获取并处理 API 响应,你可以使用单步调试功能模拟节点的实际工作状态,而不会影响下游节点。
|
||||
|
||||

|
||||
|
||||
调试完成后,你可以看到当前节点的运行状态、输入/输出、元数据信息。如遇报错,可通过报错信息快速排查错误,避免节点异常导致的应用整体运行失败。
|
||||
|
||||
<Warning>
|
||||
回答、结束节点不支持单步调试。
|
||||
</Warning>
|
||||
|
||||
## 逐步执行
|
||||
|
||||
逐步执行适用于测试多个相互依赖的节点组合,特别是当节点的输入依赖于上游节点的输出时。与单步调试不同,逐步执行会从起始节点开始,按照工作流路径依次执行到指定节点。
|
||||
|
||||
### 操作步骤
|
||||
|
||||
1. 在工作流编辑界面选择需要作为终点的目标节点
|
||||
2. 点击该节点右上角的 **run to** 按钮激活逐步执行功能
|
||||
3. 系统将从起始节点开始,按照工作流路径依次执行至目标节点
|
||||
4. 执行完成后,可查看每个节点的运行状态和输出结果
|
||||
|
||||
假设你有一个包含数据获取(A节点)→数据处理(B节点)→结果展示(C节点)的工作流,B节点的功能完全依赖于A节点的输出。使用逐步执行功能,你可以选择B节点并点击"run to",系统将先执行A节点再执行B节点,让你能够验证两个节点之间的数据传递是否正常。
|
||||
|
||||
逐步执行过程中,你可以观察局部工作流的运行情况,基于结果及时调整节点的配置、数据流向和处理逻辑,确保工作流的效率和准确性。
|
||||
|
||||

|
||||
|
||||
<Warning>
|
||||
对于问题分类节点、条件节点等存在多分支处理情况,不支持逐步执行功能。
|
||||
</Warning>
|
||||
|
||||
## 查看节点运行记录
|
||||
|
||||
每个节点运行完成后都会生成操作日志,你可以点击节点详情页中的 Last run 查看运行历史。
|
||||
|
||||

|
||||
|
||||
如需查看应用整体的运行历史,详细说明请参考[运行历史](/zh-hans/guides/workflow/debug-and-preview/history-and-logs)。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/debug-node.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20-n&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Fdebug-node.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: 调试历史
|
||||
---
|
||||
|
||||
调试 Chatflow / Workflow 应用时将生成详细的历史记录,包括整个应用的执行日志和应用内各个节点的运行详情。开发者可以查看不同维度的历史记录以快速定位问题、分析应用的性能表现并优化工作流配置。
|
||||
|
||||
<Info>
|
||||
如需查看发布应用后用户所产生的应用使用记录,请参考[日志与标注](/zh-hans/guides/annotation/logs)。
|
||||
</Info>
|
||||
|
||||
应用的运行记录分为以下两个维度。
|
||||
|
||||
## 应用调试历史
|
||||
|
||||
运行应用后将产生**运行历史(Run History)**,每次运行节点时将产生一次版本记录。每个版本包含当前应用的**对话记录(Conversation Log)**,以及当前版本记录内各个节点的**追踪日志(TRACING)**。这些记录按时间顺序排列,显示应用内每次对话交互的基本信息,包括运行时间、执行状态、输入输出参数概要等。你可以通过该列表快速找到过往的应用运行详情。
|
||||
|
||||

|
||||
|
||||
点击任意一条运行记录查看该次执行的详细信息。每次版本运行包含三个主要部分:
|
||||
|
||||
### 运行结果(RESULT)
|
||||
|
||||
<Warning>
|
||||
运行结果仅面向 Workflow 应用类型。
|
||||
</Warning>
|
||||
|
||||
显示工作流的最终输出结果,即用户最终看到的内容。如果工作流执行失败,此处会显示错误信息和失败原因。
|
||||
|
||||

|
||||
|
||||
### 运行详情(DETAIL)
|
||||
|
||||
包含每次应用运行/对话时的完整输入参数、系统元数据和配置信息。你可以在这里查看:
|
||||
|
||||
- 用户输入的原始数据
|
||||
- 工作流应用的输出数据
|
||||
- 系统自动生成的元数据
|
||||
|
||||

|
||||
|
||||
### 追踪(TRACING)
|
||||
|
||||
在这个视图内你可以查看以下信息:
|
||||
|
||||
- **节点执行顺序**:工作流中各个节点的实际执行顺序。
|
||||
- **数据流转过程**:数据在节点间的传递和转换情况。你也可以通过[变量检查](/zh-hans/guides/workflow/debug-and-preview/variable-inspect)进行查看。
|
||||
- **执行时间分析**:每个节点的运行时长,帮助识别性能瓶颈。
|
||||
- **资源消耗统计**:Token 使用量、API 调用次数等成本信息。
|
||||
- **错误定位**:快速找到执行失败的具体节点和原因。
|
||||
|
||||

|
||||
|
||||
通过节点追踪视图,你可以深入了解工作流的内部运行机制,这对于调试复杂工作流和优化性能表现非常有价值。特别是当工作流包含多个分支或循环逻辑时,追踪视图能够清晰地展示实际的执行路径。
|
||||
|
||||
## 节点运行记录
|
||||
|
||||
除了查看应用整体的运行历史,你还可以在工作流编辑界面中查看单个节点在最后一次调试过程时产生的记录。点击任意节点内节点配置面板中的 **上次运行**,查看节点的输入输出记录。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/history-and-logs.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20ry-and-l&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Fhistory-and-logs.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: 运行历史
|
||||
---
|
||||
|
||||
在「运行历史」中可以查看当前工作流历史调试的运行结果和日志信息。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/history.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Fhistory.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: 对话/运行日志
|
||||
---
|
||||
|
||||
点击「查看日志—详情」可以在详情中查看运行总览信息、输入/输出 、元数据信息等。
|
||||
|
||||

|
||||
|
||||
点击「查看日志-追踪」可以查看工作流完整运行过程各节点的输入/输出、Token 消耗、运行时长等。
|
||||
|
||||

|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/log.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Flog.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
@@ -1,18 +1,69 @@
|
||||
---
|
||||
title: 预览与运行
|
||||
title: 功能简介
|
||||
---
|
||||
|
||||
Dify Workflow 提供了一套完整的运行调试功能,在对话型应用中点击「预览」进入调试模式。
|
||||
创建工作流后,开发者可在发布应用前调试应用以确保各个节点正常运行、验证变量内的数据是否能够正确流转。Dify 提供了完整的调试工具,帮助你快速定位问题、检查变量传递和查看详细日志。
|
||||
|
||||

|
||||
本文介绍工作流应用调试的完整流程,包括单节点调试、变量检查、运行历史查看以及整体测试方法。
|
||||
|
||||
在工作流应用中点击「运行」进入调试模式。
|
||||

|
||||
|
||||

|
||||
## 调试工作流应用
|
||||
|
||||
进入调试模式内在界面右侧调试已配置好的工作流。
|
||||
### 单节点调试
|
||||
|
||||

|
||||
当工作流中某个节点出现问题导致工作流应用无法正常运行时,单独调试该节点以快速定位问题。
|
||||
|
||||
点击节点右上角的调试按钮,输入测试数据并查看输出结果。在调试过程中,建议从简单的测试数据开始,逐步增加数据复杂度,确保节点在各种输入情况下都能正常工作。
|
||||
|
||||
关于详细的单节点调试方法,请参考[调试节点](/zh-hans/guides/workflow/debug-and-preview/step-run)。
|
||||
|
||||

|
||||
|
||||
### 逐步调试节点
|
||||
|
||||
逐步调试节点指的是基于上游节点的变量,检查下游节点是否正确处理变量内的数据并输出预期处理结果。
|
||||
|
||||
详细使用方法请参考[变量检查](/zh-hans/guides/workflow/debug-and-preview/variable-inspect)。
|
||||
|
||||

|
||||
|
||||
### 查看节点运行记录
|
||||
|
||||
执行节点后将生成详细的运行记录,帮助开发者排查问题。点击节点详情页中的“上次运行”查看执行日志,包括输入参数、输出结果、执行时间和错误信息。详细说明请参考[调试历史 - 节点运行记录](/zh-hans/guides/workflow/debug-and-preview/history-and-logs#节点运行记录)。
|
||||
|
||||

|
||||
|
||||
### 调试整体流程
|
||||
|
||||
完成所有节点的调试工作后,接下来运行整个工作流来验证端到端的执行效果。
|
||||
|
||||
使用预览功能体验应用的最终用户界面,该模式将完整展示包括输入框、输出展示和交互流程。主要用于验证用户体验是否符合预期。系统在预览时会进行自动检查,确保所有节点配置正确且连接完整。
|
||||
|
||||

|
||||
|
||||
#### 检查清单
|
||||
|
||||
系统会自动检查工作流配置,如果发现节点连接错误、必填参数缺失等问题,会在界面右上角进行提示,解决所有问题后方可运行应用。
|
||||
|
||||

|
||||
|
||||
运行工作流时,在右侧面板查看每个节点的执行状态,包括输入参数、输出结果和执行日志。通过节点上的状态指示器(绿色表示成功)快速识别流程在哪个节点处异常而造成中断。
|
||||
|
||||
建议在正式发布前进行多轮测试,使用不同类型和复杂度的数据来验证工作流的稳定性。
|
||||
|
||||

|
||||
|
||||
## 查看应用的运行日志
|
||||
|
||||
发布应用后,开发者可以通过应用的**日志和监测功能**查看用户使用该应用的对话记录和性能数据。这些历史记录有助于查看用户的行为路径、分析应用性能变化和复盘问题原因。
|
||||
|
||||

|
||||
|
||||
详细说明请参考以下文档:
|
||||
|
||||
- [运行历史](/zh-hans/guides/workflow/debug-and-preview/history-and-logs)
|
||||
- [监测](/zh-hans/guides/monitoring/README)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
@@ -1,14 +1,88 @@
|
||||
---
|
||||
title: 单步调试
|
||||
title: 调试节点
|
||||
---
|
||||
|
||||
工作流支持节点的单步调试,在单步调试中你可以重复测试当前节点的执行是否符合预期。
|
||||
Workflow / Chatflow 类型应用通常包含多个节点,每个节点互有关联。若要确保应用整体运行正常,需要确认每个节点的输入输出符合预期。
|
||||
|
||||

|
||||
调试节点功能可以帮助开发者检测应用是否按照设计预期提供服务,提前发现并解决潜在问题,避免在生产环境中出现错误。
|
||||
|
||||
单步测试运行后可以查看运行状态、输入/输出、元数据信息。
|
||||
调试节点分为单步调试和逐步执行两种方法。
|
||||
|
||||

|
||||
## 单步调试
|
||||
|
||||
### 方法简介
|
||||
|
||||
单步调试允许你对工作流内的特定节点进行独立测试,无需执行整个工作流。它可以帮助开发者在应用内添加新节点时验证其功能、排查特定节点的错误以及测试节点对不同输入的响应。
|
||||
|
||||
### 操作步骤
|
||||
|
||||
1. 在工作流编辑界面选择需要调试的节点
|
||||
2. 在节点的设置页内填写输入变量
|
||||
3. 点击执行按钮触发节点运行
|
||||
4. 查看节点的输出结果及运行状态
|
||||
|
||||
### 示例
|
||||
|
||||
在工作流内添加 HTTP 节点,为验证该节点能否正确获取并处理 API 响应,你可以使用单步调试功能模拟节点的实际工作状态,确保能够正确向下游节点传递数据。
|
||||
|
||||

|
||||
|
||||
调试完成后,你可以“上次运行”页查看当前节点的运行状态、查看输入/输出、元数据信息。如遇报错,可通过报错信息快速排查错误,避免单个节点运行异常而导致整体运行失败。
|
||||
|
||||
<Warning>
|
||||
回答、结束节点不支持单步调试。
|
||||
</Warning>
|
||||
|
||||
## 逐步执行
|
||||
|
||||
### 方法简介
|
||||
|
||||
工作流的运行依赖于数据能够正确地从一个节点流转到下一个节点。若工作流较为复杂,该过程容易出错,常见问题包括:
|
||||
|
||||
- 数据格式不匹配(如文本传给了需要数字的节点)
|
||||
- 变量配置错误
|
||||
- JSON 数据解析失败
|
||||
- 变量路径引用错误
|
||||
|
||||
逐步执行节点的调试方法能够帮助开发者在复杂的工作流应用内快速排查错误。
|
||||
|
||||
调试节点时,节点的输出变量将会被缓存至[变量检查](/zh-hans/guides/workflow/debug-and-preview/variable-inspect)内。开发者可以直接在“变量检查”内修改变量,快速修改上游变量内的数据,验证不同数值对于下游节点的影响,
|
||||
|
||||
该方法适用于测试多个相互依赖的节点组合。
|
||||
|
||||

|
||||
|
||||
运行节点后,系统会自动将输出数据保存到"变量检查"视图中。你可以使用以下方法排除潜在问题:
|
||||
|
||||
1. **查看实际数据**:对比节点输出的数据是否符合预期
|
||||
2. **修改测试数据**:直接在视图内修改变量值,测试对后续节点的影响
|
||||
3. **验证数据流转**:确认数据能正确传递到下游节点
|
||||
|
||||
### 操作步骤
|
||||
|
||||
1. 在调试模式中运行应用
|
||||
2. 点击应用底部的变量检查,查看变量缓存
|
||||
3. 定位需要调试的节点,查看它引用了哪个变量
|
||||
4. 在变量检查内修改该变量的值,重新运行节点
|
||||
5. 比对运行效果
|
||||
|
||||
### 示例
|
||||
|
||||
假设存在一个工作流:数据获取(A 节点) → 数据处理(B 节点) → 结果展示(C 节点)。
|
||||
|
||||
B 节点的功能完全依赖于 A 节点的输出数据,并且不同的数据将影响 B 节点的运行情况。
|
||||
|
||||
运行 A 节点后的输出变量值将保存至“变量检查”内。开发者可以修改“变量检查”内的数据,验证对于 B 节点的影响而无需手动再次运行 A 节点。
|
||||
|
||||
逐步执行过程中,你可以观察局部工作流的运行情况,基于结果及时调整节点的配置、数据流向和处理逻辑,确保工作流的效率和准确性。
|
||||
|
||||
## 查看节点运行记录
|
||||
|
||||
每个节点运行完成后都会生成操作记录,点击节点详情页中的 Last run 进行查看。
|
||||
|
||||

|
||||
|
||||
如需查看应用整体的运行历史,详细说明请参考[运行历史](/zh-hans/guides/workflow/debug-and-preview/history-and-logs)。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
title: 变量检查
|
||||
---
|
||||
|
||||
变量检查(Variable Inspect)是一个位于工作流应用底部的看板,记录各个节点在执行任务后的输入输出数据,帮助开发者快速定位问题和验证数据流转。
|
||||
|
||||
## 功能价值
|
||||
|
||||
[变量](/zh-hans/guides/workflow/variables)是连接节点之间的重要桥梁,也是实现动态流程控制的基础。在工作流应用中,变量记录了用户输入的数据,以及各节点内的输出数据,例如大模型输出,工具调用结果、对话历史上下文及环境配置参数等。
|
||||
|
||||
变量检查视图将在节点运行后,自动缓存每个节点所接受的输入参数,以及执行任务后各节点输出变量内的数据。提供以下核心功能:
|
||||
|
||||
- **实时变量监控**:自动捕获并显示节点执行后产生的所有变量值,记录工作流的输入和输出数据。
|
||||
- **缓存变量值编辑**:允许开发者手动修改大多数类型变量的值,而无需重新运行上游节点,便于模拟不同场景。
|
||||
- **异常数据追踪**:展示变量的实际值及其类型,便于识别格式不符、缺字段、类型错误等问题。
|
||||
- **全局状态管理**:在单一界面集中展示变量信息,包括系统变量、环境变量和节点内的自定义变量等。
|
||||
|
||||
通过变量检查,开发者可以直观地观察上次运行时各个节点的输出变量,同时可以在其中直接进行修改,观察新数据对于后续节点的影响,更快地定位问题并验证数据,提升应用的调试效率。
|
||||
|
||||
## 使用方法
|
||||
|
||||
变量检查位于画布底部,随着工作流运行实时更新变量值。
|
||||
|
||||
当某个节点运行后,其输出变量将自动出现在变量检查中,便于开发者查找。该功能可以帮助开发者管理当前工作流应用内所涉及的所有变量所对应的数据,它展示工作流中所有已创建变量及其当前值。
|
||||
|
||||

|
||||
|
||||
下文将以一个“查询外部数据库”应用作为案例,演示变量视图的操作方法。该应用的流程是查询外部数据库的应用。LLM 节点在接受自然语言后,自动转译为 SQL 语法,向外部数据库发送请求并接受数据。
|
||||
|
||||
> 点击[此处](https://assets-docs.dify.ai/2025/06/ac4da5ed5506f8a34aae7f0b88323f37.yml)下载 DSL 应用文件。
|
||||
|
||||
### 查看
|
||||
|
||||
节点运行后,输出变量会自动显示在变量检查视图内,点击变量查看详细内容。
|
||||
|
||||

|
||||
|
||||
### 编辑
|
||||
|
||||
点击变量值修改内容。修改后,下游节点可以使用新的变量值。
|
||||
|
||||
<Info>
|
||||
编辑变量值后,不影响当前节点在“上次运行”内已有的存储记录。
|
||||
</Info>
|
||||
|
||||
**用法示例:**
|
||||
|
||||
<Steps>
|
||||
<Step title="默认运行结果">
|
||||
用户输入“查询所有用户数据”命令,LLM 节点自动生成了 `SELECT * FROM users;` 命令,数据库正确返回了所有数据。
|
||||
<img src="https://assets-docs.dify.ai/2025/06/dcf4b0048bf1ed802369ab10731a4848.png" />
|
||||
</Step>
|
||||
<Step title="修改变量值后的结果">
|
||||
用户在变量面板中手动将 SQL 修改为 `SELECT username FROM users;`,随后仅重新运行数据库节点,系统将返回用户名列表。
|
||||
|
||||
手动修改变量值后,手动运行下游的数据库节点即可重新查询新的数据,而无需重新运行整个工作流。
|
||||
<img src="https://assets-docs.dify.ai/2025/06/fb8c49fc0c8c63866f1a9379e8752d9e.png" />
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### 回退
|
||||
|
||||
点击编辑框右上角的回退按钮,恢复该变量的原始值。
|
||||
|
||||

|
||||
|
||||
### 重置所有变量
|
||||
|
||||
点击左上角 Reset all 按钮,清空所有变量缓存。
|
||||
|
||||
{/*
|
||||
|
||||
支持展示的变量类型
|
||||
|
||||
以下变量类型将会在变量视图内进行展示,且部分变量允许被编辑。
|
||||
|
||||
| 变量类别 | 示例变量 | 描述 |
|
||||
|---------|---------|------|
|
||||
| **系统变量** | sys.query, sys.user_id, sys.conversation_id | 系统提供的当前会话信息 |
|
||||
| **环境变量** | OPENAI_KEY, SECRET | 系统环境配置 |
|
||||
| **自定义变量** | [用户定义名称], 文件变量 | 用户在开始节点中自定义的输入变量,上传的文件变量 |
|
||||
| **节点输出变量** | output, structured_output, usage, loop_variable, iteration_variable | 各节点的输出结果 |
|
||||
|
||||
*/}
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/workflow/debug-and-preview/variable-inspect.mdx) | [提交问题](https://github.com/langgenius/dify-docs/issues/new?title=文档问题%3A%20ble-insp&body=%23%23%20问题描述%0A%3C%21--%20请简要描述您发现的问题%20--%3E%0A%0A%23%23%20页面链接%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs%2Fblob%2Fmain%2Fzh-hans/guides/workflow/debug-and-preview%2Fvariable-inspect.mdx%0A%0A%23%23%20建议修改%0A%3C%21--%20如果有具体的修改建议,请在此说明%20--%3E%0A%0A%3C%21--%20感谢您对文档质量的关注!%20--%3E)
|
||||
|
||||
@@ -10,7 +10,7 @@ title: 异常处理
|
||||
|
||||
开发者无需在节点内编排复杂的逻辑代码或额外的节点应对错误情况。异常处理机制将简化工作流的设计复杂度,以多样的预设策略编排工作流的执行逻辑。
|
||||
|
||||
### 应用场景
|
||||
## 应用场景
|
||||
|
||||
**1. 网络异常处理**
|
||||
|
||||
@@ -24,7 +24,7 @@ title: 异常处理
|
||||
|
||||
示例:运行工作流时可能会遇到某个节点返回模糊的错误信息(例如简单的“调用失败”),难以快速定位问题。开发者可以通过异常处理机制内编写预定义报错信息,为后续的应用调试提供更加清晰、准确的错误信息。
|
||||
|
||||
### 异常处理机制
|
||||
## 异常处理机制
|
||||
|
||||
以下四个类型的节点新增异常处理机制,点击标题即可阅读详细文档:
|
||||
|
||||
@@ -55,9 +55,9 @@ title: 异常处理
|
||||
|
||||

|
||||
|
||||
### 快速开始
|
||||
## 快速开始
|
||||
|
||||
#### 场景:为工作流应用添加应对错误输出代码的处理机制
|
||||
### 场景:为工作流应用添加应对错误输出代码的处理机制
|
||||
|
||||
下文将以一个简单的示例应用,演示如何在工作流应用内增设异常处理机制,以备用分支应对节点异常。
|
||||
|
||||
@@ -65,45 +65,47 @@ title: 异常处理
|
||||
|
||||
**应用逻辑**: LLM 节点根据输入的指令,生成正确或错误格式的 JSON 代码内容,然后通过 A 代码节点执行代码并输出结果。如果 A 代码节点接收到了错误格式的 JSON 内容,则按照预设的异常处理机制,执行备用路径而继续主流程。
|
||||
|
||||
#### 1. 创建 JSON 代码生成节点
|
||||
<Steps>
|
||||
<Step title="创建 JSON 代码生成节点">
|
||||
新建 Workflow 应用,并添加 LLM 节点和代码节点。通过 Prompt 让 LLM 根据指令生成正确或错误格式的 JSON 内容,然后通过 A 代码节点验证。
|
||||
|
||||
新建 Workflow 应用,并添加 LLM 节点和代码节点。通过 Prompt 让 LLM 根据指令生成正确或错误格式的 JSON 内容,然后通过 A 代码节点验证。
|
||||
**LLM 节点内的 Prompt 参考:**
|
||||
|
||||
**LLM 节点内的 Prompt 参考:**
|
||||
```text
|
||||
You are a teaching assistant. According to the user's requirements, you only output a correct or incorrect sample code in json format.
|
||||
```
|
||||
|
||||
```text
|
||||
You are a teaching assistant. According to the user's requirements, you only output a correct or incorrect sample code in json format.
|
||||
```
|
||||
**代码节点中的 JSON 验证代码:**
|
||||
|
||||
**代码节点中的 JSON 验证代码:**
|
||||
```python
|
||||
def main(json_str: str) -> dict:
|
||||
obj = json.loads(json_str)
|
||||
return {'result': obj}
|
||||
```
|
||||
</Step>
|
||||
|
||||
```python
|
||||
def main(json_str: str) -> dict:
|
||||
obj = json.loads(json_str)
|
||||
return {'result': obj}
|
||||
```
|
||||
<Step title="为 A 代码节点添加异常处理机制">
|
||||
A 代码节点是验证 JSON 内容的节点,如果接收到的 JSON 内容格式错误,需要通过异常处理机制运行备用路径,让下一个 LLM 节点修复错误内容并重新验证 JSON 从而继续主流程。在 A 代码节点的"异常处理"选项卡中,选择"异常分支"并新建 LLM 节点。
|
||||
</Step>
|
||||
|
||||
#### 2. 为 A 代码节点添加异常处理机制
|
||||
<Step title="修正 A 代码节点输出的异常内容">
|
||||
在新的 LLM 节点中,填写 Prompt 并通过变量引用 A 代码节点的异常输出内容,并进行修复。添加 B 代码节点对 JSON 内容进行二次验证。
|
||||
</Step>
|
||||
|
||||
A 代码节点是验证 JSON 内容的节点,如果接收到的 JSON 内容格式错误,需要通过异常处理机制运行备用路径,让下一个 LLM 节点修复错误内容并重新验证 JSON 从而继续主流程。在 A 代码节点的“异常处理”选项卡中,选择“异常分支”并新建 LLM 节点。
|
||||
<Step title="结束">
|
||||
添加变量聚合节点,汇总正确和错误分支的处理结果并输出至结束节点内,完成整体流程。
|
||||
|
||||
#### 3. 修正 A 代码节点输出的异常内容
|
||||
|
||||
在新的 LLM 节点中,填写 Prompt 并通过变量引用 A 代码节点的异常输出内容,并进行修复。添加 B 代码节点对 JSON 内容进行二次验证。
|
||||
|
||||
#### 4. 结束
|
||||
|
||||
添加变量聚合节点,汇总正确和错误分支的处理结果并输出至结束节点内,完成整体流程。
|
||||
|
||||

|
||||

|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
> Demo 应用 DSL 文件[下载地址](https://assets-docs.dify.ai/2024/12/087861aa20e06bb4f8a2bef7e7ae0522.yml)。
|
||||
|
||||
### 状态描述
|
||||
## 状态描述
|
||||
|
||||
状态指的是节点状态与流程状态。清晰的状态说明有助于开发者判断当前工作流应用的运行现状,协助进行问题排查,快速了解信息并做出对应决策。引入异常处理机制后,节点状态和流程存在以下状态:
|
||||
|
||||
#### **节点状态**
|
||||
### **节点状态**
|
||||
|
||||
* **成功**
|
||||
|
||||
@@ -115,7 +117,7 @@ A 代码节点是验证 JSON 内容的节点,如果接收到的 JSON 内容格
|
||||
|
||||
在异常处理机制中启用了**默认值**或**异常分支**选项。节点执行时遇到了错误,但启用异常机制应对错误。
|
||||
|
||||
#### 工作流状态
|
||||
### 工作流状态
|
||||
|
||||
* **成功**
|
||||
|
||||
@@ -127,11 +129,11 @@ A 代码节点是验证 JSON 内容的节点,如果接收到的 JSON 内容格
|
||||
|
||||
节点出现异常,但启用了异常处理机制,整体流程最终运行正常。状态将会被标记为 Partial success。
|
||||
|
||||
### 常见问题
|
||||
## 常见问题
|
||||
|
||||
#### 1. 启用异常处理机制前后的区别是什么?
|
||||
### 1. 启用异常处理机制前后的区别是什么?
|
||||
|
||||
#### **没有错误处理机制时:**
|
||||
**没有错误处理机制时:**
|
||||
|
||||
* **节点错误中断流程**:当 LLM 调用失败、网络出现问题或工具出错时,整个工作流程会立即中断,应用开发者需要手动查找并修复错误后重新运行流程。
|
||||
* **缺乏灵活性**:开发者无法对不同错误类型或节点定义特定的处理逻辑。例如,无法在错误发生时继续后续流程或选择替代路径。
|
||||
@@ -147,7 +149,7 @@ A 代码节点是验证 JSON 内容的节点,如果接收到的 JSON 内容格
|
||||
|
||||
***
|
||||
|
||||
#### 2. 如何调试替代路径的执行情况?
|
||||
### 2. 如何调试替代路径的执行情况?
|
||||
|
||||
你可以通过工作流程的运行日志检查条件判断和路径选择情况。异常分支的运行路线以黄色高亮显示,帮助开发者验证替代路径是否按预期执行。
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ title: 代码执行
|
||||
|
||||
### 结构化数据处理
|
||||
|
||||
在工作流中,经常要面对非结构化的数据处理,如JSON字符串的解析、提取、转换等。最典型的例子就是HTTP节点的数据处理,在常见的API返回结构中,数据可能会被嵌套在多层JSON对象中,而我们需要提取其中的某些字段。代码节点可以帮助你完成这些操作,下面是一个简单的例子,它从HTTP节点返回的JSON字符串中提取了`data.name`字段:
|
||||
在工作流中,经常要面对非结构化的数据处理,如 JSON 字符串的解析、提取、转换等。最典型的例子就是 HTTP 节点的数据处理,在常见的 API 返回结构中,数据可能会被嵌套在多层 JSON 对象中,而我们需要提取其中的某些字段。代码节点可以帮助你完成这些操作,下面是一个简单的例子,它从 HTTP 节点返回的 JSON 字符串中提取了`data.name`字段:
|
||||
|
||||
```python
|
||||
def main(http_response: str) -> dict:
|
||||
|
||||
@@ -178,8 +178,8 @@ Chatflow 类型应用提供以下系统变量:
|
||||
|
||||
## 注意事项
|
||||
|
||||
* 为避免变量名重复,节点命名不可重复
|
||||
* 节点的输出变量一般为固定变量,不可编辑
|
||||
* 为避免变量名重复,节点命名不可重复。
|
||||
* 执行节点后,输出变量内的值将会被保存至[变量检查](/zh-hans/guides/workflow/debug-and-preview/variable-inspect)视图内。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
Reference in New Issue
Block a user