Commit Graph

6394 Commits (db91643915a226da3d4a31aebb1433906f050eef)
 

Author SHA1 Message Date
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.
9 months ago
xuzijie1995 b13ae784a4 fix(workflow): Resolve streaming failure on conditional join points
Improves the robustness of the workflow engine's streaming output by fixing two core issues that caused streaming to fail in complex topologies where multiple conditional branches merge.

**1. Corrected Runtime State Management ("Pruning"):**

The primary bug was located in the `_remove_unreachable_nodes` method. Its aggressive recursive "pruning" algorithm incorrectly removed shared downstream nodes (including LLM and Answer) when handling conditional branches that led to a join point. This prematurely emptied the `rest_node_ids` list, causing the stream processor to fail its initial state check.

The fix replaces the recursive logic with a more conservative, non-recursive approach that only prunes the immediate first node of an unreachable branch. This ensures the integrity of the `rest_node_ids` list throughout the workflow execution.

**2. Improved Static Dependency Analysis:**

A secondary, underlying issue was found in the static dependency analysis (`_recursive_fetch_answer_dependencies`). It incorrectly identified all upstream, mutually exclusive `If/Else` nodes as parallel dependencies of the Answer node.

The fix enhances this analysis by adding "join point awareness". The upward trace now stops when it encounters a node with more than one incoming edge, correctly identifying the join point itself as the dependency rather than its upstream branches.

Together, these changes ensure that streaming output remains reliable and predictable, even in complex workflows with reusable, multi-input nodes.
9 months ago
Kushagra Singhal 383a79772c
Increased the character limitation (#22679)
Co-authored-by: crazywoola <427733928@qq.com>
9 months ago
Asuka Minato f8c7b28da7
oxlint (#22584) 9 months ago
Bowen Liang 74940ad3f2
chore: code improvement for mcp_client and mcp_tools_manage_service (#22645) 9 months ago
Novice 17a8f1a0f1
fix: avoid using node_data.version for judgement tool node version (#22462)
Co-authored-by: JzoNg <jzongcode@gmail.com>
9 months ago
doskoi f9f46bfcbe
fix(i18n) update Japanese translation for "optional" (#22667) 9 months ago
doskoi bd2014d13b
fix(i18n): "道具" into "ツール" (#22666) 9 months ago
doskoi cb660e8104
fix(i18n): standardize template variable names across all languages {{count}} (#22670) 9 months ago
doskoi a4a67ef1ec
fix(i18n): improve Japanese translations for technical terms "dupulicate" (#22669) 9 months ago
GuanMu 09abc9951d
chore: update pnpm version to 10.13.1 (#22660) 9 months ago
znn 19c09d6111
enabling vector index prefix name via configuration files (#22661) 9 months ago
Jason Young 6248658c04
fix: resolve Redis mock import error in test configuration (#22663) 9 months ago
Jason Young 274142c4c2
test: add comprehensive unit tests for auth service module (#22662) 9 months ago
Aryan Raj ce794335e9
Fix/replace datetime patterns with naive utc now (#22654) 9 months ago
BXbing 5985055aef
Fix: Remove ${basePath} from the <Link> tag's href attribute. (#22636) 9 months ago
Bowen Liang ff8fc96ebb
chore: skip SuperLinter check on .editorconfig when no changes (#22649) 9 months ago
jiangbo721 c70b0cb730
fix(docs): unify workflow_run_id style with other languages (#22642)
Co-authored-by: 刘江波 <jiangbo721@163.com>
9 months ago
Wu Tianwei dba42567b1
fix: restore globals dependency in package.json and pnpm-lock.yaml (#22625) 9 months ago
birkhoff 71d96b671b
feat: update VECTOR_STORE supported types in api/.env.example (#22617)
Co-authored-by: nicksarno <nicksarno@ztm-tech.com>
9 months ago
kurokobo a93db6d797
fix: correct tracing for workflows and chatflows for phoenix (#22547) 9 months ago
Jason Young f2389771cf
test: add comprehensive API key authentication service tests (#22572) 9 months ago
znn ed263aed9f
fix text splitter (#22596) 9 months ago
mudiko d37b6716cd
Fix #22508 (#22590) 9 months ago
Wu Tianwei b035f3f884
feat: convert components to dynamic imports for improved performance (#22614) 9 months ago
-LAN- 1f9cd99bc2
refactor: elegant event dispatch patterns (92% complexity reduction) (#22600)
Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: Claude <noreply@anthropic.com>
9 months ago
jiangbo721 ffee6f3288
fix: admin feedback uses the same method create_feedback (#22580)
Co-authored-by: 刘江波 <jiangbo721@163.com>
9 months ago
-LAN- 460a825ef1
refactor: decouple Node and NodeData (#22581)
Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
9 months ago
github-actions[bot] 54c56f2d05
chore: translate i18n files (#22563)
Co-authored-by: Yeuoly <45712896+Yeuoly@users.noreply.github.com>
9 months ago
kenwoodjw 61a5741c05
fix celery config (#22566)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
9 months ago
KVOJJJin 0e235e5872
Fix valid check of mcp server address (#22510) 9 months ago
kawabata-mcl d0bece1679
fix(docs): correct workflow API parameter name from workflow_id to workflow_run_id (#22587) 9 months ago
-LAN- 1715dd4320
refactor: Fix some type error (#22594)
Signed-off-by: -LAN- <laipz8200@outlook.com>
9 months ago
Asuka Minato 14513b7677
use nolyfill to reduce download size (#22589) 9 months ago
-LAN- b88dd17fc1
feat(workflow_cycle_manager): Removes redundant repository methods and adds caching (#22597)
Signed-off-by: -LAN- <laipz8200@outlook.com>
9 months ago
znn 3826b57424
remove node-info for non mcp (#22595) 9 months ago
hato_code 62586719b3
fix: remove redundant partial member list retrieval in dataset API (#15492) 9 months ago
helojo e7d80bf7bf
Fix: the pict type picture was not processed in the docx (#19305)
Co-authored-by: zqgame <zqgame@zqgame.local>
9 months ago
Kalo Chin 7a69b57823
Fix jinja2 variable naming inconsistencies (#22578) 9 months ago
Asuka Minato 2423f97c72
remove overrides (#22575) 9 months ago
Maries a4ef900916
Support OAuth Integration for Plugin Tools (#22550)
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
9 months ago
NeatGuyCoding 965e952336
minor translation fix: fix translation duplicate and typo, fix date format (#22548) 9 months ago
znn 3cfba9e47b
updating icon (#22485) 9 months ago
Om Kashyap Avashia 4b604bd79a
fix: Python SDK WorkflowClient and KnowledgeBase client imports fixed. Added documentation for WorkflowClient. (#22476)
Co-authored-by: crazywoola <427733928@qq.com>
9 months ago
Jason Young 74caebac32
test: add comprehensive OAuth authentication unit tests (#22528) 9 months ago
NeatGuyCoding fafb1d5fd7
feat: validate email according to RFC 5322 (#22540) 9 months ago
Stream 4b2baeea65
fix: use model provided by user in prompt generator (#22541) (#22542)
Co-authored-by: stream <stream@dify.ai>
9 months ago
NeatGuyCoding 93c27b134d
minor typo fix: remove debug code and fix typo (#22539) 9 months ago
NeatGuyCoding 853c97a910
minor bug fix: wrong default metrics endpoint (#22535) 9 months ago
yasu89 97f080fa03
fix: Japanese dateTimeFormat (#22516)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
9 months ago