tauist
November 6, 2025, 7:56am
1
Describe the problem/error/question
when in the ai tool node, it gets schema from the subworkflow.
e.g.
{
“name”:“string”,
“school”:"string
}
both query field are optional.
However, when ai input school as filter or not input anything, it shows
Received tool input did not match expected schema
Seems all field becomes mandatory. So how to make the schema field as optional input?
Thanks!
{{ $fromAI(“field1”, “Description for field1”, “string”) }}
{{ $fromAI(“field2”, “Description for field2”, “string”) }}
And clear instructions in the system prompt.
There are several ways.
Another way define in subworkflow trigger defined in json and omit the required fields :
{
“type”: “object”,
“properties”: {
"name": { "type": "string" },
"search_pattern": { "type": "string" }
},
“required”: [“name”] // “search_pattern” is optional
}
robtf9
November 6, 2025, 9:18am
3
The way I’ve done it in this is to tell the AI to just add an empty string if there is no filter. Above is an example where I conditional need a metadatafilter for a vector store.
1 Like
system
Closed
November 14, 2025, 2:45am
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.