-
-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Iteration node preserves array structure in output #6091
Description
Feature Description
The iteration node operates on a JSON structured array on an element-wise basis, but outputs a different structure, either an aggregated user message or as a separate array for every output.
It would be very helpful for our project to generate complex multi-section documents that have dynamic sectioning between cases for the iteration node to be able to intake an array of "n" elements and to output an array of "n" elements, where an element "i" of the output array corresponds to the output of one or more agents inside the iteration node after processing the "i"th element of the input array.
The result of this will be a stable array structure that can be passed through multiple iteration nodes at different steps in a process, shared in a flow state between different agents, and/or for a meta-process for document preparation to be imposed by section ordering.
Feature Category
New Node/Component
Problem Statement
We are working on a project to use flowise to automate the preparation of large documents that exceed 30+ pages of text that is subject to strict compliance requirements. We have developed a meta-process that improves the quality of these steps and have identified the iteration node as a great option to process prompts in a serial way, that differs from sequential agents by being able to handle changes in the section number. For example, we often prepare documents with between 7 and 45 sections, each with different instructions for preparation based on the section type. The iteration node handles this naturally, while using sequential agents is less flexible or robust.
The problem is that the iteration node doesn't prove many options for handling outputs from the loop. In particular, it doesn't allow the structure of the input array to be preserved in the output.
In analogy to a deterministic operation, say, Output(m,n) = FInput(m,n), the element in Output at (1,i) = FInput(1,i). It seems that, at this time, flowise does not permit the iteration node to produce Output(m,n)
Proposed Solution
The solution I have in mind would be an output option in for an agent node or llm node that is within an iteration node, or an option for the iteration node itself, to control how output from the node is structured. This could be an option to "preserve input array structure in output" or something like that, where the node outputs a JSON structured array that has elements corresponding to the result of processing the input elements of the array in the same order in the output array.
Mockups or References
No response
Additional Context
No response