Create ai agent that emails me when it can't answer the question

I’m trying to create an ai agent that answers questions based on my database (like a customer support representative) and when it doesn’t know the answer to a question, it emails me with the customer’s email, question, and the conversation thread.

I’ve setup this workflow in n8n and it answers questions based on my database. If it doesn’t know the answer, it responds to the customer with “Let me have someone on the team look into this and we will get back to you ASAP. What email would you like us to follow up with?”. This is what currently works.

However, I can’t figure out how to get it to email me whenever someone asks a question that it doesn’t know the answer to. How do I make it do this too?

Here is my current workflow:

As you can see, I’ve tried setting up an If node after the Q&A chain but that ends up with the following response in the Q&A section: [No response. Make sure the last executed node outputs the content to display here]

I’ve also tried using a different type of AI Agent (shown at top of workflow) but that didn’t work either.

Information on your n8n setup

  • n8n version: 1.63.4
  • Database (default: SQLite):not sure
  • n8n EXECUTIONS_PROCESS setting (default: own, main):not sure
  • Running n8n via (Docker, npm, n8n cloud, desktop app):Self hosted at https://n8n-532.workflowapp.ai/
  • Operating system:MacBook Pro 2020

Hi @Andrew_Sutton,

Welcome to the community! :tada:

One way of doing this could be to use the AI Agent and connect both the Vector Store and a Send Email tool to the same AI Agent like this:

I’ve tested this out and seems to work for me alright, although it’s not 100% reliable when it comes to when the Agent decides to forward the request. Try it out and let me know if this helps for what you have in mind!

Hi @aya,

Thanks for this idea! I was able to get the email to send when it didn’t know the answer but the AI agent didn’t collect their email so there is no way for me to respond to them.

Do you know how to get it to collect their email first?

Also, it didn’t include the entire conversation so there probably won’t be enough context for me to answer the question.

Do you know how I can make sure the email includes the entire conversation?

1 Like

Hi @Andrew_Sutton,

Sorry about the late reply. There’s s similar post in the forum with a workflow example that uses the Workflow Tool and a Memory Manager node:

Maybe that’ll help!

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