Issue: Fix the Iterator Node to Support Iteration Over File Objects #7161

Closed
opened 2026-02-21 18:19:12 -05:00 by yindo · 1 comment
Owner

Originally created by @yjc980121 on GitHub (Dec 12, 2024).

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 search for existing issues, 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

0.11.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In the current system, the start node already supports file upload functionality, allowing users to upload a list of files (array). However, the iterator node, when processing these files, still treats the iteration object as a string type instead of the expected File object. This prevents proper handling of the files, especially the inability to dispatch different processing tools based on file formats (e.g., file extensions or MIME types).

Requirements
Iterator Node Support for Iterating Over File Objects:

The iterator node should be able to process the uploaded list of files.

The iteration object should be a File object, not a string.

Dispatch Different Processing Tools Based on File Formats:

File formats can be identified by file extensions or MIME types.

Different processing tools should be dispatched based on the file format.

Current Issues
The iterator node treats the iteration object as a string type instead of a File object.

It is not possible to dispatch different processing tools based on file formats.

Solution
Modify the Iterator Node Logic:

Change the iteration object from a string type to a File object in the iterator node.

Ensure the iterator node can correctly process File objects.

Implement File Format Identification and Dispatching:

In the iterator node, check the format of each File object (file extension or MIME type).

Dispatch the appropriate processing tool based on the file format.

Implementation Steps
Modify the Iterator Node Logic:

Change the iteration object from a string type to a File object in the iterator node.

Ensure the iterator node can correctly process File objects.

Implement File Format Identification and Dispatching:

In the iterator node, check the format of each File object (file extension or MIME type).

Dispatch the appropriate processing tool based on the file format.

✔️ Expected Behavior

The iterator node can correctly process File objects instead of strings.

The system can dispatch different processing tools based on file formats, ensuring proper handling of the files.

Actual Behavior

No response

Originally created by @yjc980121 on GitHub (Dec 12, 2024). ### 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 [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 (我已阅读并同意 [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 0.11.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In the current system, the start node already supports file upload functionality, allowing users to upload a list of files (array). However, the iterator node, when processing these files, still treats the iteration object as a string type instead of the expected File object. This prevents proper handling of the files, especially the inability to dispatch different processing tools based on file formats (e.g., file extensions or MIME types). Requirements Iterator Node Support for Iterating Over File Objects: The iterator node should be able to process the uploaded list of files. The iteration object should be a File object, not a string. Dispatch Different Processing Tools Based on File Formats: File formats can be identified by file extensions or MIME types. Different processing tools should be dispatched based on the file format. Current Issues The iterator node treats the iteration object as a string type instead of a File object. It is not possible to dispatch different processing tools based on file formats. Solution Modify the Iterator Node Logic: Change the iteration object from a string type to a File object in the iterator node. Ensure the iterator node can correctly process File objects. Implement File Format Identification and Dispatching: In the iterator node, check the format of each File object (file extension or MIME type). Dispatch the appropriate processing tool based on the file format. Implementation Steps Modify the Iterator Node Logic: Change the iteration object from a string type to a File object in the iterator node. Ensure the iterator node can correctly process File objects. Implement File Format Identification and Dispatching: In the iterator node, check the format of each File object (file extension or MIME type). Dispatch the appropriate processing tool based on the file format. ### ✔️ Expected Behavior The iterator node can correctly process File objects instead of strings. The system can dispatch different processing tools based on file formats, ensuring proper handling of the files. ### ❌ Actual Behavior _No response_
yindo added the 💪 enhancement label 2026-02-21 18:19:12 -05:00
yindo closed this issue 2026-02-21 18:19:12 -05:00
Author
Owner

@crazywoola commented on GitHub (Dec 12, 2024):

This should be a enhancement instead of a fix.

@crazywoola commented on GitHub (Dec 12, 2024): This should be a enhancement instead of a fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7161