Back Home

GitHub Repo

Dify Community Proposes Workflow Fix After Snippet Node IDs May Send Document Variables to Models Unresolved

A Dify community report on October 10 said nodes inserted through Snippet may create unparseable variable references, causing models to receive placeholders instead of document content. The proposed fix includes regression tests but has not been merged and will not migrate existing workflows.

The original uploader was Ggia at Greek Wikipedia. · CC BY-SA 2.5 · Image source
zh-Hant

On October 10, the Dify community reported a workflow variable parsing defect: in self-hosted Docker version 1.17.0, inserting document retrieval and LLM nodes through Snippet, then adding the retrieval result to a prompt with the variable selector, may cause the model to receive a raw placeholder and respond that it cannot read the content. The report includes reproduction steps and a minimal backend regular expression case. Issue report

The report attributes the cause to a format mismatch between the frontend and backend. The Snippet insertion code builds a new ID from the original node ID, a timestamp, and an index, with hyphens in between. The backend prompt parser’s allowed node ID characters, however, include only letters, numbers, and underscores. As a result, a document variable selected in the interface may still fail to match at runtime and pass through as literal prompt text. This also explains why similar workflows may behave differently depending on how their nodes were created. Reproduction and parsing path

Dify’s official documentation says workflow variables in prompts should be replaced with their actual values before being sent to the model. From an engineering perspective, this type of defect could be mistaken for a document retrieval failure or a limitation in model capability. When troubleshooting document question-answering workflows, teams should check not only upstream node outputs but also whether the prompt actually sent still contains variable markers. LLM node documentation

PR #43838, submitted the same day, instead generates node IDs using a numeric timestamp, incrementing it in case of collisions, while preserving remapping of graph references. The author says the added regression case failed before the fix and that 27 related tests passed afterward. They cover repeated insertions with the same timestamp, prompt references, and connection endpoints. However, no end-to-end testing in a deployment environment or validation with a real model was performed. Proposed fix

As of the time of review, the proposal remains open and awaiting review. Its scope is limited to preventing newly inserted nodes from getting incompatible IDs; existing saved workflows will not be fixed automatically. Engineering teams should track the merge and release status, and determine whether old workflows need migration. This case should not be generalized to mean that all Dify deployments are affected. Fix scope and status

Sources

  1. Snippet 節點 ID 導致變數未替換:Dify Issue #43830
  2. 產生相容提示模板的 Snippet 節點 ID:PR #43838
  3. LLM 節點與提示變數替換