Output variable validation fails in code panel for the following nodes #21731

Open
opened 2026-02-21 20:14:03 -05:00 by yindo · 1 comment
Owner

Originally created by @GuangjingYan on GitHub (Jan 18, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Enter the workflow orchestrate panel.
  2. Add a code node and a subsequent node.
  3. Create an invalid output variable in the code settings panel.
  4. Search for this variable in the output node.
  5. Run the app.

Image

✔️ Expected Behavior

  1. Users should not be able to create an output variable with a key that exceeds the valid length.
  2. Output variables in the code settings panel should be consistent with the variable search list in the subsequent node.

Actual Behavior

  1. When user creating an invalid output variable only receives error notification, the invalid variable is created successfully.
  2. Though successfully created and able to run the code, the variable can not be selected in the following nodes.
Originally created by @GuangjingYan on GitHub (Jan 18, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Enter the workflow orchestrate panel. 2. Add a code node and a subsequent node. 3. Create an invalid output variable in the code settings panel. 4. Search for this variable in the output node. 5. Run the app. ![Image](https://github.com/user-attachments/assets/992e4b7c-c66c-44e5-b570-c644417898b1) ### ✔️ Expected Behavior 1. Users should not be able to create an output variable with a key that exceeds the valid length. 2. Output variables in the code settings panel should be consistent with the variable search list in the subsequent node. ### ❌ Actual Behavior 1. When user creating an invalid output variable only receives error notification, the invalid variable is created successfully. 2. Though successfully created and able to run the code, the variable can not be selected in the following nodes.
yindo added the 🐞 bugstale labels 2026-02-21 20:14:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 18, 2026):

Hi @GuangjingYan! I'm Dosu and I’m helping the dify team.

This is a confirmed bug in Dify v1.11.1: output variable validation in the code node panel only shows an error notification for invalid keys (like those exceeding 30 characters), but still allows the variable to be created and persisted. As a result, these invalid variables are not selectable in downstream nodes, leading to workflow inconsistencies. The root cause is that the frontend validation (in OutputVarList and related utilities) does not block state updates for invalid keys, and there is no backend enforcement to prevent these variables from being saved or used downstream. You can see a similar issue and explanation in this thread.

Until a stricter fix is released, the best workaround is to manually ensure all output variable keys are 30 characters or fewer and use only allowed characters. Recent PRs suggest improvements to validation logic are in progress, but there is no direct fix for this specific issue yet. For now, double-check variable names when configuring code nodes to avoid this problem.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 18, 2026): <!-- Greeting --> Hi @GuangjingYan! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This is a confirmed bug in Dify v1.11.1: output variable validation in the code node panel only shows an error notification for invalid keys (like those exceeding 30 characters), but still allows the variable to be created and persisted. As a result, these invalid variables are not selectable in downstream nodes, leading to workflow inconsistencies. The root cause is that the frontend validation (in OutputVarList and related utilities) does not block state updates for invalid keys, and there is no backend enforcement to prevent these variables from being saved or used downstream. You can see a similar issue and explanation in [this thread](https://github.com/langgenius/dify/issues/28134). Until a stricter fix is released, the best workaround is to manually ensure all output variable keys are 30 characters or fewer and use only allowed characters. Recent PRs suggest improvements to validation logic are in progress, but there is no direct fix for this specific issue yet. For now, double-check variable names when configuring code nodes to avoid this problem. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/69923541-f070-4799-96b7-3439bf2fd69b?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20confirmed%20bug%20in%20Dify%20v1.11.1%3A%20output%20variable%20validation%20in%20the%20code%20node%20panel%20only%20shows%20an%20error%20notification%20for%20invalid%20keys%20%28like%20those%20exceeding%2030%20characters%29%2C%20but%20still%20allows%20the%20variable%20to%20be%20created%20and%20persisted.%20As%20a%20result%2C%20these%20invalid%20variables%20are%20not%20selectable%20in%20downstream%20nodes%2C%20leading%20to%20workflow%20inconsistencies.%20The%20root%20cause%20is%20that%20the%20frontend%20validation%20%28in%20OutputVarList%20and%20related%20utilities%29%20does%20not%20block%20state%20updates%20for%20invalid%20keys%2C%20and%20there%20is%20no%20backend%20enforcement%20to%20prevent%20these%20variables%20from%20being%20saved%20or%20used%20downstream.%20You%20can%20see%20a%20similar%20issue%20and%20explanation%20in%20%5Bthis%20thread%5D%28https%3A//github.com/langgenius/dify/issues/28134%29.%0A%0AUntil%20a%20stricter%20fix%20is%20released%2C%20the%20best%20workaround%20is%20to%20manually%20ensure%20all%20output%20variable%20keys%20are%2030%20characters%20or%20fewer%20and%20use%20only%20allowed%20characters.%20Recent%20PRs%20suggest%20improvements%20to%20validation%20logic%20are%20in%20progress%2C%20but%20there%20is%20no%20direct%20fix%20for%20this%20specific%20issue%20yet.%20For%20now%2C%20double-check%20variable%20names%20when%20configuring%20code%20nodes%20to%20avoid%20this%20problem.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31169)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21731