app list error #20704

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

Originally created by @zyssyz123 on GitHub (Dec 1, 2025).

Originally assigned to: @Yeuoly on GitHub.

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

Cloud

Steps to reproduce

The workflow graph might be stored as empty under certain circumstances (due to DSL import failure). However, the app list API checks the nodes key; if it's not detected, it throws an exception and fails. This prevents users from seeing the complete app list.

error code

✔️ Expected Behavior

No exception is thrown when the nodes are not detected.

Actual Behavior

No response

Originally created by @zyssyz123 on GitHub (Dec 1, 2025). Originally assigned to: @Yeuoly on GitHub. ### 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.10.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce The workflow graph might be stored as empty under certain circumstances (due to DSL import failure). However, the app list API checks the nodes key; if it's not detected, it throws an exception and fails. This prevents users from seeing the complete app list. [error code](https://github.com/langgenius/dify/blob/main/api/models/workflow.py#L352) ### ✔️ Expected Behavior No exception is thrown when the nodes are not detected. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bugcloud labels 2026-02-21 20:08:33 -05:00
yindo closed this issue 2026-02-21 20:08:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2025):

The app list API throws an exception when the workflow graph's 'nodes' key is missing because the walk_nodes method in api/models/workflow.py explicitly raises a WorkflowDataError if 'nodes' is not present in the workflow graph. This means that if a workflow is imported with a malformed or empty graph (such as after a DSL import failure), the entire app list request can fail and prevent users from seeing any apps at all. You can see this behavior in the code:
walk_nodes raises WorkflowDataError if 'nodes' is missing.

To make the app list API more robust, you should modify walk_nodes (and similar methods) to return an empty generator or list if 'nodes' is missing, instead of raising an exception. For example, you could change:

def walk_nodes(self, specific_node_type: NodeType | None = None):
    graph_dict = self.graph_dict
    if "nodes" not in graph_dict:
        raise WorkflowDataError("nodes not found in workflow graph")
    ...

to:

def walk_nodes(self, specific_node_type: NodeType | None = None):
    graph_dict = self.graph_dict
    nodes = graph_dict.get("nodes", [])
    if specific_node_type:
        yield from (
            (node["id"], node["data"])
            for node in nodes
            if node["data"]["type"] == specific_node_type.value
        )
    else:
        yield from ((node["id"], node["data"]) for node in nodes)

This way, if 'nodes' is missing, the method simply yields nothing, and the app list API can continue processing other workflows without interruption. This approach aligns with best practices for API design, where list endpoints should handle missing or malformed data gracefully to avoid blocking the entire response due to a single bad item.

