type error in question classifier node backward invocation #22235

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

Originally created by @zhuzihao-hz on GitHub (Feb 15, 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.12.1

Cloud or Self Hosted

Cloud

Steps to reproduce

In dify_plugin_sdk, when using self.session.workflow_node.question_classifier.invoke to invoke the question classifier node. It received the following error.

I think it is caused by a missing type definition in the api/core/plugin/backwards_invocation/node.py.

✔️ Expected Behavior

Receive response of the question classifier node.

Actual Behavior

Image

Originally created by @zhuzihao-hz on GitHub (Feb 15, 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.12.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce In dify_plugin_sdk, when using `self.session.workflow_node.question_classifier.invoke` to invoke the question classifier node. It received the following error. I think it is caused by a missing type definition in the `api/core/plugin/backwards_invocation/node.py`. ### ✔️ Expected Behavior Receive response of the question classifier node. ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/28f4199b-1622-49cf-aaec-d264d9ee68a5)
yindo added the 🐞 bug label 2026-02-21 20:16:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 15, 2026):

Hi @zhuzihao-hz! I'm Dosu and I’m helping the dify team.

You've correctly identified the issue! This is a bug in api/core/plugin/backwards_invocation/node.py where the invoke_question_classifier method is missing the type assignment before passing node data to the workflow service.

Looking at the code, parameter_extractor correctly sets the type:

node_data_dict = node_data.model_dump()
node_data_dict["type"] = NodeType.PARAMETER_EXTRACTOR

But question_classifier is missing this line:

node_data_dict = node_data.model_dump()
# Missing: node_data_dict["type"] = NodeType.QUESTION_CLASSIFIER
execution = workflow_service.run_free_workflow_node(node_data_dict, ...)

The fix would be adding node_data_dict["type"] = NodeType.QUESTION_CLASSIFIER before the run_free_workflow_node call. The NodeType.QUESTION_CLASSIFIER enum is already properly defined in the codebase.

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 (Feb 15, 2026): <!-- Greeting --> Hi @zhuzihao-hz! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> You've correctly identified the issue! This is a bug in [`api/core/plugin/backwards_invocation/node.py`](https://github.com/langgenius/dify/blob/ba12960975ab4ed750bb0b7e737d96a60829f835/api/core/plugin/backwards_invocation/node.py#L104-L105) where the `invoke_question_classifier` method is **missing the type assignment** before passing node data to the workflow service. Looking at the code, `parameter_extractor` correctly sets the type: ```python node_data_dict = node_data.model_dump() node_data_dict["type"] = NodeType.PARAMETER_EXTRACTOR ``` But `question_classifier` is missing this line: ```python node_data_dict = node_data.model_dump() # Missing: node_data_dict["type"] = NodeType.QUESTION_CLASSIFIER execution = workflow_service.run_free_workflow_node(node_data_dict, ...) ``` The fix would be adding `node_data_dict["type"] = NodeType.QUESTION_CLASSIFIER` before the `run_free_workflow_node` call. The [`NodeType.QUESTION_CLASSIFIER`](https://github.com/langgenius/dify/blob/ba12960975ab4ed750bb0b7e737d96a60829f835/api/core/workflow/enums.py#L46) enum is already properly defined in the codebase. <!-- 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/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fbf3ea8a-13dd-4493-8912-2005c9b38c11?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=You%27ve%20correctly%20identified%20the%20issue%21%20This%20is%20a%20bug%20in%20%5B%60api/core/plugin/backwards_invocation/node.py%60%5D%28https%3A//github.com/langgenius/dify/blob/ba12960975ab4ed750bb0b7e737d96a60829f835/api/core/plugin/backwards_invocation/node.py%23L104-L105%29%20where%20the%20%60invoke_question_classifier%60%20method%20is%20%2A%2Amissing%20the%20type%20assignment%2A%2A%20before%20passing%20node%20data%20to%20the%20workflow%20service.%0A%0ALooking%20at%20the%20code%2C%20%60parameter_extractor%60%20correctly%20sets%20the%20type%3A%0A%60%60%60python%0Anode_data_dict%20%3D%20node_data.model_dump%28%29%0Anode_data_dict%5B%22type%22%5D%20%3D%20NodeType.PARAMETER_EXTRACTOR%0A%60%60%60%0A%0ABut%20%60question_classifier%60%20is%20missing%20this%20line%3A%0A%60%60%60python%0Anode_data_dict%20%3D%20node_data.model_dump%28%29%0A%23%20Missing%3A%20node_data_dict%5B%22type%22%5D%20%3D%20NodeType.QUESTION_CLASSIFIER%0Aexecution%20%3D%20workflow_service.run_free_workflow_node%28node_data_dict%2C%20...%29%0A%60%60%60%0A%0AThe%20fix%20would%20be%20adding%20%60node_data_dict%5B%22type%22%5D%20%3D%20NodeType.QUESTION_CLASSIFIER%60%20before%20the%20%60run_free_workflow_node%60%20call.%20The%20%5B%60NodeType.QUESTION_CLASSIFIER%60%5D%28https%3A//github.com/langgenius/dify/blob/ba12960975ab4ed750bb0b7e737d96a60829f835/api/core/workflow/enums.py%23L46%29%20enum%20is%20already%20properly%20defined%20in%20the%20codebase.)&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/32352)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22235