Allow the AI Agent in N8N workflow to call multiple tools, using outputs from one tool as the input when calling the other tool to complete the task

Describe the problem/error/question

The AI Agent is unable to use multiple tools to finish the task asked by the user.


As indicated by the screenshot, the workflow is using three tools, which are:

  1. Get UDAS Admin Users
  2. Get UDAS request created by Users
  3. Construct the UDAS url

And the user query is: “What are the urls of the OPEN UDAS requests from current UDAS admin user?”. To answer this question, it requires AI Agent to call these three tools in a row, using the output of previous tool as the input of the current tool. However, it seems the AI Agent can only call ONE tool at a time:

But the interesting part is, the input to the tool being called contains the correct reasoning:

{
  "query": {
    "request_ids": "[get_udas_request_created_by_user(email=get_current_udas_admin_user_info()['email'], status='OPEN')['request_ids']]"
  }
}

The sequence to call the tools are correct, but it seems the AI Agent failed to call multiple tools continuously to complete the task. What is the best solution to this issue?

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

Information on your n8n setup

  • n8n version: 1.88.0
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Apple Silicon OS

Hello @S_L

Wherever there is a section in Portuguese, please translate it into your language, because I don’t speak English, so I need to translate your question, understand it, answer it, translate it back and post it in the community

Below is a suggestion to help you with your issue.

Open a separate workflow to test, enter your credentials and required information.

I hope this has helped in some way.

If this suggestion solved your issue, please mark my post as a solution (blue box with check mark) so that this ongoing discussion does not distract others who want to find the answer to the original question and click the heart. Thank you :+1:

Hey @interss thanks for helping with this! However, I don’t quite understand the suggestion. I have no issues on the credentials as the model I am using is free version from ollama.

The issue I am running into is, to finish a task, the AI agent needs to call THREE tools I defined, using the output from one tool as the input to call another tool, generate the final result, and return to the users. But now, it seems AI Agent can only call ONE tool during each execution.

Any further suggestions are highly appreciated!


Hello
Good evening.

Open the options in your AI Agent and change this parameter.

See if increasing your interactions solves your problem.

I am at your disposal