No recent merged PRs directly address this specific error in the app list API, so this change would need to be made in your deployment to resolve the issue.

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 (Dec 1, 2025): <!-- Answer --> The app list API throws an exception when the workflow graph's 'nodes' key is missing because the walk_nodes method in `api/models/workflow.py` explicitly raises a `WorkflowDataError` if 'nodes' is not present in the workflow graph. This means that if a workflow is imported with a malformed or empty graph (such as after a DSL import failure), the entire app list request can fail and prevent users from seeing any apps at all. You can see this behavior in the code: [walk_nodes raises WorkflowDataError if 'nodes' is missing](https://github.com/langgenius/dify/blob/2f8cb2a1af53a24392621b17e05dccaa979a30fc/api/models/workflow.py#L211-L362). To make the app list API more robust, you should modify walk_nodes (and similar methods) to return an empty generator or list if 'nodes' is missing, instead of raising an exception. For example, you could change: ```python def walk_nodes(self, specific_node_type: NodeType | None = None): graph_dict = self.graph_dict if "nodes" not in graph_dict: raise WorkflowDataError("nodes not found in workflow graph") ... ``` to: ```python def walk_nodes(self, specific_node_type: NodeType | None = None): graph_dict = self.graph_dict nodes = graph_dict.get("nodes", []) if specific_node_type: yield from ( (node["id"], node["data"]) for node in nodes if node["data"]["type"] == specific_node_type.value ) else: yield from ((node["id"], node["data"]) for node in nodes) ``` This way, if 'nodes' is missing, the method simply yields nothing, and the app list API can continue processing other workflows without interruption. This approach aligns with best practices for API design, where list endpoints should handle missing or malformed data gracefully to avoid blocking the entire response due to a single bad item. No recent merged PRs directly address this specific error in the app list API, so this change would need to be made in your deployment to resolve the issue. <!-- 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/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e6608ac3-5ae7-4054-845c-e0582cf92330?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=The%20app%20list%20API%20throws%20an%20exception%20when%20the%20workflow%20graph%27s%20%27nodes%27%20key%20is%20missing%20because%20the%20walk_nodes%20method%20in%20%60api/models/workflow.py%60%20explicitly%20raises%20a%20%60WorkflowDataError%60%20if%20%27nodes%27%20is%20not%20present%20in%20the%20workflow%20graph.%20This%20means%20that%20if%20a%20workflow%20is%20imported%20with%20a%20malformed%20or%20empty%20graph%20%28such%20as%20after%20a%20DSL%20import%20failure%29%2C%20the%20entire%20app%20list%20request%20can%20fail%20and%20prevent%20users%20from%20seeing%20any%20apps%20at%20all.%20You%20can%20see%20this%20behavior%20in%20the%20code%3A%20%20%0A%5Bwalk_nodes%20raises%20WorkflowDataError%20if%20%27nodes%27%20is%20missing%5D%28https%3A//github.com/langgenius/dify/blob/2f8cb2a1af53a24392621b17e05dccaa979a30fc/api/models/workflow.py%23L211-L362%29.%0A%0ATo%20make%20the%20app%20list%20API%20more%20robust%2C%20you%20should%20modify%20walk_nodes%20%28and%20similar%20methods%29%20to%20return%20an%20empty%20generator%20or%20list%20if%20%27nodes%27%20is%20missing%2C%20instead%20of%20raising%20an%20exception.%20For%20example%2C%20you%20could%20change%3A%0A%0A%60%60%60python%0Adef%20walk_nodes%28self%2C%20specific_node_type%3A%20NodeType%20%7C%20None%20%3D%20None%29%3A%0A%20%20%20%20graph_dict%20%3D%20self.graph_dict%0A%20%20%20%20if%20%22nodes%22%20not%20in%20graph_dict%3A%0A%20%20%20%20%20%20%20%20raise%20WorkflowDataError%28%22nodes%20not%20found%20in%20workflow%20graph%22%29%0A%20%20%20%20...%0A%60%60%60%0A%0Ato%3A%0A%0A%60%60%60python%0Adef%20walk_nodes%28self%2C%20specific_node_type%3A%20NodeType%20%7C%20None%20%3D%20None%29%3A%0A%20%20%20%20graph_dict%20%3D%20self.graph_dict%0A%20%20%20%20nodes%20%3D%20graph_dict.get%28%22nodes%22%2C%20%5B%5D%29%0A%20%20%20%20if%20specific_node_type%3A%0A%20%20%20%20%20%20%20%20yield%20from%20%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%28node%5B%22id%22%5D%2C%20node%5B%22data%22%5D%29%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20node%20in%20nodes%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20node%5B%22data%22%5D%5B%22type%22%5D%20%3D%3D%20specific_node_type.value%0A%20%20%20%20%20%20%20%20%29%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20yield%20from%20%28%28node%5B%22id%22%5D%2C%20node%5B%22data%22%5D%29%20for%20node%20in%20nodes%29%0A%60%60%60%0A%0AThis%20way%2C%20if%20%27nodes%27%20is%20missing%2C%20the%20method%20simply%20yields%20nothing%2C%20and%20the%20app%20list%20API%20can%20continue%20processing%20other%20workflows%20without%20interruption.%20This%20approach%20aligns%20with%20best%20practices%20for%20API%20design%2C%20where%20list%20endpoints%20should%20handle%20missing%20or%20malformed%20data%20gracefully%20to%20avoid%20blocking%20the%20entire%20response%20due%20to%20a%20single%20bad%20item.%0A%0ANo%20recent%20merged%20PRs%20directly%20address%20this%20specific%20error%20in%20the%20app%20list%20API%2C%20so%20this%20change%20would%20need%20to%20be%20made%20in%20your%20deployment%20to%20resolve%20the%20issue.)&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/28971)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20704