+= feature in variable assigner prevents workflow from publishing #7040

Closed
opened 2026-02-21 18:18:33 -05:00 by yindo · 1 comment
Owner

Originally created by @sugoh on GitHub (Dec 4, 2024).

Originally assigned to: @YIXIAO0 on GitHub.

Self Checks

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

Dify version

v0.11.2

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Open a Dify workflow in Studio GUI
  2. Add a conversation variable with type Number and set the default value to 0
  3. Create a Variable Assigner block
  4. In (3), set the operation to +=
  5. Preview the workflow: the conversation variable will increment as expected
  6. Publish the workflow: you will now get an error saying [Variable Assigner] Variable is required
Screenshot 2024-12-04 at 2 25 09 PM Screenshot 2024-12-04 at 2 25 18 PM

✔️ Expected Behavior

Publish the workflow successfully

Actual Behavior

Error saying [Variable Assigner] Variable is required

Originally created by @sugoh on GitHub (Dec 4, 2024). Originally assigned to: @YIXIAO0 on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version v0.11.2 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Open a Dify workflow in Studio GUI 2. Add a conversation variable with type `Number` and set the default value to `0` 3. Create a Variable Assigner block 4. In (3), set the operation to `+=` 5. Preview the workflow: the conversation variable will increment as expected 6. **Publish the workflow: you will now get an error saying [Variable Assigner] Variable is required** <img width="467" alt="Screenshot 2024-12-04 at 2 25 09 PM" src="https://github.com/user-attachments/assets/e52ae829-a40b-42f6-89bc-cce6ccc8c2e3"> <img width="636" alt="Screenshot 2024-12-04 at 2 25 18 PM" src="https://github.com/user-attachments/assets/755927eb-4362-4403-a1b7-18192e67bd4d"> ### ✔️ Expected Behavior Publish the workflow successfully ### ❌ Actual Behavior Error saying [Variable Assigner] Variable is required
yindo added the 🐞 bug label 2026-02-21 18:18:33 -05:00
yindo closed this issue 2026-02-21 18:18:34 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 4, 2024):

The issue you're encountering with the '+= feature' in the 'Variable Assigner' block during the publishing process seems to be related to the validation checks that are performed. The error message "[Variable Assigner] Variable is required" is triggered under specific conditions, such as when the variable_selector is not provided or its length is zero, or when the operation is not WriteMode.clear and the value is not provided or is not a number [1].

In your case, it seems that the workflow is not recognizing the variable correctly during the publishing process, even though it works as expected during the preview. This could be due to a validation check that fails when the workflow is being published.

To resolve this, ensure that all required fields in the 'Variable Assigner' block are correctly set and that the variable is properly defined and accessible. If the issue persists, it might be a bug in the current version of Dify (v0.11.2), and you may need to check for any updates or patches that address this issue.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Dec 4, 2024): <!-- Answer --> The issue you're encountering with the '+= feature' in the 'Variable Assigner' block during the publishing process seems to be related to the validation checks that are performed. The error message "[Variable Assigner] Variable is required" is triggered under specific conditions, such as when the `variable_selector` is not provided or its length is zero, or when the `operation` is not `WriteMode.clear` and the `value` is not provided or is not a number <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/assigner/default.ts)</sup>. In your case, it seems that the workflow is not recognizing the variable correctly during the publishing process, even though it works as expected during the preview. This could be due to a validation check that fails when the workflow is being published. To resolve this, ensure that all required fields in the 'Variable Assigner' block are correctly set and that the variable is properly defined and accessible. If the issue persists, it might be a bug in the current version of Dify (v0.11.2), and you may need to check for any updates or patches that address this issue. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7040