Auto Chatbot for a Website – Collect Customer Info & Redirect to Support

Describe the problem/error/question

Hi there,

I’m building a chatbot in n8n using ChatGPT and want to automatically collect users’ information (name, email, contact number) and send an email to our support team if the bot doesn’t know the answer.

The chatbot should send an email to our team if it cannot answer a question, using the following format:

Subject: Customer Inquiry – [User’s Name]
Name: [User’s Name]
Contact Number: [User’s Contact]
Email: [User’s Email]
Question: [User’s Question]

I’ve tried a few approaches, but I still have no idea how to make it work. Any guidance would be appreciated!

What is the error message (if any)?

Please share your workflow

“”
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version: 1.81.4
  • Database: SQLite
  • n8n EXECUTIONS_PROCESS setting: own, main
  • Running n8n via npm
  • Operating system: ubuntu

Hey there,

You’ve doing great so far.

I have built something similar before, but with Whatsapp as the chat module.

What worked for me was I created very detailed prompt for the LLM in which you have to clearly explain to it what its role is and what the tools are it has at its disposal and when and how to use them.

In your case you should have an email tool also attached, and in your prompt explain that if it cannot find the answer for the customers from Pinecone, it needs to use the email tool to email to case to your support.

You will need to collect the details of who the user is from the chat, I would start the support chat with a form, and pass that into the LLM, and in your prompt instruct it to pass these detail on via the email tool.

When the email tool has been executed you will need to explain to the LLM to reply to the customer that their request has been escalated etc…

Let me know fi this helps or if you need further help.

Thanks for replying!

I’m new to automation and am trying to build this for my company, so I’m not sure if I fully understand your reply.

FYI, the problem I’m facing right now is that I’m trying to build a workflow where the website chatbot can handle customer service entirely on its own. It should only send an email to us when it doesn’t know how to reply (i.e., when there’s no answer in the vector store).

So far, my AI chatbot works well, but when it needs to pass personal info to customer service, I’m unsure of the right way to collect user details such as name, email, and phone number. I don’t know which node I should use for this.

I’ve trained my AI to request this information when it can’t find an answer in the vector store, but the issue is that the collected data is just output text instead of being stored properly as structured fields like userName.

I’ve tried your solution, which is using a form node, but it seems like this has to be placed at the beginning, right? (Correct me if I’m wrong.)

Can anyone please help me? Thank you in advance!

1 Like