From the course: Build AI Agents and Automate Workflows with n8n
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Using a sub-workflow as a tool - n8n Tutorial
From the course: Build AI Agents and Automate Workflows with n8n
Using a sub-workflow as a tool
- [Instructor] Okay, this setup works, but you may have spotted that there's a problem here. You can see it right down here. The number of tokens being passed into the model is really high. And that's because when we call the model, after the Google Sheets lookup, all the information from the sheet is passed back to the AI model. That's okay when we only have 10 entries, but if I switch over to the main sheet with over 100 lines, it becomes an awful lot of data. And this is just an example of a small database. If you imagine a much larger database or much bigger data, passing all that data into the model would not only cause the model to not work properly because there's too much data to parse through, but would also be really wasteful because you're paying per token when you're using any of the APIs for these AI models. And passing in tons of wasted tokens is wasted money and wasted energy. To fix this, we somehow have to get the agent to tell Google Sheets to only return the…
Contents
-
-
-
Introducing n8n2m 6s
-
The Plan: An AI-powered Slackbot managing a Google Sheet2m 30s
-
(Locked)
Creating a new n8n workflow with a trigger1m 55s
-
(Locked)
Adding an AI agent and a chat model5m 28s
-
(Locked)
Adding a tool to the AI agent4m 47s
-
(Locked)
Using a sub-workflow as a tool4m 48s
-
(Locked)
Using the filter node to modify data4m 51s
-
(Locked)
Creating an MCP server in n8n4m 41s
-
(Locked)
Adding tools to the MCP server3m 50s
-
(Locked)
Creating a Slackbot2m 56s
-
(Locked)
Authenticating Slack3m 31s
-
(Locked)
Adding a Slack trigger2m 16s
-
(Locked)
Sending messages to Slack2m 27s
-
-