Knowledge Base Node Variable Selector Bug #21354

Closed
opened 2026-02-21 20:12:09 -05:00 by yindo · 1 comment
Owner

Originally created by @tcat88511-cmd on GitHub (Dec 29, 2025).

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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Bug Report: Knowledge Base Node Variable Selector Bug

Bug Description

The Knowledge Base node incorrectly includes node titles in variable references when selecting variables from chunker nodes, causing validation failures.

Environment

  • Dify Version: 1.11.2 (also confirmed in 1.9.2)
  • Deployment: Docker
  • Operating System: Windows
  • Browser: Any (backend issue)

Steps to Reproduce

  1. Create a new workflow
  2. Add a Crawl4AI node configured to output markdown
  3. Add a Markdown Chunker node connected to Crawl4AI output
  4. Add a Knowledge Base node
  5. Connect the Markdown Chunker to Knowledge Base
  6. In the Knowledge Base node's "Chunks" field, select the output variable from the Markdown Chunker
  7. Attempt to publish the workflow

Expected Behavior

The Knowledge Base node should:

  • Show only the variable name (e.g., "text", "result", "chunks") in the Chunks field
  • Accept the variable reference and validate successfully
  • Allow the workflow to be published without errors

Actual Behavior

The Knowledge Base node:

  • Shows [Markdown Chunker]variableName in the Chunks field (includes node title)
  • Fails validation with error: "[Markdown Chunker] Invalid variable"
  • Prevents workflow publishing

Technical Details

Database Analysis

The workflow graph stores the variable reference as:

"index_chunk_variable_selector": ["nodeID", "variableName"]

But should store it as:

"index_chunk_variable_selector": ["nodeID.variableName"]

Affected Components

  • Knowledge Base Node: Variable selector UI component
  • Workflow Validation: Backend validation logic
  • Multiple Chunker Types: Affects both General Chunker and Markdown Chunker

Variable Names Tested

  • result - Failed
  • chunks - Failed
  • text - Failed
  • All with same "[NodeName] Invalid variable" error

Workarounds Attempted

  1. Direct Database Modification: Changed from array format to dot notation - Still failed
  2. Multiple Variable Names: Tried different output variable names - Still failed
  3. Different Chunker Nodes: Tried General Chunker vs Markdown Chunker - Same issue
  4. Fresh Workflow Creation: Issue persists in new workflows

Root Cause Analysis

The issue appears to be in the Knowledge Base node's frontend component that:

  1. Correctly displays available variables from connected nodes
  2. Incorrectly prepends the node title to the variable name when selected
  3. Passes the malformed variable reference to validation logic
  4. Validation fails because "[NodeTitle]" is not a valid variable prefix

Impact

  • Severity: High - Blocks knowledge base creation workflows
  • Scope: Affects all workflows using Knowledge Base with chunkers
  • User Experience: Makes Dify unusable for RAG/knowledge base workflows

Suggested Fix

  1. Frontend: Modify Knowledge Base node variable selector to only use variable name
  2. Backend: Update validation to handle the current format gracefully
  3. Database: Ensure consistent variable reference format across all nodes

Additional Context

  • This affects both Docker and standalone deployments
  • Issue persists across multiple Dify versions (1.9.2, 1.11.2)
  • Affects both General Chunker and Markdown Chunker plugins
  • Crawl4AI integration works correctly, issue is in Knowledge Base node

Related Issues

  • Variable reference format inconsistency across Dify node types
  • UI/Backend mismatch in variable handling
  • Plugin compatibility with Knowledge Base node

Attachments

  • Database schema showing index_chunk_variable_selector format
  • Workflow graph JSON examples
  • Error screenshots (if available)

Priority

High - This is a critical functionality blocker for knowledge base workflows, which is a core feature of Dify.

✔️ Expected Behavior

The Knowledge Base node should:

  • Show only the variable name (e.g., "text", "result", "chunks") in the Chunks field
  • Accept the variable reference and validate successfully
  • Allow the workflow to be published without errors

Actual Behavior

The Knowledge Base node:

  • Shows [Markdown Chunker]variableName in the Chunks field (includes node title)
  • Fails validation with error: "[Markdown Chunker] Invalid variable"
  • Prevents workflow publishing
