ComfyUI Plugin workflow run failed #608

Closed
opened 2026-02-16 10:19:53 -05:00 by yindo · 8 comments
Owner

Originally created by @austincityuwen on GitHub (Sep 1, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.8.0

Plugin version

0.2.5

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I use ComfyUI Workflow nodes in Dify, an error occured as it showed below

"An error occurred in the plugin, please contact the author of langgenius/comfyui/comfyui for help, error type: KeyError, error details: 'nodes'"

Image

And my workflow json is:

Image

✔️ Error log

No response

Originally created by @austincityuwen on GitHub (Sep 1, 2025). ### Self Checks - [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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.8.0 ### Plugin version 0.2.5 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I use ComfyUI Workflow nodes in Dify, an error occured as it showed below "An error occurred in the plugin, please contact the author of langgenius/comfyui/comfyui for help, error type: KeyError, error details: 'nodes'" <img width="461" height="684" alt="Image" src="https://github.com/user-attachments/assets/675c9763-e280-40ec-84be-612ef45cc902" /> And my workflow json is: <img width="525" height="1187" alt="Image" src="https://github.com/user-attachments/assets/e212e869-f6f8-40e8-b253-f5a5d87424bc" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:19:53 -05:00
yindo closed this issue 2026-02-16 10:19:53 -05:00
Author
Owner

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

The ComfyUI plugin expects your workflow JSON to have a top-level nodes key (and usually a links key) for proper parsing and execution. If either is missing or malformed, you'll get a KeyError: 'nodes' like you saw. This requirement is enforced in the plugin code, and most operations depend on the correct structure of these fields reference.

Recent plugin updates (including 0.2.5) removed problematic JSON preprocessing that could corrupt your workflow file, but the structure requirement remains reference. Double-check that your workflow JSON is valid and includes a top-level nodes array and a links array. If you exported your workflow from ComfyUI, make sure it wasn't altered or corrupted before uploading to Dify.

If your JSON looks correct and you still see this error, try testing the workflow directly in ComfyUI to confirm it's valid. Also, ensure your ComfyUI server is up-to-date and compatible with the plugin version.

If you need an example, a minimal valid workflow JSON should look like:

{
  "nodes": [
    { "id": 1, "type": "LoadImage", ... },
    { "id": 2, "type": "BackgroundEraseNetwork", ... },
    { "id": 3, "type": "PreviewImage", ... }
  ],
  "links": [
    [ ... ]
  ]
}

If your workflow JSON matches this pattern and you still get the error, there may be a deeper compatibility or network issue reference.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 1, 2025): <!-- Answer --> The ComfyUI plugin expects your workflow JSON to have a top-level `nodes` key (and usually a `links` key) for proper parsing and execution. If either is missing or malformed, you'll get a `KeyError: 'nodes'` like you saw. This requirement is enforced in the plugin code, and most operations depend on the correct structure of these fields [reference](https://github.com/langgenius/dify-official-plugins/blob/a820471845b0fa50da92cb889c2613155248238d/tools/comfyui/tools/comfyui_workflow.py). Recent plugin updates (including 0.2.5) removed problematic JSON preprocessing that could corrupt your workflow file, but the structure requirement remains [reference](https://github.com/langgenius/dify-official-plugins/pull/1618). Double-check that your workflow JSON is valid and includes a top-level `nodes` array and a `links` array. If you exported your workflow from ComfyUI, make sure it wasn't altered or corrupted before uploading to Dify. If your JSON looks correct and you still see this error, try testing the workflow directly in ComfyUI to confirm it's valid. Also, ensure your ComfyUI server is up-to-date and compatible with the plugin version. If you need an example, a minimal valid workflow JSON should look like: ```json { "nodes": [ { "id": 1, "type": "LoadImage", ... }, { "id": 2, "type": "BackgroundEraseNetwork", ... }, { "id": 3, "type": "PreviewImage", ... } ], "links": [ [ ... ] ] } ``` If your workflow JSON matches this pattern and you still get the error, there may be a deeper compatibility or network issue [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). <!-- 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/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/1627)
Author
Owner

@austincityuwen commented on GitHub (Sep 1, 2025):

The ComfyUI plugin expects your workflow JSON to have a top-level nodes key (and usually a links key) for proper parsing and execution. If either is missing or malformed, you'll get a KeyError: 'nodes' like you saw. This requirement is enforced in the plugin code, and most operations depend on the correct structure of these fields reference.

Recent plugin updates (including 0.2.5) removed problematic JSON preprocessing that could corrupt your workflow file, but the structure requirement remains reference. Double-check that your workflow JSON is valid and includes a top-level nodes array and a links array. If you exported your workflow from ComfyUI, make sure it wasn't altered or corrupted before uploading to Dify.

If your JSON looks correct and you still see this error, try testing the workflow directly in ComfyUI to confirm it's valid. Also, ensure your ComfyUI server is up-to-date and compatible with the plugin version.

If you need an example, a minimal valid workflow JSON should look like:

