Workflow Inputs Empty on Execution (Works in Test) - n8n AI Tool Agent Issue?

Hi! I’m having an issue with n8n workflow inputs.

  • In edit mode and manual tests, everything works fine. Inputs are populated correctly, and I get the expected response.
  • But in live execution, the workflow inputs are empty, causing this error:
    Cannot read properties of undefined (reading 'toString')

Here’s the setup:

  • An AI Tool Agent outputs a query string like:
    cotizacion: cambio de aceite, nombre: Yerko, telefono: +56 982750122...
  • Then, the gestor_cotizaciones workflow calls a sub-workflow, but inputs are not mapped as expected during execution.

Anyone faced something similar? How did you fix it?

Thanks in advance!



Hey Yerko, how’s it going?

Since I don’t have your full setup in front of me, I’m gonna make an educated guess based on the error and the screenshots you shared.

From what I can see, the issue happens when your main workflow calls the cotizador sub-workflow. It works fine in manual test mode, but during live execution the inputs show up empty — and that’s why you’re getting the Cannot read properties of undefined (reading 'toString') error.

That usually happens when the sub-workflow expects a value (like patente_lead) but doesn’t receive it properly at runtime.

It could be:

  • The AI Agent is sending the data in a different format than what cotizador expects (maybe as a raw string instead of an object).
  • The sub-workflow call isn’t mapping the inputs right — maybe it’s expecting direct values but getting something nested.
  • Or one of the fields is coming in as null or undefined, and your flow tries to do a .toString() on it without checking first.

Here’s what I’d try:

  1. Run the flow in debug mode and look at what’s actually being passed in right before calling the sub-workflow.
  2. Make sure all the inputs that cotizador expects are really present in that payload.
  3. If needed, use a Set or Function node to reshape the data before sending it to the sub-workflow.

If you can share the actual JSON coming from the AI Agent or show how your sub-workflow node is configured, I can help fine-tune it for you.

Hope that helps!

– Dandy

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