Aller au contenu principal

Working with Lists

Most AI-FLOW nodes receive and emit single items. When you need to pass several items at once—multiple images, Strings, URLs, etc.—you can turn any compatible field into a list. Lists simplify your graphs, reduce node clutter, and unlock looping in subflows.

1. Turning a Field into a List

Example: Sending several images to a single GPT node.

  1. Default (single-item) setup – add extra image fields and connect each to its own File Upload node. Three separate image inputs

  2. List setup – convert the image field to a list, then connect one List node that outputs an array of files. Single list input

Comparison: Without List VS With List

2. Iterating with Lists + Subflow Loops

Lists pair perfectly with Subflow Loop to run the same logic over every list element.

ScenarioSetupWhat Happens
Single list (iterate over images)Select image as the loop-over field.The subflow runs once per image; the prompt stays constant. Loop with list example
Parallel lists (images + prompts)Provide two lists, choose image and prompt as loop-over fields.On each iteration the node receives image [i] and prompt [i]. Loop with two list as inputs

Result preview: Loop result

Tip: Two nodes—one List and one Subflow Loop—often replace half a dozen manual connections.

3. Nodes That Return Lists

These nodes can output arrays directly, making chaining easy:

  • Subflow Loop (collects iteration results)
  • Data Splitter
  • Regex Extract
  • JSON Tools and List Tools
  • Google Search

4. When a Field Doesn’t Accept Lists

If you feed a list into a field that expects a single item:

  • AI-FLOW serialises the list to plain text (JSON).
  • The receiving node may throw a type error (e.g., if it needs a file URL) or just treat the text literally.

5. Lists Are JSON Under the Hood

Every list travels through the graph as standard JSON. Leverage JSON Tools to:

["image1.png", "image2.png", "image3.png"]
  • filter, map, or reduce elements
  • merge or split arrays
  • transform structures for downstream nodes

List and JSON Tools

Key Takeaways

  1. Convert, don’t duplicate. One list field is cleaner than many single-item fields.
  2. Loop smart. Combine List nodes with Subflow Loop for effortless iteration.
  3. Mind compatibility. Pass lists only to fields that understand them.

Use lists well, and your AI-FLOW pipelines stay compact, readable, and scalable.

Additional Resources

For more advanced configurations and detailed guidance, refer to the following resources: