-
-
Notifications
You must be signed in to change notification settings - Fork 24k
Description
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:
Showing Iteration working with JSON Array, no error messages:
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
- Create an Iteration Node with a JSON array of objects as input
- Add a Tool Node inside the Iteration Node
- Configure the Tool Node with a custom tool
- Set the Tool Input Argument Value to
{{ $iteration }} - Execute the workflow
- 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: