📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Воркшоп: "MCP в n8n. Превращаем любой workflow в MCP"

Codex Town Club58:00

Transcription

Hello everyone. It's Friday again, and it's Codecon again. Today we have another practical workshop, which I hope will take no more than half an hour of your valuable pre-weekend time and will be useful for everyone who uses N8N but, for some reason, perhaps doesn't keep up with all the new features that have become very, very frequent lately. The last update came out just 2 days ago and brought with it some very useful functionality for everyone who deals with agents. And in general, N8N continues to develop not so much as an automation tool, but rather as a full-fledged means for creating agents. And so, essentially, a significant part of the functionality that has been added in some recent updates is literally dedicated to this. And, in fact, we will talk about it today. And although our topic sounds like MCP in N8N, we will talk not only about this, but also about a couple of other features that, as I said, were added just 2 days ago and which, well, significantly change, well, not change, but optimize the process of preparing agents, which precisely turns N8N into a full-fledged and incredibly powerful platform. So, first of all, we will talk about our topic today. What is MCP? How does it work? We'll go through it briefly. I understand perfectly well that the topic is not new. There are a huge number of videos on the internet that you can watch on this topic, so we will focus on more specific things. We will talk about how any Workflow can be turned into an MCP server, how N8N can work as an endpoint for MCP servers, which can be used from within, say, Cursor, from within Claude Desktop, and so on. We will look at how MCP can be used to expand the capabilities of agents. And then we will talk a little about this very, well, magical, in my opinion, thing, because for a long, long time, over the past eight months, there have been talks, ever since we started touching N8N, questions arose: "Can't the process of creating these workflows be automated?" And even though quite a lot of services, even paid ones, appeared on the internet, claiming that they could now generate these workspaces automatically using ChatGPT, until recently, no one had managed to do it fully. Until recently. Today, we will analyze one of the free, open-source, self-hosted products that allow automating this entire process. Well, and finally, we will talk about two important new features that, as I said, significantly optimize the process of creating agents and eliminate all the headaches with a large number of nested workflows, and so on and so forth. Well, let's not delay, as I said, we plan to spend no more than half an hour. And let's start by reminding those who, for example, are watching us for the first time, what MCP is. MCP, or Model Context Protocol. It is, well, a protocol for interaction between agents and external services, developed for, as it's fashionable to say now, an LLM First environment. It was developed by Anthropic, so it was originally developed for products like Claude and so on. And in principle, MCP is a protocol that defines how agents can interact with each other and with all these external services through a standardized interface. In essence, it directly says: "Give me this tool, perform this function, return this result." In essence, MCP is a kind of wrapper for the API of practically any service that allows agents to interact with that service. If previously, to connect practically any external product, you had to come up with some kind of custom connection, how to wrap, tweak, and attach the API to an LLM agent, now you don't need to do any of that. Now there is a unified protocol. And most importantly, there are a huge number of ready-made solutions on the internet that you can take, use calmly, and your agents will interact with practically any services out of the box. The number of available MCP servers is increasing literally day by day. There are separate collections, like Awesome MCP and so on. Links to them will be in the description under the video, where you can find a service you like and use it completely calmly. And also, what is important, MCP, despite being developed by Anthropic Corporation, is a universal thing. And in principle, today a huge number of products on the market support this protocol and allow the use of these servers, for example, primarily, of course, from the Claude Desktop program, but also practically from anywhere you can install your favorite Cursor, add, for example, MCP for managing GitHub or Google Drive or Jira tickets, and so on, and in automatic mode, simply ask your agent certain questions and initiate practically any actions. At the same time, what is important, the server itself can be practically anything. It can be, for example, a separate agent, it can be some simple function that performs a single action, or it can be a huge complex system that performs a huge number of functions. For us, all of this is completely irrelevant, because even the agent that we create will communicate with it.

