I don't get data to my subworkflow

I don’t get data to my sub-workflow

I made a workflow where an ai agent answer back if a user send a massage in Telegram. Everythings works fine. But when I want to ad “Call n8n workflow tool” and try to connect my sub-workflow, the data does not come through. (I used a simple description: “Use this tool to search the web, wikipedia, hackernews and up-to-date information”) I dont know what to do

No fields - item(s) exist, but they’re empty

1 Like

Hi @Andras_Turnai
I wouldn’t treat this as the data “not coming through.” I’d treat it as the tool not having a defined input contract yet. Once you define the field on the trigger, the agent has something concrete to send, and the sub-workflow should start receiving it normally. What I would do is change the sub-workflow trigger from Accept all data to Define using fields below and add a field like query or input as text. Then go back to the Call n8n Workflow Tool node and pass that field from the agent, either with the AI-fill button or with something like {{ $fromAI(‘query’) }} if you want the model to populate it dynamically. Inside the sub-workflow, read it as {{$json.query}}.

Hi @Andras_Turnai your flow seems fine, you just have to execute the search_agent AI tool and then in the executions list of your sub workflow see what data comes and then you have to address that data into the further streams of your sub workflow and then everything would work fine, no need to manually define data into the subworkflow execute trigger, just see what comes as data in the past executions of the sub workflow and map it further to its fields and it would work just fine.

I tried but in the sub-workflow, the query=[null]

Yeah, I know but I don’t know what to type in the search_agent:

And also, I don’t see any data in the sub-workflow

1 Like

@Andras_Turnai make sure your sub flow is published, type anything in the query field, and once the sub flow will run in background wait until it finishes and there see the logs and there you will get the variables AI agent sends and how, and from there you can actually copy those and move ahead building your sub flow with that value so that whenever the main flow calls the sub flow the value passes down smoothly between further nodes.

1 Like

Yeah I tried what you wrote, but the problem is that I tried everything to get something out of these workflows, but the subworkflow’s only data is [null].

Really have no idea why it doesn’t show any data..

1 Like

@Andras_Turnai send me both of those workflow JSONs i will see the issue and will try to them and will send u back.

I can’t upload documents because I’m a “new user” but I published both of them, maybe it works.

1 Like

@Andras_Turnai no problem you can copy your entire workflow by first selecting everything with CTRL+A and then copying with CTRL+C and then come here click on this + icon in the chat box there you will see an option of preformatted text paste your JSON there and that is it do the same with another workflow, just make sure to clearly explain which one is which.

Also this is not how n8n works my friend, when you publish your flow it does not mean it can be accessed via the world, it only means that the flow will listen and can work without you have to manually trigger it.

I would recommend you read this:

And also if you want to solve your problem alone read this:

I finally managed to upload these documents. Today the web let me upload the documents.

Telegram1 (2).json (6.0 KB)

My Sub-Workflow 1.json (1.1 KB)

Really thank you Anshul_Namdev for your help so far.

Now I found the solution.

The solution was that I had to copy the input of search_agent in JSON format which was something like this:
[

{

“input”: “Deepseek”

}

]

Then I had to go to the sub-workflow and edit the output, and paste the search_agent input. Then it worked.
If you wrote the same before, sorry I misunderstood.
But thank you for your help Anshul_Namdev!:slight_smile:

2 Likes

yeah the issue is that call n8n workflow tool doesn’t know what inputs to send if your sub-workflow trigger is set to ‘accept all data’ mode. the ai agent needs a defined schema to work with. what worked for us was changing the trigger to ‘define using fields below’ and adding an input field like query as text. then in the tool node, pass {{ $fromAI('query') }} so the agent fills it dynamically. inside the sub-workflow, read it as {{ $json.query }}. since you’re hitting query = [null], the agent probably can’t infer what to send — defining the schema fixes that.

@Andras_Turnai Exactly as i have said.. Glad it worked, consider marking that as a solution!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.