Create Microsoft Teams AI Chatbot to Interact with Database

Hi All,

I am looking to create a chatbot in Microsoft Teams that can answer questions about my MySQL database. Is this possible? I basically just want to integrate Teams into David Roberts’ workflow here: Chat with a database using AI | n8n workflow template

I was able to get it to work with just a chat input and not Teams but I am pretty new to n8n so I’m unsure how to properly integrate Teams into it.

Additionally, would it be possible for this Teams “bot” to read content from a Microsoft Word document that I send it?

n8n version: 1.36.4

Thanks!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @maxg! Thanks for reaching out and being a part of the community! :tada:

Great question. You can certainly configure it to work within Microsoft Teams.

First, you would want to set up an outgoing webhook in Teams. You would use the webhook url provided by a webhook trigger in n8n to fill in the callback url required by Teams. That would get incoming messages from teams to trigger the workflow.

Next, you’d want to connect the SQL Agent to your MySQL db. Once you add your MySQL Credentials then you would just need to update the prompt to be the output of your trigger node (formatted for your needs).

Hope all this helps! Happy building!

Hi @Ludwig,

Thank you! I actually got the webhook to work and pass the Teams message into the AI but am now just having issues having the respond to web hook return me the correct answer on Teams. I have gotten the correct output from the AI agent node but am unable to receive it back on teams.

Do you know why this is happening? I am just getting the message “Sorry, there was a problem encountered with your request” from the bot on Teams.

Thanks!

@Ludwig Sorry for the multiple replies. I was able to get it to work for simple questions however the Microsoft teams bot sends “Sorry, there was a problem encountered with your request” whenever the web hook response takes more than 5 seconds. Do you know if there is a way to get around this?

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

Hello maxg, I’m facing the same challenge!
If you could share how you handled it, I would really appreciate it.