You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/core/workflow/nodes
xuzijie1995 db91643915 refactor(workflow): Rearchitect stream dependency logic for complex graphs
This commit addresses a critical issue where streaming output would fail in workflows with complex topologies, particularly those involving multiple conditional branches (if/else) that converge on a common node before the LLM and Answer nodes.

The root cause was twofold:
1. A bug in the branch pruning logic () that would incorrectly remove shared downstream nodes, leading to a premature emptying of the  list.
2. A flawed static dependency analysis () that could not correctly resolve dependencies for nodes that were part of multiple, mutually exclusive execution paths.

This refactor introduces a new, robust architecture for streaming dependency management based on the principle of "Static Pre-pruning + Dynamic Adjudication":

- **Fix**: The branch pruning logic in  is now non-recursive and conservative. It only prunes the immediate first node of an unreachable branch, preserving the integrity of shared downstream paths and join points.

- **Refactor**: The old static dependency analysis has been completely removed. This includes deleting the  attribute from the  entity and deleting the associated recursive dependency fetching methods (, ).

- **Feat**: A new method, , has been implemented in . This method performs a real-time, backward traversal of the graph from the streaming node, querying the runtime execution state () to dynamically validate if the *actual* dependency path has been successfully completed. This ensures that streaming decisions are based on the ground truth of the current execution, not a flawed static prediction.

- **Doc**: Added comprehensive docstrings and comments to the modified components to explain the new architecture and the rationale behind the changes.
8 months ago
..
agent fix: avoid using node_data.version for judgement tool node version (#22462) 8 months ago
answer refactor(workflow): Rearchitect stream dependency logic for complex graphs 8 months ago
base refactor: decouple Node and NodeData (#22581) 8 months ago
code refactor: decouple Node and NodeData (#22581) 8 months ago
document_extractor refactor: decouple Node and NodeData (#22581) 8 months ago
end refactor: decouple Node and NodeData (#22581) 8 months ago
event fix: delete some dead code using vulture (#20999) 9 months ago
http_request refactor: decouple Node and NodeData (#22581) 8 months ago
if_else refactor: decouple Node and NodeData (#22581) 8 months ago
iteration refactor: decouple Node and NodeData (#22581) 8 months ago
knowledge_retrieval refactor: decouple Node and NodeData (#22581) 8 months ago
list_operator refactor: decouple Node and NodeData (#22581) 8 months ago
llm refactor: decouple Node and NodeData (#22581) 8 months ago
loop refactor: decouple Node and NodeData (#22581) 8 months ago
parameter_extractor refactor: decouple Node and NodeData (#22581) 8 months ago
question_classifier refactor: decouple Node and NodeData (#22581) 8 months ago
start refactor: decouple Node and NodeData (#22581) 8 months ago
template_transform refactor: decouple Node and NodeData (#22581) 8 months ago
tool fix: avoid using node_data.version for judgement tool node version (#22462) 8 months ago
variable_aggregator refactor: decouple Node and NodeData (#22581) 8 months ago
variable_assigner refactor: decouple Node and NodeData (#22581) 8 months ago
__init__.py feat/enhance the multi-modal support (#8818) 1 year ago
enums.py refactor: decouple Node and NodeData (#22581) 8 months ago
node_mapping.py fix: avoid using node_data.version for judgement tool node version (#22462) 8 months ago