n8n Just Leveled Up AI Agents (Anthropic's Think Method)

Nate demonstrates n8n's new Think tool that lets AI agents reason through complex tasks. The tool acts as a scratchpad where agents verify completed actions, detect missing steps, and retry. It works best for policy-heavy workflows and sequential decision-making, and Nate compares how Claude, GPT-4.1, and other models use it differently.
Chapters
All right, so here is our beautiful Ultimate Assistant with the new GPT-4.1 chat model as well as the new Think tool. All right, can you please create an event for tonight, 7:00 PM? It'll be an hour long with Dexter Morgan. And can you send him an email to make sure that time works? Can you delete my dinner at 6:00 PM? And then can you email Michael Scott to let him know that I'm not gonna make it? Okay, cool. So we just sent that off. Our Ultimate Assistant is going to get that message, use GPT-4.1 in order to take action. And as you can see, it's gonna hit its different child agents down here. So it's using the contact agent to get that information, the email addresses. Now it's gonna hit calendar and email agent in order to delete that event, create the event, send off those two emails. And then as you can see, it just used its think tool down here to make sure that it did everything right. So the response that we got was, all set, your 7:00 PM meeting with Dexter Morgan has been scheduled and he's also been emailed. The 6:00 PM dinner has been deleted and Michael Scott has been notified that you can't make it. So before we go verify that, let's click into the Ultimate Assistant and we'll look at its logs because this lets us see exactly how it thought about what it needed to do and what actions it took. So when we're looking at the logs, we read it from top to bottom. So the first thing it did was it used its memory to see if there was any past conversations, and then it used its chat model to read through its system prompt and understand what I need to do. From there, it's just a mix of tool calling and going back to its model. So the first thing it did was contact agent to get Dexter Morgan's email, and then it did the same thing for Michael Scott. Then it went to the calendar agent to create an event tonight for 7:00 PM called Meeting with Dexter Morgan. Then it went to the email agent to send Dexter an email to confirm if that works. It went to the calendar agent to delete the dinner. It went to the email agent to let Michael Scott know that we're not gonna make it to dinner. And then finally what it did is it used its think tool, which is basically like a scratchpad for your agent to write down its thoughts and its actions and just to make sure that it's aligned with what you asked it to do. So what it wrote down here was confirmed that all requested actions were completed, created the meeting event for 7 PM with Dexter Morgan, emailed him to check if that time works, Deleted the 6 PM dinner and notified Michael Scott by email. No further steps needed unless the user requests more. So if at this point it realized, okay, I wrote down what I did and what the user wanted. Oh, I actually do have more things I need to do. I'm gonna go back and call those tools until I'm ready to go. So this was perfect. It did its actions, it thought about it, and it decided that we were finished. And then it let us know all the things you just requested have been done. So looking at my calendar, you can see the 6 PM dinner was deleted and we now have a meeting with Dexter Morgan. And we can see that he was in fact invited. You can see here in our sent emails, we have a meeting time confirmation for Dexter and 7:00 PM. And then we also have a meeting to Michael Scott about dinner tonight. We're not gonna be able to make it. So I'm super excited to continue to experiment with this kind of stuff. When you pair a really nice model with the ability to basically write down its thoughts and reason, I think that this is going to be huge for creating agentic systems. But let's hop into one more demo and then we'll break down what this node does, how it works, and when to use it. Okay, so here is our Think agent. As you can see, it has 2 tools as well as a think tool. So what I'm gonna do in this chat is ask it if me and 3 friends can stay from April 15th to April 20th. So we'll send that off and we'll see what it does. You're gonna see here that it's gonna call both the quoter and the availability tool, and then it's gonna hit the think tool. And then you'll notice it hit the quoter tool again. So as you can see, it responds to us with, you and your 3 friends, 4 guests total, can stay from April 15th to the 20th. Those dates are available. However, I was unable to retrieve a quote for your requested stay at this time. If we click into the logs of the actual agent, we will see exactly what it did. You can see that it first called the availability tool, which the response is that the dates are available. It then tried to call the quoter tool and the response was no quote provided. So the agent at this point realized, okay, I ran into an issue. I'm gonna use this think tool to think about what I need to do. Basically what this is is a scratchpad for the agent just to write something down and think about it. So we're essentially turning GPT-4.1, which is not a reasoning model, into a reasoning model. What it wrote down was, availability has been confirmed, but the quote was not provided. I need to retry the quote request with the correct number of guests and dates. So it's thinking, okay, maybe I just sent over the wrong information. Let me go ahead and try again. What it did is it called the Quoter tool once again, and same thing, no quote provided. And so what I just did is I fixed the Quoter tool. So let's go ahead and resend this off and see if we get anything different. It should call both these tools and then it should call the Think tool just to make sure that it did everything correctly. As you can see, it just called the think tool, and now we have our actual availability with the quote. So once again, we'll click into the agent, we'll click into logs, and we'll see that it got the availability, it got the quote, which at this point was something ridiculous like $12,000, and then it hit the think tool just to make sure. So it says, confirming the requested dates are available, there are 4 guests, the quote tool has provided the per-person cost of $3,000 for 6 days at $5,000 per day. The user wants to know if 4 people can stay and what the total cost is, so now I should provide the total cost for all guests. And confirm the availability. And that's exactly what it did down here. It responded to us with that information. All right, so now that you guys have seen a demo of the tool in action, let's break down what the Think tool is, how it works, and how it can be helpful for your workflows. If you guys don't know me, my name's Nate. I've been building AI agents and AI workflows in n8n for a long time now. I run a school community that you can join for free that has all of the resources from any of my YouTube videos in there, including all the templates that we're gonna go over today in n8n. And then I also run a paid community that has a full course on building AI agents in N8N, as well as other deep dive topics, as you can see right here. We also have 5 live calls per week, and it's just a community of 1,000 other members who are building with N8N. So the link for both of those communities will be down in the description, but let's get back to the video. So what we're talking about today is this think tool. It just got released in N8N version 1.88, so if you don't see it, you probably need to update your instance. So as you can see in the demo, the think tool is basically just a tool, like a notepad, for the agent to write things down while it's trying to solve through problems and call different tools. And this was inspired by Anthropic's article, as you can see right here, about the Think Tool, which enables Claude to stop and think in complex tool use situations. As you can see here, it is a new tool that improves Claude's complex problem solving performance. I'm not going to read through this whole article. I'll link it down below, but let's cover a few of the key points here. So what is the Think Tool? It gives Claude the ability to include an additional thinking step complete with its own designated space as part of getting to its final answer. So imagine you were trying to work through some sort of complex math problem, but you had no scratch paper and just nowhere to write down your thoughts and sort of reason. So if you've ever played around with some of the reasoning models, you'll notice when you ask them a question, they basically will think out loud and they'll, they'll read what they're saying and then they'll use that to reason to get to the best answer. So essentially what we have the ability to now do in N8N with our agents is turn almost any model into a reasoning model because they now have the ability to write down their thoughts and reflect upon them. So anyways, the think tool is similar to extended thinking, but it's a different concept. Extended thinking is all about what Claude does before it starts generating response. What we're doing here with this thinking tool is the ability to, after it's done processing different tool outputs, then think about it, or in the middle of these tool calls, think about what it needs to do next. As you can see down here, this is particularly helpful when performing long chains of tool calls or in long multi-step conversations with the user. Anyways, down here it gives a sample implementation of this tool. The name is think. Here's the description, and this is actually going to be the prompt that that is in the default native N8N think tool. You'll see that in a sec. And then of course, they also did some testing in here. So here is Claude 3.7 performance on a task where it has just a baseline, it has the ability to think, it has extended thinking, but then up here it has thinking plus a prompt. And so as you can see, it says that the best performance was achieved by pairing the think tool with an optimized prompt about how to use the think tool and what it's gonna do. So here's an example of using the think tool, a sample prompt that you can feel free to look through if you go to this article. Anyways, there's a lot more details in here, but there's two more things I wanted to touch on, which is when to use the Think tool and when not to use the Think tool. So they provide three scenarios to when to use it. First one is tool output analysis. The second one is policy-heavy requirements. And then the third one is sequential decision making. And then there's the whole conversation of when not to use the Think tool, which I think is something really important to quickly cover because in this AI space that's moving so quick and you have new models dropping and new tools dropping and new frameworks dropping. I feel like we all tend to get caught up in the hype bubble and just want to shove all these different tools into everything. And the reality is a lot of times that's just going to hurt the performance and it's just over-engineering. So when not to use this think tool would be non-sequential tool calls and if it's very simple instruction following. So quick disclaimer, these examples I'm going to show today in NN may not always be the most optimized of when to use the think tool or when not to. But what I wanted to do is get in here, show you guys kind of how it works with different models, how you may think about prompting. Agents to use the Think Tool and just in general what it looks like and what it does. So I'm going to start off in this workflow with just a few simple examples and we'll compare 4-1-Mini and Claude 3.5 Sonnet with the Think Tool. And then we'll get into a bit more of a complex one that looks like this. We'll compare some more models and we'll just kind of see how it goes. Cool. So just starting off, let's test its thinking ability with some riddles. So the first one I'm going to ask is, I speak without a mouth and hear without ears. I have no body, but I come alive with the wind. Who am I? And so we'll see what happens. Then we'll look at the prompt that we have in both the agent as well as the think tool. As you can see, Claude just called the think tool and then the answer down here is an echo, which is correct. So first things first, let's look at the system prompt for the thinking agent. All I said was you're a helpful assistant, and then I just gave it access to its tool, which is think, and I just said use this tool to think deeply. If we click into the logs over here, we can see what it did is it immediately hit its think tool because it knew this was sort of like a riddle. And it said, "Let me analyze the key characteristics given in the riddle. 1, speaks without a mouth. 2, hears without ears. 3, has no body. 4, comes alive with wind. These characteristics point to something that makes sound without physical vocal organs, blah, blah, blah." So as you can see, it's thinking about how it actually needs to approach solving this riddle. And it looks like the thinking tool actually came to the conclusion of an echo. Now it's interesting because if we were to disconnect Claude 3.5 Sonnet and plug in GPT-4.1 Mini, which is phenomenal by the way, we will send this off again and we'll see what happens here. So this one got the answer right much quicker. You can see it responded echo, but it didn't call the think tool. So here's an example where they choose to use the tools differently. The prompting is a little bit different, but I think it's really powerful to understand how the models will use the think tool and connecting different ones. And also just wanted to show you guys GPT-4.1 versus GPT-4.0. As you can see, first of all, GPT-4.1 and all of its family models, so the mini and the nano, have a 1.05 million context length, whereas over here with 4o we only have 128,000. And this basically just means how many tokens the model can look at in one try. And over here with the 4.1 family, we have— it's basically 8 times higher. Anyways, when it comes to pricing, you can also see that 4.1 is significantly cheaper. So it's going to be $2 for a million input tokens and $8 for a million output tokens. And over here it's basically tripled and basically doubled. So GPT-4.1 and its submodels are going to be a lot cheaper. Anyways, let's feed one more riddle to 4.1 mini and see how it handles it. A man lives on the 10th floor. Oh wow, it already answered that really quick. Basically, the man lives on the 10th floor and he takes the elevator all the way down, but when he's going back up to the 10th floor, he stops at 7 and then walks the rest of the way up the stairs. And the answer is that the man is short and can only reach the 7th button. Anyways, let's real quick just plug this into 3.5 Sonnet and see if it uses the think tool. 'Cause as you noticed right there, GPT-4 1 Mini did not use the think tool. So we'll see if Claude 3.5 Sonnet needs to, or maybe it's not even needs to. I have a feeling if we disconnected the think tool, Claude 3.5 Sonnet would still get this riddle right. But it's cool just to see that Claude likes to rely on the think tool in order to reason through the, the riddle. So we can see right here, it calls it and it analyzes the whole situation. And as you can see, it came to its conclusion in the think tool. The man must be short in stature. He can reach the button for the 7th floor, but cannot reach any higher buttons in the elevator. And also one thing to keep in mind is the actual prompts within this think tool. There's nothing really to set up. This default think tool description is to use it to think about something. It's not going to, you know, obtain new information or change the database. And this right here is pretty much exactly what we saw in the Anthropic article for the description of the tool right here. And for the sake of this video, I'm not touching this. I'm leaving this as default. But remember, you can optimize the way that your agents use this think tool if you put a different type of description in here. In here. Okay, now moving into a different example with the think tool. We have a few more tools here. We have a Pinecone vector store that has information about knowledge base. We have the send email tool, the contacts tool, and then also a web search tool. And right here is our handy dandy think tool. So what I did in this agent is we just prompted it with the different tools it has and when to use them. And then I just gave it an important message, which was never make up an email address. If you can't find it, think about what you should do. So we're gonna fire off this message that's asking the agent to send an email to Michael Scott about dogs, and we want it to research dogs online first. So it just hit the web search tool, it's hitting the contacts tool, and then it went to send email after it had Michael Scott's contact information. So as you can see, an email has been sent to Michael Scott about dogs. Let's go check on that in our email. Okay, I'm not gonna read this, but as you can see, the email did come through. But what we noticed here is that it didn't use the think tool, and it's probably because of the way we prompted it. So in the system prompt, when we said, hey, you have a tool called think, we said, use this tool to think deeply when you run into an issue before asking the user. So it didn't run into any issues. So maybe that's why it didn't call it. Let's throw a situation where it may have run into an issue. Okay, so as you saw in the previous example, it was using contacts Airtable base right here to get contact information. So here was Michael Scott's email. What we're gonna do now is ask it to send an email to Jennifer Martin that Jennifer Martin doesn't exist in our Airtable. So even though this response came back successful, it's not gonna have Jennifer Martin's email. As you can see, it just called the think tool and it says, I couldn't find Jennifer Martin's email address in our contacts database. So let's click into the logs to see what it tried to do. First thing it tried to do is hit the contacts database, pulled back all the contacts, and then it knew, okay, I also need to be giving her internal policy information, so I'm gonna search the knowledge base for internal policies. And then it realized, oh shoot, I don't actually have Jennifer Martin's email. So it said Jennifer Martin's contact is not found. I should ask the user if they have Jennifer Martin's email address or if they want to provide it before proceeding with sending the email. And so what I've typically found is if it didn't have access to write down its thoughts on this think tool, or you didn't explicitly prompt it not to, it would probably just try to send an email and it would make up something like jennifermartin@example.com. So in this case, we avoided that because it used the think tool. And so this is very much just an experimental video to show you guys what this kind of stuff looks like. As you can see, if we were to hook up Claude 3.5 Sonnet and try this again, we'll see if it acts the same or if it acts differently. Every model kind of behaves differently as far as the way they interpret a system prompt, but also the way they'll interpret these tools. So here, it didn't even use the think tool. Which is interesting because in the previous example for a riddle, it was using the think tool more than GPT-4.1 was. But in this case, they came to the same conclusion, which is that Jennifer Martin's email address does not exist in the Airtable record. And then even more interestingly, if we plug in a free model like 2.0 Flash and we send off the same thing, we'll see here that it basically just immediately says, sure, what do you want to say in the email? So let's just make this query a little better. Okay, so I'm just gonna ask it to send an email about our refund policy. So now it's searching contact database. And it said, I don't see an email from Jennifer Martin in the contacts. So it didn't use the think tool either. Okay, so just to see how we can maybe affect this behavior, I added a section in the system prompt called instructions where I said call the necessary tools based on the user's request, then use the think tool to verify you took the right steps. And I'm actually just gonna make this capital and I'm gonna put this in quotes so it knows that I'm referring to a tool. You probably don't need to, but that's kind of the way I like to do it. And anyways, I'm gonna save this and be plugged in Cloud 3.5 Sonnet once again, and we're just gonna try to send off this query again. So we'll see that Claude's thinking, it's going to the contact base, it's probably, there you go, it hit the think tool right away. Now it's hitting the knowledge base. This is interesting, the order of operations here, but we'll just let it finish up and then we'll address it. Anyways, it noticed two issues. The first one is Jennifer Martin's not in the contact database. And then I guess this is not an issue, but it did find refund policy. So it found that information, but basically just said, hey, we don't have Jennifer's email information. Now I'm curious what will happen if we ask that original query that actually did work, and we'll see if it wants to think about it at the end because we told it to call the think tool in order to verify it took the right steps. So it scraped the web, it's getting the information, it's going to send an email, and then hopefully it thinks about it. It may not. We may have to get more, you know, specific with the prompting. There you go. It did call the think tool and now it says, I've completed your request. I researched interesting facts about dogs. I found Michael Scott's email address, and then I composed and sent an informative email about dogs to Michael Scott. So if we click into the logs of the agent, we will see that it exactly did that. It called the web search tool, it found the contact information, it sent the email, and then finally it thought about it and it said, hey, here's what I've done. This is what the user asked me to do. Um, looks like we're good to go. All steps have been completed successfully. So in this case, if it came to the conclusion that, hey, I actually need to do something still, it would probably go back and call those tools. Okay, so you may recognize this workflow from the demo. What it's doing is it's just an agent where I hooked up these two fake tools, a quota and availability. Here's the quota, here's the availability. We're just hitting an LLM to give sample data. I just wanted to prove the concept of calling tools and then thinking about it. The prompt in here is, I just gave an instruction. So I said, send the requested dates to the availability tool, send the requested dates and number of guests to the quota tool, and then you use the think tool to verify everything has been done. There should be a quote and an availability status. So what I did in the demo to break this automation is rather than feeding it into the quoter, I just plugged it into this node that basically just says no quote provided. We'll save this. We'll come back into here and ask a question. So I'm asking if me and 3 friends can stay from April 15th to 20th. We're gonna see it's gonna think. It realizes that no quote was provided, and then it tries to hit the quoter again. And then we obviously didn't get a quote. And so if you wanna download this template and any of the other ones I've shown earlier for free, you can do so by joining my free school community. Just keep in mind, this is mainly just kind of an experiment. So what's going on in here is all I did is I said, hey, you know, you're gonna get a number of guests and a date, and you just need to provide a fake quote. So I said, you know, the quote should be $500 per person per day. And then the exact same thing with the availability tool. All I did is I'm feeding in the query that's gonna get passed through. I said, you know, provide availability, assume all dates are currently available. So like I said, just for testing. And now you can see if I was to go back into the Quoter and we take away this Edit Fields and we plug in the actual Quoter tool, we'll save this. We'll quickly just do that exact same example and we should see that it's gonna work. It'll call these two tools, it'll think about it, and then we'll say, you know, we're good. And then I'll just quickly walk through how we're actually sending data to these workflows. There you go, just called the Think tool and now we got a response, which is, here's your quote, $12K. But what we're doing is these tools are called Call Another NNN Workflow. And so when you click into that, all you have to do is you have the ability to link a different workflow from your environment. So as you can see, this one I'm linking to the tool called Quoter. And then in this one, I'm linking to the tool called Availability, which as you guys know, are these two workflows we set up. Here's the Quoter, and then here's the Availability. And then what happens is within each of these two sub-workflows, they're getting live data sent over. So the example we just did was April 15th through 20th, um, you know, 4 people total. And so what it sent over was April 15th to 20th. And so actually this is incorrect. It should have sent over 4 total guests as well, but whatever. And then similarly, if we click at the executions of the availability tool, we should see that it sent over the dates once again, which was April 15th to 20th. And then the actual LLM responded with, the dates are currently available. So I know I might've went over some of this stuff kind of fast. The main purpose of this video was just to focus on the think tool, how it works, and how different models may interpret it with prompting. If this whole concept of sending data between workflows was a little confusing, I made a video where I pretty much talked about that the whole time, so I'll link that right up here. And if you're looking to accelerate your journey with learning N8N and connect with other people who are also doing so, I would definitely recommend checking out the paid community. Like I said, we're growing really fast. We just hit 1,000 members and everyone in here is pretty much dedicated towards learning and building AI solutions with N8N. So any questions you may have, you'll be able to get 'em answered in here. But that's gonna do it for this video. I hope you guys enjoyed. I hope you learned something new. If you did, please give it a like. Definitely helps me out a ton. And as always, I really appreciate it and I appreciate you guys making it to the end of this video. I'll see you in the next one. Thanks everyone.










