Skip to content

Tool Node inside Iteration Node fails with schema error when using {{ $iteration }} variable from JSON array of objects #5364

@LarsEbt

Description

@LarsEbt

Tool Node inside Iteration Node fails with schema error when using {{ $iteration }} variable from JSON array of objects

Description

When a Tool Node is placed inside an Iteration Node, it cannot accept the {{ $iteration }} variable as input when iterating over a JSON array of objects. The error Error: Received tool input did not match expected schema occurs. This issue only happens with JSON arrays of objects - simple arrays work fine.

Current Behavior

The Iteration Node successfully processes JSON arrays containing objects:

[
  {
    "produktName": "Wireless Gaming Maus X-Pro",
    "produktNummer": "WGM-2024-001",
    "preis": 79.99,
    "lagerbestand": 145
  },
  {
    "produktName": "Bluetooth Kopfhörer SoundWave",
    "produktNummer": "BKH-2024-042",
    "preis": 129.50,
    "lagerbestand": 67
  },
  {
    "produktName": "USB-C Ladekabel Premium 2m",
    "produktNummer": "LKB-2024-315",
    "preis": 24.99,
    "lagerbestand": 523
  }
]
  • When using a Direct Reply node inside the iteration, {{ $iteration }} correctly outputs individual objects (one complete product with all its properties per iteration) ✅

  • When using a Tool Node inside the iteration with {{ $iteration }} as an input argument value, the tool fails with: Error: Received tool input did not match expected schema

Screenshots

Iteration not working:

Image

Showing Iteration working with JSON Array, no error messages:

Image

Expected Behavior

The Tool Node should accept {{ $iteration }} as input when iterating over JSON objects, just like the Direct Reply node does. The current iteration's object should be passed to the tool in a format that matches the expected schema.

Steps to Reproduce

  1. Create an Iteration Node with a JSON array of objects as input
  2. Add a Tool Node inside the Iteration Node
  3. Configure the Tool Node with a custom tool
  4. Set the Tool Input Argument Value to {{ $iteration }}
  5. Execute the workflow
  6. Observe the schema validation error on the Tool Node

Comparison

  • Simple arrays (e.g., [1,2,3,4,5]): Work correctly with Tool Node ✅
  • JSON object arrays: Fail with schema error when used with Tool Node ❌
  • Direct Reply node: Works correctly with both simple and JSON object arrays ✅

Environment

Use Method: Self-hosted Enterprise
Flowise Version: v2
Operating System: Windows
Browser: Chrome

Additional Context

here is the example flow from the screenshots and the custom tool:

Testing-CustomTool.json
Bug Reporting Agents.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentflowIssue related to agentflowbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions