Hey everyone,
I’m using a template for a newsletter automation workflow that includes a Tavily subworkflow for live search. The structure includes a main flow and a subworkflow (called “Tavily Tool”) triggered using “When Executed by Another Workflow”.
The Tavily node in that subworkflow uses this JSON expression:
{
“api_key”: “my_key”,
“query”: “{{ $json.query.replace(/”/g, ‘\"’) }}",
“search_depth”: “basic”,
“include_answer”: true,
“topic”: “news”,
“include_raw_content”: true,
“max_results”: 3
}
Everything matches the original template exactly, but when I test the Tavily node, I get this error:
Bad request - please check your parameters
Query is missing
In the subworkflow, the input node (“When Executed by Another Workflow”) says:
No fields - item(s) exist, but they’re empty.
So clearly, $json.query
is undefined. But the main workflow should be passing it in — the original template seems to work without hardcoding anything.
What I’ve tried:
- “Accept all data” and “Define fields” — no difference.
- Added mock data to test the subworkflow — that works, so the issue is upstream.
- Confirmed API key and JSON are valid.
How do I make sure the query
field from the main workflow is actually passed into the subworkflow properly?
Would really appreciate help — thanks!