Describe the problem / error
I’m working on a multi-agent workflow in n8n where:
- Summarize Agent generates a
summary_html(department-based meeting summary). - This
summary_htmlis sent to CreatingPDF Tool to generate a PDF (works fine). - After the user writes “onaylıyorum” (I approve) in the chat, Coordinator Agent should trigger EmbeddingTool (a tool workflow) to chunk and embed the
summary_htmlinto Supabase.
The problem: The correct summary_html from Summarize Agent never reaches the EmbeddingTool correctly.
What is happening now
- When Coordinator Agent triggers EmbeddingTool, the data arrives like this:
json
KopyalaDüzenle
[
{
"query": {
"summary_html": "<html> <head> <title>Meeting Summary</title> … </html>"
}
}
]
- But EmbeddingTool’s Code node expects
summary_htmlat the root level like this:
json
KopyalaDüzenle
{
"summary_html": "<strong>Üretim & Tedarik</strong><br><ul> … </ul>"
}
Because of this mismatch, chunking code inside EmbeddingTool doesn’t run on the correct HTML and breaks the semantic structure.
What is working fine
- Summarize Agent is producing the correct
summary_html(with<strong>Department</strong>, “Rutin Konular” and “Projeler” sections). - CreatingPDF Tool successfully gets the correct HTML because it uses this expression:
bash
KopyalaDüzenle
{{$fromAI('summary_html', '', 'string')}}
- PDF creation works as expected.
What I tried
- I copy-pasted the same expression from CreatingPDF Tool into EmbeddingTool input mapping:
json
KopyalaDüzenle
"summary_html": "={{ $fromAI('summary_html', '', 'string') }}"
- But this causes the value to arrive wrapped in
query.summary_html, not as plainsummary_html. - I also tried replacing the expression with:
bash
KopyalaDüzenle
{{$json.summary_html}}
But Coordinator Agent still sends the same “query” wrapped object.
What I need help with
How can I pass the raw summary_html (generated by Summarize Agent) directly to EmbeddingTool, without it being wrapped inside query or other objects?
- Should I change the way
fromAI()is used? - Should I remap the output of Summarize Agent before calling EmbeddingTool?
- Is there a best practice for sending a raw string field like
summary_htmlfrom one Agent Tool to another Tool Workflow in n8n?
Workflow Context
- Summarize Agent → outputs
summary_htmlcorrectly. - CreatingPDF Tool → works fine with
$fromAI('summary_html', '', 'string'). - Coordinator Agent → triggers EmbeddingTool after user approval.
- EmbeddingTool → expects
summary_htmlat root, but receives{ query: { summary_html: … } }.
What I’m looking for
A way to flatten or remap the summary_html field so EmbeddingTool receives it exactly as:
json
KopyalaDüzenle
{
"summary_html": "<strong>Üretim & Tedarik</strong> …"
}
and not wrapped under query.summary_html.
Any guidance, examples, or best practices would be greatly appreciated!