Skip to content

[Bug] Variable Assigner node silently fails for legacy V1 data format - backward compatibility issue #28862

Description

@kinglisky

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Bug Description

Legacy workflow data containing Variable Assigner nodes in V1 format fails to execute the assignment operation silently. The node execution reports success, but no actual variable assignment occurs.

The root cause is that DifyNodeFactory.create_node() always uses LATEST_VERSION to instantiate node classes, ignoring the version field in node data. When V1 format data (without version and items fields) is processed by VariableAssignerNodeV2, the items field defaults to an empty list, causing the _run() method's for-loop to skip all operations.

Steps to Reproduce

  1. Import or use a legacy workflow that was created before the Variable Assigner V2 upgrade
  2. The legacy Variable Assigner node data contains:
    {
      "data": {
        "assigned_variable_selector": ["conversation", "query"],
        "input_variable_selector": ["sys", "query"],
        "write_mode": "append",
        "type": "assigner"
        // Missing: "version": "2" and "items": [...]
      }
    }
  3. Run the workflow with a conversation variable list append operation
  4. The Variable Assigner node completes without error, but the list variable is not updated

Example

Use the following example:
Variable Assigner Test.yml

Image Image

The normal operating result is as follows:

Image

✔️ Expected Behavior

Expected Behavior

  • The system should either:

    1. Select VariableAssignerNodeV1 class based on missing version field (backward compatibility), OR
    2. VariableAssignerNodeV2 should auto-migrate V1 data format by converting assigned_variable_selector, input_variable_selector, and write_mode to equivalent items array
  • The variable assignment should execute correctly regardless of data format version

❌ Actual Behavior

Actual Behavior

  • The node execution returns WorkflowNodeExecutionStatus.SUCCEEDED
  • No variable assignment actually occurs
  • No error message is displayed to the user
  • Re-editing the node in the UI "fixes" the issue by saving in V2 format

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions