From the course: Build AI Agents and Automate Workflows with n8n

The Plan: An AI-powered Slackbot managing a Google Sheet - n8n Tutorial

From the course: Build AI Agents and Automate Workflows with n8n

The Plan: An AI-powered Slackbot managing a Google Sheet

- Okay, here's the plan. Imagine an organization with hundreds of volunteers and managers who want to gain access to information about the volunteers as easy as possible. All the volunteer information is in a spreadsheet, but there's a lot of it, and the organization uses Slack for internal communication. I want to build a Slack bot that takes natural language queries from the users, goes to n8n, and uses an automation process to retrieve information from the spreadsheet and also update information in the spreadsheet when necessary. That is not a straightforward process, because natural language queries can take many different forms, and this is one of the places where AI excels. Because AI can work as an interface between us humans, our language, and our data to interpret the intent of our queries and turn it into something the data system can use, and that is one of the things n8n is really good for. We start with a message from Slack, then we analyze the intent of the request and find out, is this an info request, is it an update request, or is it out of scope? Then based on that information, we either go to the Google Sheet and retrieve information, or go to Google Sheets and update the information, or create some sort of response saying, "Hey, I don't have this information," or, "Your question is out of scope," and send it back to Slack. Now, this workflow is intimidating. The good news is, that's not what we're building. Here's the workflow we'll build. It does the same things, but leans on the capabilities of the AI language model to perform all those complicated actions. This agent workflow takes a Slack message, passes it into an agent that uses OpenAI's chat model to process information, then it calls in an MCP client that has two tools, one workflow tool to filter information from the Google Sheet and another tool to update the Google Sheet. Based on the query coming in from Slack, the agent retrieves information, updates information, and does whatever else is requested, and then passes the response back the Slack again. This workflow, looks simple, is a little more complex than what you see right here, which is why I'm using it as an example in this course, and showcases how much we can lean on AI to solve complex problems when we're working with natural language. But enough talk, let's actually build this.

Contents