From 2b855b331d498c42d7db2ae2aca258deedcf52b3 Mon Sep 17 00:00:00 2001 From: AllenWriter Date: Mon, 23 Jun 2025 15:59:40 +0800 Subject: [PATCH] Docs: update step run node --- docs.json | 5 +- .../debug-and-preview/history-and-logs.mdx | 69 +++++++++++++++ en/guides/workflow/debug-and-preview/log.mdx | 21 ----- .../debug-and-preview/preview-and-run.mdx | 68 +++++++++++++-- .../workflow/debug-and-preview/step-run.mdx | 84 +++++++++++++++++-- .../debug-and-preview/variable-inspect.mdx | 84 +++++++++++++++++++ 6 files changed, 295 insertions(+), 36 deletions(-) create mode 100644 en/guides/workflow/debug-and-preview/history-and-logs.mdx delete mode 100644 en/guides/workflow/debug-and-preview/log.mdx create mode 100644 en/guides/workflow/debug-and-preview/variable-inspect.mdx diff --git a/docs.json b/docs.json index 9917dbff..bce2a953 100644 --- a/docs.json +++ b/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", diff --git a/en/guides/workflow/debug-and-preview/history-and-logs.mdx b/en/guides/workflow/debug-and-preview/history-and-logs.mdx new file mode 100644 index 00000000..769cea56 --- /dev/null +++ b/en/guides/workflow/debug-and-preview/history-and-logs.mdx @@ -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. + + + To explore logs from real users after your application is published, check out [Logs and Annotation](/en/guides/annotation/logs). + + +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 + + + The result section is available only for Workflow applications. + + +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 node’s 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) diff --git a/en/guides/workflow/debug-and-preview/log.mdx b/en/guides/workflow/debug-and-preview/log.mdx deleted file mode 100644 index 639c2f52..00000000 --- a/en/guides/workflow/debug-and-preview/log.mdx +++ /dev/null @@ -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) - diff --git a/en/guides/workflow/debug-and-preview/preview-and-run.mdx b/en/guides/workflow/debug-and-preview/preview-and-run.mdx index 3a565e1e..5d36e453 100644 --- a/en/guides/workflow/debug-and-preview/preview-and-run.mdx +++ b/en/guides/workflow/debug-and-preview/preview-and-run.mdx @@ -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. -![](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 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. + +![](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. + +It’s 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 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. + +![](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 diff --git a/en/guides/workflow/debug-and-preview/step-run.mdx b/en/guides/workflow/debug-and-preview/step-run.mdx index 2d8540ee..51950078 100644 --- a/en/guides/workflow/debug-and-preview/step-run.mdx +++ b/en/guides/workflow/debug-and-preview/step-run.mdx @@ -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. -![](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 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. + +![](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. + + + Answer and End nodes do not support single-step run. + + +## 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. + +![](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 workflow’s 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) - diff --git a/en/guides/workflow/debug-and-preview/variable-inspect.mdx b/en/guides/workflow/debug-and-preview/variable-inspect.mdx new file mode 100644 index 00000000..33acc952 --- /dev/null +++ b/en/guides/workflow/debug-and-preview/variable-inspect.mdx @@ -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 variable’s value to edit it. The updated value will be used by downstream nodes during the next run. + + + Editing variable values here does not affect the cached data in the node's “Last run” record. + + +**Example:** + + + + The user inputs “Show all user data,” and the LLM node generates `SELECT * FROM users;`. The database correctly returns all data. + + + + 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. + + + + +### 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 | + +*/}