First Loop Iteration Data Duplicated in Direct Reply Table (Exported File Correct) #20616

Closed
opened 2026-02-21 20:08:11 -05:00 by yindo · 4 comments
Owner

Originally created by @ErinLqq on GitHub (Nov 27, 2025).

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

Self Hosted (Docker)

Steps to reproduce

Issue Type

Bug Report

Describe the Bug

When processing an uploaded Excel file with a loop node in Dify, the direct reply node (output table) inside the loop duplicates the first loop's data (shows twice in the table), while the final exported Excel document (after loop completion) has correct non-duplicated data.

Steps to Reproduce

  1. Initiate Workflow: Add a "File Upload" node (upload an Excel file with multiple entries) as the start node.
  2. Configure Loop Node: Set up a loop to process 3 Excel entries per iteration.
  3. Loop Internal Logic:
    • Code Node: Extract 3 entries from the Excel file for current loop iteration.
    • LLM Node (DeepSeek model): Analyze the 3 extracted entries and generate structured results.
    • Direct Reply Node: Output the LLM results as a table (bind to LLM node's output).
  4. Post-Loop Logic:
    • Code Node: Aggregate all loop iteration results.
    • Markdown to XLSX Node: Convert aggregated data to an Excel document and export it.

✔️ Expected Behavior

Expected Behavior

  • The direct reply node inside the loop should output the 3 entries' results once per loop iteration (no duplication).
  • The first loop iteration should show only 1 set of 3 entries in the reply table (no repeated data).

Actual Behavior

Actual Behavior

  • First loop iteration: The reply table displays the same 3 entries' results twice (duplicated data for loop 1).
  • Subsequent loop iterations: The reply table works correctly (no duplication).
  • Final exported Excel document: All data is correct (no duplication, matches the total number of entries).
Originally created by @ErinLqq on GitHub (Nov 27, 2025). ### 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 Self Hosted (Docker) ### Steps to reproduce ### Issue Type Bug Report ### Describe the Bug When processing an uploaded Excel file with a loop node in Dify, the **direct reply node (output table)** inside the loop duplicates the first loop's data (shows twice in the table), while the final exported Excel document (after loop completion) has correct non-duplicated data. ### Steps to Reproduce 1. **Initiate Workflow**: Add a "File Upload" node (upload an Excel file with multiple entries) as the start node. 2. **Configure Loop Node**: Set up a loop to process 3 Excel entries per iteration. 3. **Loop Internal Logic**: - Code Node: Extract 3 entries from the Excel file for current loop iteration. - LLM Node (DeepSeek model): Analyze the 3 extracted entries and generate structured results. - Direct Reply Node: Output the LLM results as a table (bind to LLM node's output). 4. **Post-Loop Logic**: - Code Node: Aggregate all loop iteration results. - Markdown to XLSX Node: Convert aggregated data to an Excel document and export it. ### ✔️ Expected Behavior ### Expected Behavior - The direct reply node inside the loop should output the 3 entries' results **once per loop iteration** (no duplication). - The first loop iteration should show only 1 set of 3 entries in the reply table (no repeated data). ### ❌ Actual Behavior ### Actual Behavior - First loop iteration: The reply table displays the same 3 entries' results **twice** (duplicated data for loop 1). - Subsequent loop iterations: The reply table works correctly (no duplication). - Final exported Excel document: All data is correct (no duplication, matches the total number of entries).
yindo added the 🐞 bugstale labels 2026-02-21 20:08:11 -05:00
yindo closed this issue 2026-02-21 20:08:11 -05:00
Author
Owner

@ErinLqq commented on GitHub (Nov 27, 2025):

Hello, dear Dify developers, can you help me solve this problem?

@ErinLqq commented on GitHub (Nov 27, 2025): Hello, dear Dify developers, can you help me solve this problem?
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

Hi @ErinLqq! I'm Dosu and I’m helping the dify team.

This is a known issue in Dify's workflow engine: the Direct Reply node inside a loop can show duplicated data if the output template doesn't reference the loop variable. This happens because the node's cache isn't invalidated between iterations unless the loop variable is included in the template, so it reuses the previous output and causes duplication in the first iteration's table display (even though the exported Excel is correct) [source].

To fix this, update your Direct Reply node's output template to include the loop variable (for example, add {{#num#}} if your loop variable is num). This forces the workflow engine to treat each iteration as unique and prevents the duplication bug in the UI [source].

Recent versions have improved loop handling, but this specific issue may still exist in 1.10.1. If the workaround doesn't resolve it, let me know and I can help you investigate further.

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 (Nov 27, 2025): <!-- Greeting --> Hi @ErinLqq! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This is a known issue in Dify's workflow engine: the Direct Reply node inside a loop can show duplicated data if the output template doesn't reference the loop variable. This happens because the node's cache isn't invalidated between iterations unless the loop variable is included in the template, so it reuses the previous output and causes duplication in the first iteration's table display (even though the exported Excel is correct) [[source](https://github.com/langgenius/dify/issues/28457)]. To fix this, update your Direct Reply node's output template to include the loop variable (for example, add `{{#num#}}` if your loop variable is `num`). This forces the workflow engine to treat each iteration as unique and prevents the duplication bug in the UI [[source](https://github.com/langgenius/dify/issues/28457)]. Recent versions have improved loop handling, but this specific issue may still exist in 1.10.1. If the workaround doesn't resolve it, let me know and I can help you investigate further. <!-- 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/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?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=This%20is%20a%20known%20issue%20in%20Dify%27s%20workflow%20engine%3A%20the%20Direct%20Reply%20node%20inside%20a%20loop%20can%20show%20duplicated%20data%20if%20the%20output%20template%20doesn%27t%20reference%20the%20loop%20variable.%20This%20happens%20because%20the%20node%27s%20cache%20isn%27t%20invalidated%20between%20iterations%20unless%20the%20loop%20variable%20is%20included%20in%20the%20template%2C%20so%20it%20reuses%20the%20previous%20output%20and%20causes%20duplication%20in%20the%20first%20iteration%27s%20table%20display%20%28even%20though%20the%20exported%20Excel%20is%20correct%29%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/28457%29%5D.%0A%0ATo%20fix%20this%2C%20update%20your%20Direct%20Reply%20node%27s%20output%20template%20to%20include%20the%20loop%20variable%20%28for%20example%2C%20add%20%60%7B%7B%23num%23%7D%7D%60%20if%20your%20loop%20variable%20is%20%60num%60%29.%20This%20forces%20the%20workflow%20engine%20to%20treat%20each%20iteration%20as%20unique%20and%20prevents%20the%20duplication%20bug%20in%20the%20UI%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/28457%29%5D.%0A%0ARecent%20versions%20have%20improved%20loop%20handling%2C%20but%20this%20specific%20issue%20may%20still%20exist%20in%201.10.1.%20If%20the%20workaround%20doesn%27t%20resolve%20it%2C%20let%20me%20know%20and%20I%20can%20help%20you%20investigate%20further.)&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/28796)
Author
Owner

@ErinLqq commented on GitHub (Nov 28, 2025):

Hi @ErinLqq! I'm Dosu and I’m helping the dify team.

This is a known issue in Dify's workflow engine: the Direct Reply node inside a loop can show duplicated data if the output template doesn't reference the loop variable. This happens because the node's cache isn't invalidated between iterations unless the loop variable is included in the template, so it reuses the previous output and causes duplication in the first iteration's table display (even though the exported Excel is correct) [source].

To fix this, update your Direct Reply node's output template to include the loop variable (for example, add {{#num#}} if your loop variable is num). This forces the workflow engine to treat each iteration as unique and prevents the duplication bug in the UI [source].

Recent versions have improved loop handling, but this specific issue may still exist in 1.10.1. If the workaround doesn't resolve it, let me know and I can help you investigate further.

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

Thank you very much for your response. While I haven't been able to resolve this issue yet, I can provide a reasonable explanation for it. Additionally, I sincerely look forward to seeing it addressed in the next version, as it has indeed had some impact on my work. Thank you again for your contributions!

@ErinLqq commented on GitHub (Nov 28, 2025): > Hi [@ErinLqq](https://github.com/ErinLqq)! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. > > This is a known issue in Dify's workflow engine: the Direct Reply node inside a loop can show duplicated data if the output template doesn't reference the loop variable. This happens because the node's cache isn't invalidated between iterations unless the loop variable is included in the template, so it reuses the previous output and causes duplication in the first iteration's table display (even though the exported Excel is correct) [[source](https://github.com/langgenius/dify/issues/28457)]. > > To fix this, update your Direct Reply node's output template to include the loop variable (for example, add `{{#num#}}` if your loop variable is `num`). This forces the workflow engine to treat each iteration as unique and prevents the duplication bug in the UI [[source](https://github.com/langgenius/dify/issues/28457)]. > > Recent versions have improved loop handling, but this specific issue may still exist in 1.10.1. If the workaround doesn't resolve it, let me know and I can help you investigate further. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/de93e275-d4e9-423c-91d3-d3e20348630e?feedback_type=other) > > [![Chat with Dosu](https://camo.githubusercontent.com/7c571478962a6b8a5d47cac74b6824c75e4f6731bba52377e6007f9150462923/68747470733a2f2f646f73752e6465762f646f73752d636861742d62616467652e737667)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github) [![Open in Cursor](https://camo.githubusercontent.com/bdf7dbded65ee585887f47e5fd6fa099ea0933088b4b03d02e83b4def50154d4/68747470733a2f2f646f73752e6465762f646f73752d696e2d637572736f722e737667)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20issue%20in%20Dify%27s%20workflow%20engine%3A%20the%20Direct%20Reply%20node%20inside%20a%20loop%20can%20show%20duplicated%20data%20if%20the%20output%20template%20doesn%27t%20reference%20the%20loop%20variable.%20This%20happens%20because%20the%20node%27s%20cache%20isn%27t%20invalidated%20between%20iterations%20unless%20the%20loop%20variable%20is%20included%20in%20the%20template%2C%20so%20it%20reuses%20the%20previous%20output%20and%20causes%20duplication%20in%20the%20first%20iteration%27s%20table%20display%20%28even%20though%20the%20exported%20Excel%20is%20correct%29%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/28457%29%5D.%0A%0ATo%20fix%20this%2C%20update%20your%20Direct%20Reply%20node%27s%20output%20template%20to%20include%20the%20loop%20variable%20%28for%20example%2C%20add%20%60%7B%7B%23num%23%7D%7D%60%20if%20your%20loop%20variable%20is%20%60num%60%29.%20This%20forces%20the%20workflow%20engine%20to%20treat%20each%20iteration%20as%20unique%20and%20prevents%20the%20duplication%20bug%20in%20the%20UI%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/issues/28457%29%5D.%0A%0ARecent%20versions%20have%20improved%20loop%20handling%2C%20but%20this%20specific%20issue%20may%20still%20exist%20in%201.10.1.%20If%20the%20workaround%20doesn%27t%20resolve%20it%2C%20let%20me%20know%20and%20I%20can%20help%20you%20investigate%20further.) [![Join Discord](https://camo.githubusercontent.com/7d2066700925db1e370d956834f9ea0e5bc92cecbe84963fbd2a363e45091b4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/a8bd7f3fcf3f5e3bd124eee9ae50ae2ac17b40971726665ac2121d48f9aee155/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/28796) Thank you very much for your response. While I haven't been able to resolve this issue yet, I can provide a reasonable explanation for it. Additionally, I sincerely look forward to seeing it addressed in the next version, as it has indeed had some impact on my work. Thank you again for your contributions!
Author
Owner

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

Hi, @ErinLqq. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a duplication bug in the Direct Reply node inside a loop in Dify v1.10.1.
  • The UI output table duplicated the first iteration's data, while the exported Excel was correct.
  • The root cause was identified as the node's cache not invalidating between iterations unless the loop variable is included in the output template.
  • Adding the loop variable to the output template resolves the UI duplication issue.
  • You acknowledged the explanation but had not yet resolved the issue on your side.

Next Steps:

  • Please confirm if this solution works for you with the latest version of Dify or if the issue persists.
  • If no further updates are provided, I will automatically close this issue in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 29, 2025): Hi, @ErinLqq. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a duplication bug in the Direct Reply node inside a loop in Dify v1.10.1. - The UI output table duplicated the first iteration's data, while the exported Excel was correct. - The root cause was identified as the node's cache not invalidating between iterations unless the loop variable is included in the output template. - Adding the loop variable to the output template resolves the UI duplication issue. - You acknowledged the explanation but had not yet resolved the issue on your side. **Next Steps:** - Please confirm if this solution works for you with the latest version of Dify or if the issue persists. - If no further updates are provided, I will automatically close this issue in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20616