dify icon indicating copy to clipboard operation
dify copied to clipboard

In certain combinations, the workflow's else logic executes the content of that node when a non-hit occurs

Open GolovinElics opened this issue 11 months ago • 1 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

V.0.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When constructing a workflow, when using branch condition components, there are specific combinations where the else logic will always output in the case of a non-hit, resulting in a judgment of true. As a result, the workflow does not reach that node, yet the content of that node gets executed."

✔️ Expected Behavior

In this case, the node information should not be output, and the node is not within the running conditions

iShot_2025-01-08_22 44 00

❌ Actual Behavior

However, in this case, the workflow executed the uncovered nodes and output their content

iShot_2025-01-08_22 42 10

GolovinElics avatar Jan 08 '25 14:01 GolovinElics

Hey there, @GolovinElics! I'm here to help you with bug reports, questions, and becoming a contributor. Let's squash those bugs together! 🤖

In Dify, the 'else' logic in a workflow is expected to execute only when the 'if' condition is not met. However, there is a known issue in Dify v0.14.0 where nodes after parallel branches execute prematurely, which might be related to your issue if parallel branches are involved [1].

For your specific case in v0.15, it seems there might be a bug causing the 'else' logic to execute unexpectedly even when the conditions for its execution are not met. This could be due to a misconfiguration in the conditional logic or a bug in the workflow engine.

To troubleshoot, ensure that the conditions are set correctly and consider using the debugging features in Dify. You can enter debugging mode by clicking "Preview" in conversational applications or "Run" in workflow applications, which might help identify where the logic is failing [2]. If the issue persists, it might be beneficial to report this behavior as a bug if it hasn't been addressed in the latest updates.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

dosubot[bot] avatar Jan 08 '25 14:01 dosubot[bot]

I encountered the same problem.

system-man avatar Jan 10 '25 03:01 system-man

I encountered the same problem. Can it be fixed asap?

Jue4869 avatar Jan 10 '25 05:01 Jue4869

I discovered a new issue during testing today. When my workflow consists of Start -> Conditional Branch -> Image Processing Model/Knowledge Base Query -> Output File/Output Knowledge Base Response, the returned information does not display correctly. The images are using the Flux plugin; they can be downloaded from Dify, but they are not displayed properly. The preview on Dify should show the parsed large text, with the correct format being one large image and one small image. The large image actually represents the display effect, while the small image is intended for file preview mode. iCopy_2025_01_10_17_11_18

GolovinElics avatar Jan 10 '25 09:01 GolovinElics