So, what is MCP, I hope I don't need to explain, but if, again, someone is watching us for the first time from this video, N8N is an open-source, self-hosted platform for automating practically anything, including with the help of agents. It is agents that have become the main focus of attention for this platform recently. If you want to understand more deeply how to install it locally, deploy it on your own server, we also have a detailed guide, four different guides. Links will also be in the description under the video. They answer all other main questions. Well, and so, with version 1.9.3, a little over a month ago, N8N introduced native nodes for interacting with MCP. First of all, it's the MCP Server Trigger. Essentially, an entry point for any agents that can now interact at the MCP level with any workflow within N8N. And the second thing is the MCP Client, also a special node that allows agents from within N8N to access practically any arbitrary MCP servers. And now, thanks to these two nodes, practically any of your workflows can be taken and turned into a full-fledged MCP server, which can, for example, be deployed on your own hosting and accessed from, say, a local Cursor. And naturally, you won't have to write a single line of code for this. Let's try a small demo right away. Let's imagine we have some ready-made workflow. Well, for example, the simplest thing. We've written it many times. A regular agent that interacts with a calendar. There's nothing complicated here. A regular agent that, in fact, doesn't even have a system prompt set. Standard Helpful Assistant, standard date passing. And then four tools: create, delete, find, or update events. Again, absolutely everything is automated, we don't do anything. Moreover, recently, automatic parameter filling has appeared in N8N. We specify that all parameters that need to be specified for this node are specified using the model itself. Well, and that's it. And now, if we ask this agent, like, what's my schedule for the weekend, well, we'll see how it, in fact, triggers one of these tools, finds the necessary events, and then simply transforms and shows me what's scheduled for the weekend. A standard, convenient thing, but completely not scalable, because to further interact with this agent at a higher level, we would need to call this workspace itself. And that's not always convenient, because, well, we can only call the workspace from within N8N, or we'll have to add all this hassle with webhooks and so on. Let's standardize all this, especially since we can now do it very, very simply. First, instead of this agent, we can create just an MCP server. For this, we will need that very MCP Server Trigger node. This is essentially a trigger node. It is needed for us to attach a set of tools to it and then call it from any compatible product. Not only N8N, but also, as I said before, Claude, Cursor, or any other product supporting this interface. Inside, everything is quite simple. We immediately get a set of links to call this server. If someone has already worked with MCP, you know perfectly well. MCP is, in fact, a URL first and foremost, to which we need to send these requests. And here N8N gives us the opportunity to get it right out of the box. Then the most basic settings. This is, in fact, the name of our server. It's already pre-installed. We can put something more readable there. Well, let's say "My Calendar". And the authentication option. Since this will all potentially be hosted on the open web, it makes no sense for us to let just anyone in. And here we have the option to set a special token for a second. A special token for authorization, which we can then specify in the settings themselves. We'll talk about the settings a bit later. For now, let's see how it works inside N8N itself. In principle, that's all. And now all we need to do is disconnect our tools from the existing agent and connect them to our MCP server. In principle, that will be enough for the server itself to work. Now, if we, well, let's connect them now. Save and make our workflow active, then this very production URL that we see here will fully work as a server, as our own MCP server. And, for example, we can now take and within any of the applications in the standard interface, again, practically all such applications use the standard connection interface via SSE, that is, Server-Sent Events, essentially, giving us the opportunity to connect it within anything. If we go into the settings, for example, of Cursor, it will be exactly the same configuration file. If we go into the settings, say, of Claude Desktop, it will be exactly the same file where we specify our servers. And here we can simply specify in a similar syntax. So, what do we need here? We need the URL, the production URL of our server. We take it, paste it. And in principle, that's enough, but as I said, for a production scenario, it is necessary to restrict access for, let's say, unauthorized users, and we have the opportunity to specify authorization. Authorization is specified very simply. Here we choose one of the formats for representing this token. We will choose Authentication. And then we will simply need to specify the token itself. The token is not specified for each workflow. The standard N8N authentication scheme is used, i.e., through standard credentials. We go into the selection menu, click "Create New Credentials". And all we need to enter here is, in fact, the token itself. The token, by the way, we come up with ourselves. It can be any sequence of numbers, for example. Well, let's put 1 2 3 4 5 6 7 8 9 here. After that, we save, close, specify this credential in the selection line, and then specify it in the settings of our MCP server. That's it. Then we save this file, and our MCP server is ready, available on the internet, and can be used for anything.

