Invalid variables not validated
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
0.10.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
When we have two parallel lines, the reference variable of one branch is on the other branch. Since the backend is in the same variable pool and invalid variables can still run, it can still output values, which can lead to unexpected errors.
✔️ Expected Behavior
Cannot debug or run errors.
❌ Actual Behavior
Everything is normal now
Hello @linfey90! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let me know how I can assist you!
I found two similar unsolved discussions that might be relevant to your issue:
-
Error in item: Invalid variable. - This discussion addresses issues with invalid variables, similar to what you're experiencing [1].
-
This is a major issue with parallel execution in the workflow. In version 0.8.0, the issue classifier was treated as a parallel execution branch. - This discussion involves problems with parallel execution, which might relate to your situation with variable references across branches [2].
To ensure that invalid variables are properly validated in a self-hosted environment using Dify version 0.10.1, you can use the validation methods provided in the CodeNode class. The _check_string and _check_number methods are designed to validate string and number variables, respectively, and raise ValueError exceptions if the variables do not meet the specified criteria [3].
To continue talking to Dosu, mention @dosu.
Could you share this DSL? Every node has a unique ID that is used in the backend.
Could you share this DSL? Every node has a unique ID that is used in the backend.
Thank for reply. The variable is fine, it's just not from the current branch. After selecting the variables in the frontend, I switched branches. test.txt
Thank you for the report. This is a known issue; currently, our canvas cannot detect this situation.