My agent is not being able to send the correct information after checking google sheets

Describe the problem/error/question

Me again, this time I fixed the problem with AI Agent not looking into google sheets, however now it is unable of retrieving the list of business days that I saved.

What is the error message (if any)?

When the message ask for the list of business hours, my agent looks into the business hours spreadsheet successfully, however it comes back with an empty value and it gives an answer saying it wasn’t able to retrieve the information, here is part of the prompt:

GENERAL INQUIRIES HANDLING

  1. IF THE CLIENT ASKS ABOUT BUSINESS HOURS (EXAMPLE: “QUAIS SÃO OS HORÁRIOS DA CLÍNICA?”)
    • CHECK GOOGLE SHEETS (‘HORARIO DE ABERTURA’) ONLY ONCE.
    • If business hours data is found, reply with:
      "Os horários da clínica são os seguintes (sujeitos a alterações):  
      **Segunda a Sexta:** [Horário de Abertura] - [Horário de Fechamento]  
      **Sábado:** [Horário de Abertura] - [Horário de Fechamento]  
      **Domingo:** [Horário de Abertura] - [Horário de Fechamento]
      Caso precise de um horário específico, posso te ajudar! 😊"
      
    • If business hours data is missing/unavailable, provide a fallback response instead of retrying:
      "Desculpe, no momento não consegui acessar os horários atualizados da clínica.  
      Você pode confirmar ligando diretamente para a recepção. Posso te ajudar com mais alguma coisa? 😊"
      
    • STOP HERE. DO NOT CHECK HOLIDAYS OR APPOINTMENTS.

Please share your workflow

Share the output returned by the last node

Human: 2025-03-23T11:55:27.455-03:00quais os horarios?abd3d4b28aec4a94a85a1bf029a43b93

AI: Desculpe, no momento não consegui acessar os horários atualizados da clínica. :confused: Você pode confirmar ligando diretamente para a recepção. Posso te ajudar com mais alguma coisa? :blush:

My expected result is:

“Os horários da clínica são os seguintes (sujeitos a alterações):
Segunda a Sexta: [Horário de Abertura] - [Horário de Fechamento]
Sábado: [Horário de Abertura] - [Horário de Fechamento]
Domingo: [Horário de Abertura] - [Horário de Fechamento]
Caso precise de um horário específico, posso te ajudar! :blush:

Information on your n8n setup

  • n8n version: 1.83.2
  • Database: default
  • n8n EXECUTIONS_PROCESS setting: default
  • Running n8n via: Docker compose
  • Operating system: Linux Ubuntu

Have you tried the AI Agent node over the openai AI node?

Yes I had… But its the same result.

What about testing one tool at a time? Remove all the others to confirm each work correctly individually.

You should also largely improve all the tool call descriptions, same with the assistant prompt.

I would also try without a custom assistant, and just a custom prompt.

1 Like

You are right. Without tweaking and testing most of the time results are sub-par and like throwing a dice

I observed that all the google sheet tools are failing, tried to used them one by one and the model is effectively checking into them but the response comes empty which results in this failure. If I run this test straight into OpenAI playground it works just fine, but when done here it doesnt… I tried plugging the spreadsheet straight into the main agent (adjusting the prompt beforehand) and I tried summoning the sheet from the other agents and nothing worked.

Are they erroring? Or what do you mean by “not work”?