So, let's try to use it. But naturally, we will try it not with an external history, but within the same N8N, because now we can, with the help of all these models, with the help of transforming traditional workflows into MCP servers, we can forget about all this huge mess with when, to create a system of several agents, we had to rack our brains, create a bunch of parallel workflows, each of which used copies of the same tools. Well, in general, those who have encountered this, I think you understand what kind of headache I'm talking about. And now, if we create a multi-agent system, well, for example, if we have a researcher agent, an editor agent, a designer agent, and each of them needs its own unique tools, we can interact with them all very easily using MCP, because now we don't need to duplicate all these tools. Now, it's enough to create a separate MCP server with its own trigger in a separate workflow, and in the agent itself with which we interact, it's enough to add, in fact, a new tool, which has also become available, which is called exactly that, MCP Client Tool, and which, in fact, gives us the opportunity to connect to any arbitrary MCP servers. And, yes, what's important, if, again, you remember, MCP uses two connection formats: STDIO and SSE. N8N currently uses SSE out of the box. There are workarounds that allow connecting practically any servers. There is a special proxy service, we won't analyze it now, but for example, our colleagues on the "Product Council" channel had a good video where they explained how to connect any MCP server to N8N. In essence, you just need to run a small local script that, in fact, translates them. But for us, this is not particularly important, because our topic is still about connecting and transforming N8N Workflows. And here we need the server site. So, the data that we need here is, just a moment, let's check, just a second. 1 2 3 4 5 6 7 8 90 will be our token. And all we need to do here is to add a new tool called MCP Client to any agent. And all we need to do here is, in fact, to perform all the same operations, but in reverse order. Specify the URL that our server gave us, specify the authentication if we need it. And here we can immediately connect the one that we set earlier. And then we can choose whether we will use all the tools that are available in the server by default, or specific ones. Here, nothing will work now, because we, in fact, did not specify the URL itself. Let's go back to our MCP server. Let's copy the URL we need. And let's pay attention again that here we have an MCP with four tools: create, delete, search, and update event. If everything works correctly, we will see exactly these in the settings. We specify our address. And then, to check that everything has worked correctly, well, let's try to select the tools that our server offers to use. And if everything has worked, here we will see a list of those four tools that we had. So, as we can see, it works. Why is this needed? Because many servers package a huge number of different actions. And it's not a fact that our specific agent needs access to all of them immediately. After all, let's not forget that all this history at a lower level works on the same context extension to the agent itself. And in essence, at the moment when the agent interacts with the MCP server, a list of all these possible tools is simply loaded into its context. Consequently, the more tools we pass to the agent, the more we clutter the context window. And it's better not to do that, of course. It's better to limit ourselves to exactly the tools that we need here. But in this case, we can not worry about it too much, specify all of them. And in principle, that's all. And now we have an agent to which we can try to ask the same question: "What's on my weekend?" But now it should, in fact, give us the same answer. But, as we will see, it will do it a little differently. It will do it not within one workflow, it will use the MCP server, send a request to it via HTTPS, well, this very SSE server, and then receive the answer through it. Well, and as we can see, everything works perfectly. And if we now go into Executions, then, well, we will see that our workflow worked exactly as it should. The main agent sent a request to the MCP server, and the MCP server itself processed all this history through an event request and returned it back. At the same time, I will emphasize again, here we specifically made this history in such a format that it's all in one place. But in fact, there can be any number of these MCP servers. They can be running as completely autonomous workflows, hanging in the background at any time. And we can work with them completely calmly. I repeat, not only from Workflows in N8N, but from anywhere. And most importantly, let's not forget that we can connect anything here. That is, we can use here both the entire functionality of N8N available at the moment, i.e., automation of practically any services. But also, we can use arbitrary logic that we have made before. We can take and connect practically any workflow that we already have here. Moreover, if this workflow implies the introduction of some external data, then they will be indicated right here. We can execute arbitrary code, we can send requests to any external sites via http requests. What's more, we can take and simply connect an MCP client to our MCP server. And we can thus create entire chains of various MCP servers, combining and combining existing tools, creating so-called meta-tools for our agents, which will contain practically any functionality. Well, so, I hope this thing seemed interesting enough to you, and now you can look at the workflows that you have already created in N8N in a different way, or perhaps it will give you ideas for some new automations of what can be done and what you haven't gotten around to at some point. This, in fact, was the first part about MCP within N8N. But in reality, I wanted to tell you about a slightly different story, about, let's say, a little magic. It's quite possible that after this, you won't have to think at all about how to implement the necessary task within N8N, because, lo and behold, today an MCP server has appeared that allows direct interaction with N8N and creation of working workflows through it, including creation of new MCP servers through it. Well, and as I said earlier, the task of automation is very old, but, I repeat, no working product has appeared until now. And just a few days ago, by getting my hands on this new thing, which has now become available, I exclaimed: "Hooray!" Because it really felt like magic. A product has appeared that is called N8N MCP. Open, available, distributed under the MIT license, which works as a separate MCP server, that is, the same thing. It connects anywhere, it connects to native Claude, works from within Cursor, and so on, and allows, in just a couple of natural language requests, to create practically any arbitrary workflow in N8N, which, most surprisingly, will work. Moreover, well, let's talk a little about installation. In fact, this is exactly what we will try to do now. It's very easy to install. There are two ways. Well, first, the site itself is available at nvm mcp.com. Installation is available in two ways. The first, the simplest way, is launching via the console. We go into the console, enter the command NPX N8N MCP, and that's it. Essentially, it downloads all the current data and works, with the only caveat being that you have Node.js installed. And, essentially, after that, it becomes available within all applications. We will look at this now. And the second option is through installing a separate Docker container. There is a section in the documentation about this. You just need to run one command in Docker. And it makes sense to use it if, for some reason, you have Docker installed, but not Node.js. There are no difficulties again. That is, we literally run a single command, and after that, the server starts running. Moreover, after launching, the script automatically downloads all the necessary dependencies. Then, all we need to do is to open, well, first, open our N8N, and go into the settings here, just a moment, go into the N8N settings themselves and open the N8N API section. Since this server needs to connect directly to our N8N instance, we will need an API key. We click "Create Key", specify the necessary parameters. We get this key, copy it. And I won't create it now, because I've already set it up. And all we need to do is, for example, open Claude, go into the settings, go into Local MCP Servers, and there we will have exactly that configuration file. The file looks something like this. All we need to add there is this new section with the new MCP server N8N MCP. And then all we need to insert here is the link to the domain of your deployed MCP, or if it's a local installation, then to the address as it's available on the local server, and the API key of your, pardon me, and the N8N API key that we just got from here. After that, we save the file, launch Claude, and that's it. We get a full-fledged assistant within any of our applications, which we can call, now, which we can call from within, and which we can ask to create our workflows. Moreover, naturally, many of you have probably tried to do this process, for example, through ChatGPT. Many of you have probably even given it a link to the N8N documentation, which supposedly should have made it a bit more powerful, but I think you understand perfectly well that nothing good usually came out of it. Any complex workflow you ask it to do, it doesn't work one way or another. Here, the situation is a bit different. Here, the developers approached the creation of the software product very well. And it doesn't just generate code, it's a separate agent that, step by step, first, sends a search, well, it breaks down your request into a list of nodes, analyzes the documentation for each of these nodes, analyzes the overall documentation, and breaks down the task into logical elements and selects specific nodes for each logical element of your task. Then it creates a separate documentation with the parameters and dependencies of these nodes. Then it tries to assemble a workflow from these nodes. And then, most importantly, it tries to configure each node individually and then validates it until it works individually. After these nodes are validated, it validates the entire workflow as a whole. And only after that does it directly interact with your N8N instance and, essentially, send it there and create that workflow directly within it. That is, you don't even need to import or export JSONs. Everything works right out of the box. Moreover, that's not all. This agent can, first of all, parse execution errors, look at logs itself, extract errors from those logs, and make corrections to those workflows. That is, if you need to add new functionality or fix an error, it won't build anything from scratch. It will fix what already exists and make all the necessary corrections. Validate them again through this huge validation pipeline, and give you the result only if it works as originally intended. Well, yes, and probably the last thing that needs to be emphasized here is that, once again, all this works as an MCP server. That is, returning to what we created within N8N, all of this can work together. That is, we can create an agent within N8N that will call an MCP server to generate workflows within N8N, which will be automatically validated. And then we can create such infinitely nested stories, where agents create new workflows just for a specific task, if that task arises. That is, we have now, essentially, become one step closer to full-fledged agent corporations that can exist simply within N8N. And you can, for example, already create multi-agent stories where we have one workflow generator, or rather, one agent is a data collector, the second is a workflow generator, the third is a tester, and the fourth is an orchestrator between all these three agents. Moreover, if previously, again, to debug errors within a workflow, we had to extract code, copy that code to, say, Claude, and then, like, code it until it turned blue, until something happened. Now we can just, I don't know, copy the error address, say "it doesn't work." And then the agent won't bother with anything, it will automatically look at our N8N logs and everything. Find the necessary corrections and work on them until it all works. So, let's try to do all this. Because it all looks close to magic. I already have this agent installed in N8N. Moreover, I prepared. The agent itself also has a special prompt. It's available on the website, which very clearly models its behavior, so that it clearly does everything step by step until everything works. So let's just see how it works in practice. For example, I want to do something as simple as possible. I've long wanted to create a news bot that takes news about artificial intelligence from Hacker News, processes them, selects the most interesting ones, and processes them through a separate editor agent, which, say, translates them into Russian for me and reformulates them in a certain style. And, for example, sends them to me via Telegram. So, let's ask it to do exactly that. And moreover, we can ask it to do it in a hardcore way. Let's specify the Claude OPUS model and tell it: "Think better." Let's launch this agent and see what it does. It should be quite interesting. It immediately decided to use Russian. Quite curious. This wasn't in the tests. Well, let's see what it's actually doing. It first accesses the documentation, reads that documentation regarding those logical steps that we have and that it needs to use. So it has already figured out that it needs Hacker News, OpenAI, Telegram. And now, gradually, it will search for the nodes it has through the search tools, it has successfully found the necessary nodes. Select from them what best suits the task. It will take the schedule. Well, in general, as a full-fledged developer would do all this. It has a fairly large set of tools, primarily for interacting directly with documentation and searching for information on various nodes. And the second part is for interacting with N8N and launching various things. So, no, it probably doesn't make sense for me to talk to it, because it's more interesting to observe what's happening here. Now, unexpected capacity constraints. Oh, darn it. Well, it's not so bad. Because I managed to prepare for all this in advance. The magic was precisely related to this request. I tried to do exactly this. Apparently, Claude Professional is still needed for a lot of money, because, well, I don't know, it worked perfectly for me at night, and now, let's do it simpler. Let's do it simpler and look at the process that was already done. So, the same request, just a little earlier in time, was given to it. And then everything happened as follows. It, essentially, did the entire same process, received the data, found the necessary nodes. And after studying how to link these nodes together, it took and assembled the workflow. So, it generates the ready code for this workflow. Checks it, and at the verification stage, it hits an error because the connections between them are made incorrectly, it makes corrections, and here it is, proud that everything was done. The only thing is, the first run of this workflow gave a rather specific error. That is, it simply didn't substitute, it generated data generation, but the news itself was not quite correct. Here's the workflow it created. Let's study it a bit more closely. Well, in general, what's more interesting here, because this has already been corrected. When an error occurred, I simply sent it that something was coming in incorrectly, and it immediately figured out that OpenAI doesn't process variables in the template. Now we'll fix all this. It took and changed the workflow, checked it, and after everything was checked, it said: "Everything is okay, now I'll generate documentation for you." And essentially generated full documentation for this thing, where it described that every 4 hours it checks the top 30 news on Hacker News. News is filtered only about AI tools, the three most popular are selected, rewritten by an agent in a witty style in Russian, and published in a Telegram channel. Well, the only thing is, I asked it not to do it in a Telegram channel, but to send it directly to me. There were two ready-made workflows, one of which checks for duplicates, and the second without checking for duplicates. All that needs to be done is to set up OpenAI API and Bot Token in Telegram. And then detailed documentation, essentially, on how all this works, what news filters it uses. That is, it doesn't just send a request about artificial intelligence, it collects all popular news and then filters them by a huge number of keywords. It shows, it created the prompt itself. That is, once again, I haven't made any corrections to the ready-made workflow at all. I once wrote in the chat that an error occurred. After that, it made the corrections itself. And all I had to do after that was to specify my own Telegram ID within this workflow and press the activate button. Now, let's see how the actual testing of all this works, searching for posts with duplicates, potential malfunctions, and so on and so forth. You could even add some additional functionality. But now let's look at the Workflow created completely automatically. It itself found the address for collecting news from there, so that the top news is passed to it further. Well, let's limit it to 30 pieces. Generate, retrieve all the news data from there. Let's go through it. Here it is, it's sending news IDs, filtering this news by parts, generating from there, retrieving the three main ones, no, pardon me, it gets general information about these news. Here we can see, it extracted them with full text, filters them by keywords that it created and wrote itself. That is, not me, I just specified news about artificial intelligence. It itself chose suitable keywords and filtered everything by these keywords. Here it got five news items. These news items are then filtered by rating. We leave the three main ones. Here we have 30 main ones. And then we give them to the agent to rewrite them. Rewritten. We have three rewritten news items from the agent. And then here, essentially, the only thing I did here was specify the chat ID. Initially, the Telegram group ID was there, where it was supposed to write. We press generate and open Telegram. So, if, essentially, yes, it even announced that the news is ready. And thus, in less than 10 minutes, we got a full-fledged bot, without doing anything at all. We got a bot that writes news, taking them from the data sources we need. And moreover, it rewrites them quite well. Well, it's clear that artificial intelligence is rewriting them, but the fact itself, a slightly more complex prompt, the higher the quality of these news items. And really, since last night, every 4 hours it sends me these rewritten, reformatted news items to the Telegram channel. So, this is the thing. Moreover, again, I repeat, it allows you to do different things. After that, I tested it a couple more times, and I got a similar story. I wanted to do this in the form of an MCP server and asked it to create an MCP server for me that would work as an API, to which I could refer. And here, sorry, here it didn't do it in the format of standard nodes. But with its own code, where it simply structures the received data automatically so that it resembles an MCP server response and responds through the same webhook. But again, the most important thing here is that this thing works. It works right out of the box without any additional tricks. All that was required was simply to write it a task. And then, based on the results of this task, everything was created. Well, as it were, despite everything, there are quite, well, if not super high-level, but quite middle-level things for creating such things. On more complex tasks, it generally shows itself quite well. And what's most important, this thing is developing. This thing is getting better with every new release. And this is truly like magic, because when we ask it to do something, it does it, corrects it, shows it, and so on and so forth. What else was curious here? Here is one of the dialogues where I asked it to do something, it had a few more errors. But at the same time, the server, how it works, the one we saw a few minutes ago, it itself created a separate URL for it and said: "If you want to try it, run a request that will give you something." Well, we can check now if it continues to work or not. It's working now, it's giving the necessary data and sending a search. Moreover, yes, what's curious, when it was doing this, it didn't succeed, it started looking for an error, and then it went into its own cycle and tried to redo it for several minutes until it reported that now everything works perfectly. It rechecked it itself and said: "Now everything works like this." Therefore, yes, the cool thing here is that it contains an incredible degree of automation and, in principle, works perfectly on some basic tasks. So, I highly recommend everyone to install it, everyone to try it. It's quite possible that this thing will really change how you interact with N8N, because it allows you to automate this entire process very, very coolly. So. Well, and we will return to our schedule. So, I promised no more than half an hour. We have literally two elements left, quite simple, but which, as I said, quite significantly optimize the process of interaction and creation of an agent within N8N. They are not directly related to the MCP topic, but they are also cool. First of all, it's AI agent to Tool. We will create a basic workflow, chat message, AI agent. And until recently, if our workflow included some multi-agent interaction, if we needed to orchestrate several different agents among themselves, it was a set of different workflows. Within each workflow sat its own agent, a separate workflow with an orchestrator agent, to which we connected these workflows separately. And it turned out to be a branching history that had to be opened in dozens of different windows, which was incredibly inconvenient to debug, in which there was no possibility of using global variables. In general, it was quite an inconvenient mess. But now everything has changed. Now we have a wonderful thing called AI agent to Tool, which works as follows. Now, when creating agents, we can create branches of these agents. Now we have a tool that is called exactly that, agent to tool, which gives us the opportunity to attach another agent as a tool to each agent. Moreover, child agents have their own prompts, and they have their own ability to use any model. We can create agents with simpler models, create more complex models for some tasks. They can use separate memory, separate tables in the database. And most importantly, each of these agents can have its own set of tools, which, as we now understand, can also be different MCP servers. That is, now we can pre-define a huge number of global variables within one workflow, pass these variables between agents. And most importantly, at the top, we will only have one orchestrator agent left, which will manage this whole bunch of agents, and whose prompt will simply state how it should manage, and everything else will be left to its subordinates. In general, this is a quite revolutionary thing, because,

