Iteration Node Returns Empty Output When Parallel Mode Is Enabled
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.6k
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 610
Description
### 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.16.1
### Cloud or Self Hosted
Cloud
### Steps to reproduce
## Description
When running an Iteration node (e.g. "Retrieve Tyre Info") with an HTTP/code sub-step that queries external data, the node produces correct results when Parallel Mode is disabled, but returns an empty/null output array when Parallel Mode is enabled with the same input and configuration.
## Steps to Reproduce
1. Create a workflow containing an Iteration node that takes **Array[Object]** as Input and outputs **String** as Output Variables.
2. Leave Parallel Mode toggled off, and set Error Response Method to "Continue on Error".
3. Run the workflow. Check the Last Run tab: Status is Success, Elapsed Time ~2.0s, and Output contains the expected array of results.
4. Go back to Settings and toggle Parallel Mode on (Maximum Parallelism set to 10, default). Keep all other settings identical.
5. Run the workflow again with the same input.
6. Check the Last Run tab: Status still shows Success and Elapsed Time ~3.1s, but Output is `{ "output": [null] }` — no data is returned.
## Environment
- Product: Dify (Cloud)
- Node type: Iteration
- Affected setting: Parallel Mode (Maximum Parallelism: 10)
- Error Response Method: Continue on Error
## Additional Context
Screenshots showing both configurations (Parallel Mode off/on) and their respective Last Run results (Settings + Last Run tabs) are attached, demonstrating the same workflow and input producing valid output in sequential mode and `null` output in parallel mode.
### ✔️ Expected Behavior
Enabling Parallel Mode should not change the correctness of the Iteration node's output. The node should return the same result data as in sequential (non-parallel) mode, just executed concurrently.
### ❌ Actual Behavior
With Parallel Mode enabled, the Iteration node reports Success but the output array only contains `null`, meaning the sub-step results are lost or not being collected/aggregated properly in parallel execution.
Contributor guide
Research direction
Reproduce the workflow with the Iteration node, an Array[Object] input, and the HTTP/code sub-step in both sequential and parallel modes. Start by tracing the Iteration node's parallel execution and output collection, then verify that parallel mode returns the same result array rather than [null].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100