mirror of
https://github.com/langgenius/dify.git
synced 2025-06-27 05:30:04 +00:00

This pull request introduces a feature aimed at improving the debugging experience during workflow editing. With the addition of variable persistence, the system will automatically retain the output variables from previously executed nodes. These persisted variables can then be reused when debugging subsequent nodes, eliminating the need for repetitive manual input. By streamlining this aspect of the workflow, the feature minimizes user errors and significantly reduces debugging effort, offering a smoother and more efficient experience. Key highlights of this change: - Automatic persistence of output variables for executed nodes. - Reuse of persisted variables to simplify input steps for nodes requiring them (e.g., `code`, `template`, `variable_assigner`). - Enhanced debugging experience with reduced friction. Closes #19735.
21 lines
643 B
Python
21 lines
643 B
Python
"""All these exceptions are not meant to be caught by callers."""
|
|
|
|
|
|
class WorkflowDataError(Exception):
|
|
"""Base class for all workflow data related exceptions.
|
|
|
|
This should be used to indicate issues with workflow data integrity, such as
|
|
no `graph` configuration, missing `nodes` field in `graph` configuration, or
|
|
similar issues.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
class NodeNotFoundError(WorkflowDataError):
|
|
"""Raised when a node with the specified ID is not found in the workflow."""
|
|
|
|
def __init__(self, node_id: str):
|
|
super().__init__(f"Node with ID '{node_id}' not found in the workflow.")
|
|
self.node_id = node_id
|