Originally created by @tcat88511-cmd on GitHub (Dec 29, 2025). ### 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce # Bug Report: Knowledge Base Node Variable Selector Bug ## **Bug Description** The Knowledge Base node incorrectly includes node titles in variable references when selecting variables from chunker nodes, causing validation failures. ## **Environment** - **Dify Version**: 1.11.2 (also confirmed in 1.9.2) - **Deployment**: Docker - **Operating System**: Windows - **Browser**: Any (backend issue) ## **Steps to Reproduce** 1. Create a new workflow 2. Add a Crawl4AI node configured to output markdown 3. Add a Markdown Chunker node connected to Crawl4AI output 4. Add a Knowledge Base node 5. Connect the Markdown Chunker to Knowledge Base 6. In the Knowledge Base node's "Chunks" field, select the output variable from the Markdown Chunker 7. Attempt to publish the workflow ## **Expected Behavior** The Knowledge Base node should: - Show only the variable name (e.g., "text", "result", "chunks") in the Chunks field - Accept the variable reference and validate successfully - Allow the workflow to be published without errors ## **Actual Behavior** The Knowledge Base node: - Shows `[Markdown Chunker]variableName` in the Chunks field (includes node title) - Fails validation with error: "[Markdown Chunker] Invalid variable" - Prevents workflow publishing ## **Technical Details** ### Database Analysis The workflow graph stores the variable reference as: ```json "index_chunk_variable_selector": ["nodeID", "variableName"] ``` But should store it as: ```json "index_chunk_variable_selector": ["nodeID.variableName"] ``` ### Affected Components - **Knowledge Base Node**: Variable selector UI component - **Workflow Validation**: Backend validation logic - **Multiple Chunker Types**: Affects both General Chunker and Markdown Chunker ### Variable Names Tested - `result` - Failed - `chunks` - Failed - `text` - Failed - All with same "[NodeName] Invalid variable" error ## **Workarounds Attempted** 1. **Direct Database Modification**: Changed from array format to dot notation - Still failed 2. **Multiple Variable Names**: Tried different output variable names - Still failed 3. **Different Chunker Nodes**: Tried General Chunker vs Markdown Chunker - Same issue 4. **Fresh Workflow Creation**: Issue persists in new workflows ## **Root Cause Analysis** The issue appears to be in the Knowledge Base node's frontend component that: 1. Correctly displays available variables from connected nodes 2. Incorrectly prepends the node title to the variable name when selected 3. Passes the malformed variable reference to validation logic 4. Validation fails because "[NodeTitle]" is not a valid variable prefix ## **Impact** - **Severity**: High - Blocks knowledge base creation workflows - **Scope**: Affects all workflows using Knowledge Base with chunkers - **User Experience**: Makes Dify unusable for RAG/knowledge base workflows ## **Suggested Fix** 1. **Frontend**: Modify Knowledge Base node variable selector to only use variable name 2. **Backend**: Update validation to handle the current format gracefully 3. **Database**: Ensure consistent variable reference format across all nodes ## **Additional Context** - This affects both Docker and standalone deployments - Issue persists across multiple Dify versions (1.9.2, 1.11.2) - Affects both General Chunker and Markdown Chunker plugins - Crawl4AI integration works correctly, issue is in Knowledge Base node ## **Related Issues** - Variable reference format inconsistency across Dify node types - UI/Backend mismatch in variable handling - Plugin compatibility with Knowledge Base node ## **Attachments** - Database schema showing `index_chunk_variable_selector` format - Workflow graph JSON examples - Error screenshots (if available) ## **Priority** **High** - This is a critical functionality blocker for knowledge base workflows, which is a core feature of Dify. ### ✔️ Expected Behavior The Knowledge Base node should: - Show only the variable name (e.g., "text", "result", "chunks") in the Chunks field - Accept the variable reference and validate successfully - Allow the workflow to be published without errors ### ❌ Actual Behavior The Knowledge Base node: - Shows `[Markdown Chunker]variableName` in the Chunks field (includes node title) - Fails validation with error: "[Markdown Chunker] Invalid variable" - Prevents workflow publishing
yindo added the 🐞 bug label 2026-02-21 20:12:09 -05:00
yindo closed this issue 2026-02-21 20:12:09 -05:00
Author
Owner

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

Hi, @tcat88511-cmd. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in Dify v1.11.2 where the Knowledge Base node incorrectly includes the node title in variable references from Markdown Chunker nodes.
  • This causes validation errors and blocks workflow publishing.
  • The expected behavior is for the Knowledge Base node to accept only the variable name without the node title.
  • The issue occurs in self-hosted Docker deployments on Windows and affects backend processing.
  • There have been no comments or updates on this issue so far.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 29, 2026): Hi, @tcat88511-cmd. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug in Dify v1.11.2 where the Knowledge Base node incorrectly includes the node title in variable references from Markdown Chunker nodes. - This causes validation errors and blocks workflow publishing. - The expected behavior is for the Knowledge Base node to accept only the variable name without the node title. - The issue occurs in self-hosted Docker deployments on Windows and affects backend processing. - There have been no comments or updates on this issue so far. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21354