{
"nodes": [
{ "id": 1, "type": "LoadImage", ... },
{ "id": 2, "type": "BackgroundEraseNetwork", ... },
{ "id": 3, "type": "PreviewImage", ... }
],
"links": [
[ ... ]
]
}
If your workflow JSON matches this pattern and you still get the error, there may be a deeper compatibility or network issue reference.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

But my workflow json is exported directly from comfyUI @dosu

@austincityuwen commented on GitHub (Sep 1, 2025): > The ComfyUI plugin expects your workflow JSON to have a top-level `nodes` key (and usually a `links` key) for proper parsing and execution. If either is missing or malformed, you'll get a `KeyError: 'nodes'` like you saw. This requirement is enforced in the plugin code, and most operations depend on the correct structure of these fields [reference](https://github.com/langgenius/dify-official-plugins/blob/a820471845b0fa50da92cb889c2613155248238d/tools/comfyui/tools/comfyui_workflow.py). > > Recent plugin updates (including 0.2.5) removed problematic JSON preprocessing that could corrupt your workflow file, but the structure requirement remains [reference](https://github.com/langgenius/dify-official-plugins/pull/1618). Double-check that your workflow JSON is valid and includes a top-level `nodes` array and a `links` array. If you exported your workflow from ComfyUI, make sure it wasn't altered or corrupted before uploading to Dify. > > If your JSON looks correct and you still see this error, try testing the workflow directly in ComfyUI to confirm it's valid. Also, ensure your ComfyUI server is up-to-date and compatible with the plugin version. > > If you need an example, a minimal valid workflow JSON should look like: > > { > "nodes": [ > { "id": 1, "type": "LoadImage", ... }, > { "id": 2, "type": "BackgroundEraseNetwork", ... }, > { "id": 3, "type": "PreviewImage", ... } > ], > "links": [ > [ ... ] > ] > } > If your workflow JSON matches this pattern and you still get the error, there may be a deeper compatibility or network issue [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6bc50380-5ad4-45ad-bf17-8dd6ac5e38f8?feedback_type=other)  [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1627) But my workflow json is exported directly from comfyUI @dosu
Author
Owner

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

If your workflow JSON is exported directly from ComfyUI but you still see a KeyError: 'nodes', there are a few likely causes:

  1. The plugin requires the workflow to be exported using the "Save(API Format)" option in ComfyUI with Dev Mode enabled. If you use the regular export, the JSON may not have the required top-level nodes and links arrays, even if it looks correct in the UI. Double-check that you used the API export method as described in the plugin docs reference.

  2. Network issues between Dify and your ComfyUI server can cause the plugin to receive an incomplete or empty workflow JSON, resulting in the missing nodes key error. This has been confirmed in similar cases—fixing network settings resolved the problem reference.

  3. JSON corruption can happen during upload or transfer, especially if the file is edited or processed by other tools. Make sure the file is unmodified after export and that it uses standard double quotes for keys and string values. Recent plugin versions (0.2.5+) removed problematic preprocessing that could corrupt JSON, but it's still important to check reference.

  4. Ensure your ComfyUI server and plugin versions are compatible. The recommended ComfyUI server version is 0.3.33+ and plugin version is 0.2.5+ reference.

