The workflow tool does not work inside a loop. #22211

Open
opened 2026-02-21 20:16:10 -05:00 by yindo · 9 comments
Owner

Originally created by @itribs on GitHub (Feb 12, 2026).

Originally assigned to: @fatelei 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.12.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a new workflow and publish it as a tool.
  2. Add this node to the loop.
  3. Run the loop.

✔️ Expected Behavior

It runs normally without errors.

Actual Behavior

It fails with an error:

(psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type uuid: ""
LINE 3: WHERE accounts.id = ''::UUID
^

[SQL: SELECT accounts.id, accounts.name, accounts.email, accounts.password, accounts.password_salt, accounts.avatar, accounts.interface_language, accounts.interface_theme, accounts.timezone, accounts.last_login_at, accounts.last_login_ip, accounts.last_active_at, accounts.status, accounts.initialized_at, accounts.created_at, accounts.updated_at
FROM accounts
WHERE accounts.id = %(id_1)s::UUID]
[parameters: {'id_1': ''}]
(Background on this error at: https://sqlalche.me/e/20/9h9h)

Image
Originally created by @itribs on GitHub (Feb 12, 2026). Originally assigned to: @fatelei 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.12.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Create a new workflow and publish it as a tool. 2. Add this node to the loop. 3. Run the loop. ### ✔️ Expected Behavior It runs normally without errors. ### ❌ Actual Behavior It fails with an error: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type uuid: "" LINE 3: WHERE accounts.id = ''::UUID ^ [SQL: SELECT accounts.id, accounts.name, accounts.email, accounts.password, accounts.password_salt, accounts.avatar, accounts.interface_language, accounts.interface_theme, accounts.timezone, accounts.last_login_at, accounts.last_login_ip, accounts.last_active_at, accounts.status, accounts.initialized_at, accounts.created_at, accounts.updated_at FROM accounts WHERE accounts.id = %(id_1)s::UUID] [parameters: {'id_1': ''}] (Background on this error at: https://sqlalche.me/e/20/9h9h) <img width="877" height="764" alt="Image" src="https://github.com/user-attachments/assets/dab16956-d0c9-4668-859f-972a91ecdb10" />
yindo added the 🐞 bug label 2026-02-21 20:16:10 -05:00
Author
Owner

@crazywoola commented on GitHub (Feb 12, 2026):

This should be resolved in the cloud env, please try it again, feel free to leave a comment if you encounter this again.

@crazywoola commented on GitHub (Feb 12, 2026): This should be resolved in the cloud env, please try it again, feel free to leave a comment if you encounter this again.
Author
Owner

@fatelei commented on GitHub (Feb 13, 2026):

Image i try there is no error, 1.13.0

@fatelei commented on GitHub (Feb 13, 2026): <img width="2130" height="975" alt="Image" src="https://github.com/user-attachments/assets/1bf95b92-8681-49d8-b3ea-5d887a5b99b1" /> i try there is no error, 1.13.0
Author
Owner

@itribs commented on GitHub (Feb 13, 2026):

@fatelei @crazywoola
I tested both self-hosted v1.13.0 and cloud v1.12.1, and got the same error in both.

Image Image

The workflow tool is as follows:

Image
@itribs commented on GitHub (Feb 13, 2026): @fatelei @crazywoola I tested both self-hosted v1.13.0 and cloud v1.12.1, and got the same error in both. <img width="1655" height="798" alt="Image" src="https://github.com/user-attachments/assets/e6667038-5f5a-469b-ae06-a9d5e241610d" /> <img width="1620" height="802" alt="Image" src="https://github.com/user-attachments/assets/ab0d5aa5-c262-470e-b9e8-d2b965114774" /> The workflow tool is as follows: <img width="1087" height="516" alt="Image" src="https://github.com/user-attachments/assets/c0341b9b-f9e6-49c6-b82a-be72501dae58" />
Author
Owner

@itribs commented on GitHub (Feb 13, 2026):

@fatelei @crazywoola
I see. Running the workflow directly works fine; the error only occurs when running the loop node alone.

@itribs commented on GitHub (Feb 13, 2026): @fatelei @crazywoola I see. Running the workflow directly works fine; the error only occurs when running the loop node alone.
Author
Owner

@fatelei commented on GitHub (Feb 13, 2026):

Image Image

it work in 1.13.0

@fatelei commented on GitHub (Feb 13, 2026): <img width="1276" height="631" alt="Image" src="https://github.com/user-attachments/assets/768991c6-adb8-4a73-afef-278e0f004eec" /> <img width="1859" height="664" alt="Image" src="https://github.com/user-attachments/assets/a4eb6c03-afaf-415b-b948-ec8d5b1ee05c" /> it work in 1.13.0
Author
Owner

@RAFI7708 commented on GitHub (Feb 13, 2026):

I’m facing the error

@RAFI7708 commented on GitHub (Feb 13, 2026): I’m facing the error
Author
Owner

@itribs commented on GitHub (Feb 13, 2026):

@fatelei the error only occurs when running the loop node alone.

@itribs commented on GitHub (Feb 13, 2026): @fatelei the error only occurs when running the loop node alone.
Author
Owner

@fatelei commented on GitHub (Feb 13, 2026):

it seem the user id is empty string, so the sql failed

@fatelei commented on GitHub (Feb 13, 2026): it seem the user id is empty string, so the sql failed
Author
Owner

@fatelei commented on GitHub (Feb 13, 2026):

@fatelei the error only occurs when running the loop node alone.

Image
@fatelei commented on GitHub (Feb 13, 2026): > [@fatelei](https://github.com/fatelei) the error only occurs when running the loop node alone. <img width="1118" height="345" alt="Image" src="https://github.com/user-attachments/assets/1522e928-7e74-4e38-82cb-a0324e3767dc" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22211