Finally, we can create full-fledged multi-agent systems. That is, now we can take one huge prompt, divide it into parts, essentially limiting the area of responsibility of each agent. Well, as a result, we can optimize both cost, time, and resources. And now we will no longer have dozens of different workflows inside, dozens of different windows, everything will be inside. Ah, what you need to remember, there are a couple of nuances. The execution context itself, the variables that appeared inside a specific agent, are not passed to the agent by default. Therefore, either we use a workaround, when we embed a set block at the beginning, and specify some environment variables here, which we need, and then within the agent's prompt, we address it, ah, now we address it directly, specifying a specific node. That is, something like Global V will be there. And there we specify, ah, not through inheritance, but through referencing this very node that is located here. Uh, well, the second thing is about execution. Since we now have one workflow, we also have one execution, which means, as it were, logging and, accordingly, debugging all of this will also be centralized. Ah, but on the other hand, it's easier for us to interact and, for example, send these logs to a general agent. Ah, well, in fact, it will now become much easier to create these agents. Ah, well, and the last thing for today. We have agents, we have tools, we have multi-agent orchestration. Another problem that also, ah, often occurred with N7N is routing between models. The questions are different. The questions are of different complexity. It is absolutely not a fact that if our parent agent, well, that is, logically, especially in such a situation, that, for example, the orchestrator agent uses a more complex model, ah, but even the top-level agent can receive some small task, and, accordingly, it is illogical to process it through a more expensive model. And, accordingly, the question of routing arose. And until recently, there was no possibility for this. But now we have another node called Mode Selector. Ah, it works as follows. It is essentially a router that works exactly like an if router, which allows routing to one direction or another depending on the occurrence of certain conditions. Only here, instead of directions, a specific model is selected. Let's connect, for example, 41 mini here. Let's connect, for example, some Open Router with a four, and so on. That is, ah, and then all we have to do is specify the conditions here. The only conditions here are not set intelligently, it's a direct algorithmic choice. That is, if, for example, we have some agent standing beforehand that, ah, already evaluates our task and assigns it some flag depending on the evaluation of this task. And, for example, if we have, for example, a flag Task Type, then we can say that if this, for example, equals draft, then we, ah, select model one. If we have model two, then if we select, for example, the variable task type equals analyze. And if there, that is, analysis is a more complex model. If, for example, a draft is intended, then a simpler model is used. And in this way, we can now route responses between specific models. Moreover, again, this can be a sufficiently complex story. For example, if, ah, some model returns an error, if, for example, we have run out of credits in Open AI, then we can automatically switch and use models, for example, that we pull from Open Router, ah, and so on. Ah, once again, that is, all of this works like a standard Noda switch. We specify the conditions, and depending on these conditions, our specific agent will use one model or another. Moreover, again, knowing all this, we can even do things like this, when all our agents are connected to this model selector simultaneously. Ah, and now a much more intelligent story emerges, when different agents get the opportunity to choose the model that will more effectively solve their specific task. Exactly the same way, we can, for example, switch the model if we have an agent here that interacts with the user. We have extracted data from the user, and if, ah, it's a premium user, we can route them to a more expensive model. If it's a user, say, free or, ah, who is, well, of a certain level, then we route them to a cheaper model, and so on. Moreover, here you can even do very complex things, because now, for example, we can do something like A/B testing of models. We can, for example, have a task like summarization, and we don't know which model is better to use here. We have access to a huge number of them, but the quality of these models, ah, it varies quite significantly. And until now, we just had to run this workflow, switching each model from the other. Here, we can simply create, ah, a workflow in which, well, for example, we randomize the model selection through a variable, the result of each generation is saved, and then we can simply direct these generation results, well, for example, to a website, collect user metrics, and based on this, post-factum, we understand which model worked better or worse for us. Ah, well, that's exactly the kind of things I wanted to convey from the perspective of the NEN update. Ah, I hope it was clear and useful. Ah, well, in the recording, in the description, there will be details about each tool we talked about today. For community members, there will also be a separate text analysis available, which will describe in detail how to install and use all these things, along with test workflows. Ah, in general, to summarize, I would like to, ah, probably fix here as the main story that, ah, Nos is cool and NEN is gradually becoming, in my opinion, the most convenient tool for creating autonomous agents. Ah, along with tools like, for example, MCP for NVM, and the creation of these workflows itself is becoming an increasingly simpler story. Well, I can only advise everyone to experiment, to use, especially since it is becoming easier and easier now. Ah, and I suggest that next time, ah, perhaps we can discuss your own developments, what you manage to do through such tools. That's all I have. The hour is coming to an end. I hope this was useful. If you have questions, I'll be happy to answer them. Ah, if there are no questions, then I wish everyone a good weekend and see you next time. Ah, Denis, do I understand correctly that these are versions, like 111.1? >> Ah, I'll tell you now. Uh, well, this is the latest current one, >> well, it seems to be current, yes. There are definitely no others. >> Oh-oh-oh-oh. Just a moment. The one that came out on July 23rd, I think, 11102. >> Ah, I see, I see. For some reason, it's not showing me yet that, well, there's a new update. >> Ah, yes. 113.2. >> Ah, ah, 103.2. Ah, well, then that's good. Update it. And one more question. Ah, this node, um, that is, MCPN server, should I install it via Docker or is it better directly? How >> I install it locally. Ah, well, at the moment when I work, since it still needs a local cloud. I don't run it through cursors, but through a regular cloud, so it's just installed locally. And this story too, just >> How >> the simplest option >> locally on the internet, on a virtual machine, of course? Yes. Not on the computer. Not on your computer. >> On the computer, on your computer. >> And I'm working on Hugging Face. >> Ah, then it won't be more complicated. You can also run it via SSH. It works in a container. In principle, there is, of course. >> Ah, so you don't need Docker to have everything in one place for convenience, or what do you recommend? >> Ah, good question, actually, because, as far as I know, well, you'll have to manually write a Docker compose file for it, because, well, it's easier to connect to the server via SSH and just start this Docker container in the background with one command. You don't need Docker for this. Well, that is, since it runs in the background, it's easier to use it simply as a background process that you can connect to. That's it. Ah, but simply, well, use, well, and for the local story, which, well, that is, again, the cloud is local, the MCP server is local, ah, I only host NO semen on the server. And, accordingly, all this local story, it accesses the server only at the moment when it has finished the workflow and created it on the final server. Therefore, since all my development is done on my local computer, it is much more convenient for me to install it locally, so I wouldn't even deploy it on the server. >> Ah, I see. So, so it makes sense to install it locally as well. >> Yes. Yes, yes. That is, well, the most convenient is when N8N is, well, naturally, deployed on the server, because otherwise we don't have a domain name. Ah, everything else locally, I think, is much more convenient. >> Ah, I see, I see, okay, okay, I'll try. There, uh, Supercard, you don't need a video. >> No, no, you don't need anything at all. It's maximally simple. >> Ah, I see, I see. I mean the cloud. Ah, I haven't worked with the cloud yet. >> There's the same application as Chat GPT, absolutely not resource-intensive, based on Electron. >> Well, I see. Well, then I'm done. >> Such a thing, yes, it's not demanding at all. >> Okay, okay, I'll try. Where, where else is there? Can I see, uh, how to install the cloud locally? >> Well, locally it's a direct application, it's downloaded from the Anthropic website and >> works exactly like the Chat GPT application. So there shouldn't be any problems here. >> Okay, thank you. Yes, the only thing you'll need to do is, uh, at its address, there's a configuration file, and after the MCP server is launched locally, you'll just need to specify it within the configuration itself. So, just add such a line there and everything works. >> I see. I'll try. Yes, >> thank you. >> That's it. Great. Then thank you all, have a good weekend, and >> weekend. >> Bye-bye.