Docs: update step run node

This commit is contained in:
AllenWriter
2025-06-23 15:59:40 +08:00
parent b1b582b3a2
commit 2b855b331d
6 changed files with 295 additions and 36 deletions

View File

@@ -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",

View File

@@ -0,0 +1,69 @@
---
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.
![](https://assets-docs.dify.ai/2025/04/08a885858cfa6e8863faac891a5be319.png)
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.
![](https://assets-docs.dify.ai/2025/06/22856751d278ffad99d0533d2d96e125.png)
### 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
![](https://assets-docs.dify.ai/2025/06/882b783cd843ab666f5bc3c06f78521d.png)
### 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.
![](https://assets-docs.dify.ai/2025/06/9e614ac01b1f6e0aeadda78c91ce93b7.png)
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 nodes config panel to view its most recent execution details, including input/output data.
![](https://assets-docs.dify.ai/2025/06/9c6e57236d85f426a930424863042d7d.png)
{/*
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%20history-and-logs&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)

View File

@@ -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.
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/debug-and-preview/4eda6b3f833f12ae2ce1a23348678f49.png)
{/*
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)

View File

@@ -1,17 +1,73 @@
---
title: Preview and Run
title: Introduction
---
Once youve created a workflow, its 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.
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/debug-and-preview/91379dc42d0d815e52ddad0cc5450a46.png)
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.
![](https://assets-docs.dify.ai/2025/06/8e7933b45a69241a9861a09fa47d5c62.png)
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/debug-and-preview/b92d7536392b1e1f2423d0e3aa113915.png)
## 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/debug-node).
![](https://assets-docs.dify.ai/2025/06/44decb6644b140e46ed2e1e9246f48f7.png)
### 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).
![](https://assets-docs.dify.ai/2025/06/887630764b180a60becb6a4fcee2c622.png)
### 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.
![](https://assets-docs.dify.ai/2025/06/a6011d5966c78a4d1705f2af44ed8af1.png)
### Debugging the Entire Workflow
After youve confirmed that each individual node works as expected, its 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.
![](https://assets-docs.dify.ai/2025/06/de00849b363ec9356e5764b88b4331fb.png)
#### 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.
![](https://assets-docs.dify.ai/2025/06/85bafda1f786549c22404cd5ec711d0f.png)
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.
Its recommended to perform multiple test rounds with varying data types and complexities to verify workflow stability before going live.
![](https://assets-docs.dify.ai/2025/06/c09f788f77b5f8ebdd635ddba66a1b99.png)
## View Application Logs
After publishing your application, you can monitor how its performing and how users interact with it. Difys logs and monitoring tools help you troubleshoot issues, track performance trends, and better understand user behavior.
![](https://assets-docs.dify.ai/2025/06/6dd8e8a7186089a390679b6de4bb97b9.png)
For more information, see:
- [Run History](/en/guides/workflow/debug-and-preview/history)
- [Monitoring](/en/guides/monitoring/README)
{/*
Contributing Section

View File

@@ -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, its 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 applications behavior step by step — helping you avoid errors before publishing.
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/debug-and-preview/36e547165a5088510c99baee4ce42bcd.png)
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
![](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/debug-and-preview/040e1051d33b94d35e4683d3c89691a8.png)
### 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 nodes 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.
![](https://assets-docs.dify.ai/2025/04/376c9de6f92cb7a5f97a6661c5e0e9eb.png)
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 others outputs. Rather than rerunning the entire chain, you can simulate different scenarios quickly by editing cached variables.
![](https://assets-docs.dify.ai/2025/06/f8656d8deeeaefeab0a8d9169f0ed2d3.png)
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.
![](https://assets-docs.dify.ai/2025/04/5ee92e6406979f5101d21865f95a86e5.png)
To view the full workflows execution history, see [Run History](/en/guides/workflow/debug-and-preview/history).
{/*
Contributing Section
@@ -20,4 +93,3 @@ 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/step-run.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%2Fstep-run.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)

View File

@@ -0,0 +1,84 @@
---
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.
![](https://assets-docs.dify.ai/2025/06/38f26d7339f64abfdfb6955b1c34f4ae.png)
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.
![](https://assets-docs.dify.ai/2025/06/94a4741c25204db5fd1281ec475093d9.png)
### Editing
Click a variables 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.
![](https://assets-docs.dify.ai/2025/06/b713290543a0feb95ecab65336e97483.png)
### 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 |
*/}