If all of the above check out and you still see the error, try running the workflow directly in ComfyUI to confirm it's valid, and consider sharing the raw JSON for further troubleshooting.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 1, 2025): <!-- Answer --> If your workflow JSON is exported directly from ComfyUI but you still see a KeyError: 'nodes', there are a few likely causes: 1. The plugin requires the workflow to be exported using the "Save(API Format)" option in ComfyUI with Dev Mode enabled. If you use the regular export, the JSON may not have the required top-level `nodes` and `links` arrays, even if it looks correct in the UI. Double-check that you used the API export method as described in the plugin docs [reference](https://github.com/langgenius/dify-official-plugins/pull/948). 2. Network issues between Dify and your ComfyUI server can cause the plugin to receive an incomplete or empty workflow JSON, resulting in the missing `nodes` key error. This has been confirmed in similar cases—fixing network settings resolved the problem [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). 3. JSON corruption can happen during upload or transfer, especially if the file is edited or processed by other tools. Make sure the file is unmodified after export and that it uses standard double quotes for keys and string values. Recent plugin versions (0.2.5+) removed problematic preprocessing that could corrupt JSON, but it's still important to check [reference](https://github.com/langgenius/dify-official-plugins/pull/1618). 4. Ensure your ComfyUI server and plugin versions are compatible. The recommended ComfyUI server version is 0.3.33+ and plugin version is 0.2.5+ [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). If all of the above check out and you still see the error, try running the workflow directly in ComfyUI to confirm it's valid, and consider sharing the raw JSON for further troubleshooting. <!-- 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/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/1627)
Author
Owner

@austincityuwen commented on GitHub (Sep 1, 2025):

If your workflow JSON is exported directly from ComfyUI but you still see a KeyError: 'nodes', there are a few likely causes:

  1. The plugin requires the workflow to be exported using the "Save(API Format)" option in ComfyUI with Dev Mode enabled. If you use the regular export, the JSON may not have the required top-level nodes and links arrays, even if it looks correct in the UI. Double-check that you used the API export method as described in the plugin docs reference.
  2. Network issues between Dify and your ComfyUI server can cause the plugin to receive an incomplete or empty workflow JSON, resulting in the missing nodes key error. This has been confirmed in similar cases—fixing network settings resolved the problem reference.
  3. JSON corruption can happen during upload or transfer, especially if the file is edited or processed by other tools. Make sure the file is unmodified after export and that it uses standard double quotes for keys and string values. Recent plugin versions (0.2.5+) removed problematic preprocessing that could corrupt JSON, but it's still important to check reference.
  4. Ensure your ComfyUI server and plugin versions are compatible. The recommended ComfyUI server version is 0.3.33+ and plugin version is 0.2.5+ reference.

If all of the above check out and you still see the error, try running the workflow directly in ComfyUI to confirm it's valid, and consider sharing the raw JSON for further troubleshooting.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

RAW json is {
"1": {
"inputs": {
"input_image": [
"2",
0
]
},
"class_type": "BackgroundEraseNetwork",
"_meta": {
"title": "Background Erase Network Image"
}
},
"2": {
"inputs": {
"image": "Snipaste_2024-07-25_13-41-38.png"
},
"class_type": "LoadImage",
"_meta": {
"title": "加载图像"
}
},
"3": {
"inputs": {
"images": [
"1",
0
]
},
"class_type": "PreviewImage",
"_meta": {
"title": "预览图像"
}
}
} it's valid to run in comfyui directly @dosu

@austincityuwen commented on GitHub (Sep 1, 2025): > If your workflow JSON is exported directly from ComfyUI but you still see a KeyError: 'nodes', there are a few likely causes: > > 1. The plugin requires the workflow to be exported using the "Save(API Format)" option in ComfyUI with Dev Mode enabled. If you use the regular export, the JSON may not have the required top-level `nodes` and `links` arrays, even if it looks correct in the UI. Double-check that you used the API export method as described in the plugin docs [reference](https://github.com/langgenius/dify-official-plugins/pull/948). > 2. Network issues between Dify and your ComfyUI server can cause the plugin to receive an incomplete or empty workflow JSON, resulting in the missing `nodes` key error. This has been confirmed in similar cases—fixing network settings resolved the problem [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). > 3. JSON corruption can happen during upload or transfer, especially if the file is edited or processed by other tools. Make sure the file is unmodified after export and that it uses standard double quotes for keys and string values. Recent plugin versions (0.2.5+) removed problematic preprocessing that could corrupt JSON, but it's still important to check [reference](https://github.com/langgenius/dify-official-plugins/pull/1618). > 4. Ensure your ComfyUI server and plugin versions are compatible. The recommended ComfyUI server version is 0.3.33+ and plugin version is 0.2.5+ [reference](https://github.com/langgenius/dify-official-plugins/issues/954#issuecomment-2909412926). > > If all of the above check out and you still see the error, try running the workflow directly in ComfyUI to confirm it's valid, and consider sharing the raw JSON for further troubleshooting. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d31eafc3-95a3-4dd2-9da5-623d920fc4f9?feedback_type=other)  [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1627) RAW json is { "1": { "inputs": { "input_image": [ "2", 0 ] }, "class_type": "BackgroundEraseNetwork", "_meta": { "title": "Background Erase Network Image" } }, "2": { "inputs": { "image": "Snipaste_2024-07-25_13-41-38.png" }, "class_type": "LoadImage", "_meta": { "title": "加载图像" } }, "3": { "inputs": { "images": [ "1", 0 ] }, "class_type": "PreviewImage", "_meta": { "title": "预览图像" } } } it's valid to run in comfyui directly @dosu
Author
Owner

@austincityuwen commented on GitHub (Sep 1, 2025):

Any one who have this problem with comfyui workflow?

@austincityuwen commented on GitHub (Sep 1, 2025): Any one who have this problem with comfyui workflow?
Author
Owner

@ss958 commented on GitHub (Sep 5, 2025):

The new version of Comfyui export API JSON does not have "nodes" or "links"

@ss958 commented on GitHub (Sep 5, 2025): The new version of Comfyui export API JSON does not have "nodes" or "links"
Author
Owner

@yt-koike commented on GitHub (Sep 7, 2025):

Hello, @austincityuwen !

Thank you very much for reporting a bug. I'll be working on it.

@yt-koike commented on GitHub (Sep 7, 2025): Hello, @austincityuwen ! Thank you very much for reporting a bug. I'll be working on it.
Author
Owner

@yt-koike commented on GitHub (Sep 7, 2025):

OK, I fixed it and verified it works with this workflow.
Please wait for the merge!

@yt-koike commented on GitHub (Sep 7, 2025): OK, I fixed it and verified it works with [this workflow](https://github.com/user-attachments/files/22194457/ComfyUI.yml). Please wait for the merge!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#608