AIAI EngineerMay 2, 2026· 1:19:22

Human-in-the-Loop Automation with n8n — Liam McGarrigle

Liam McGarrigle of n8n shows how to build a secure human-in-the-loop automation agent using n8n's visual workflow system, with a Gmail and Google Calendar management agent as the concrete example. He walks through wiring a chat trigger, an AI agent with simple memory, and tools that the agent can call, such as sending emails and creating calendar events. The key addition is a human review node placed between the agent and destructive tools, which intercepts actions and presents them for approval via chat—preventing accidental sends or event creation. McGarrigle emphasizes naming nodes and writing tool descriptions to guide the LLM correctly, and demonstrates using expressions to format readable approval messages. He also covers extending the agent to Slack, adding scheduled runs for autonomous hourly inbox checks, and using sub-agents for specialized tasks. Additional topics include n8n's native MCP server for integration with Claude Code, enterprise Git-based environments for workflow management, and building custom REST APIs within n8n. The session focuses on giving developers observability and control over AI workflows, ensuring agents are not black boxes.

  1. 0:00Intro
  2. 8:26n8n Tour
  3. 11:48Agent Core
  4. 16:51Memory
  5. 25:53Toolbelt
  6. 41:12Human Loop
  7. 47:19Live Test
  8. 58:27Q&A

Powered by PodHood

Transcript

Intro0:00

Liam McGarrigle0:15

How's everybody doing?

Guest0:17

We're good.

Liam McGarrigle0:17

Is this everyone's first workshop of the day, or you guys did one before? You guys have been busier than me. Allright, great. Well, I'm Liam. I'm a developer advocate at n8n, which means I get to fly around the world and do really cool stuff like this, and speak to people probably way smarter than I am about some really cool stuff.

Today we have a pretty short workshop. Is this everyone's first time with n8n? Has everyone used n8n before? Raise a hand. Everyone has used it before?

Guest0:49

Yes.

Liam McGarrigle0:49

Haven't used it? OK. Of those people who used it, like entry-level power users, what would you guys say in terms of.

Guest0:57

Always a beginner.

Liam McGarrigle1:01

OK, well, we'll be starting from the basics here. Essentially, we're going to build as if it was your first workflow. We're going to start from there. We're going to make an agent, and then we're going to add some human-in-the-loop to it, and you'll be set up to take that and expand it to do much more for you.

We'll essentially be making a really simple Google Gmail and Calendar management agent that can go and manage your schedule for you.

And out of the room here, because I'm not sure what to expect with this conference, is there what's everyone's technical level? Just from really high, you can code, down here, you don't know how to code. JavaScript experience from this room?

Yes, no, maybe, yes? OK.

Guest1:56

I have some code, but not in JavaScript.

Liam McGarrigle1:59

Well, one of the great things about n8n is you don't need to know how to code for it. It's a visual tool, but you can break out into code wherever you need it. Even directly in each field, you can write one JavaScript method.

You can write dot two uppercase, and it just works. So you don't even need to do a whole code note or open a separate file. You can do everything visual, and if you need a little bit of extra powerright there, you just do itright in code.

Soright now, I'm sure we all can see the landscape since you're here. You can go anywhere and build an agent. It's so easy to build agentsright now. One of the problems we're seeing and where the winners are going to lie is seeing what your agent can do, knowing what it's doing, seeing what went wrong, and being able to tweak it and fix it.

I think that's really where we stand out, and it's kind of where we started off at, which gives us a really strong starting point here as being the agent builder and orchestrator that you can see and control what's happening.

And I promise I hate slides. I removed almost all of them from the slide template. These are the only ones we have, pretty much. So if anyone can go to this link on your computer, if you fall behind, or if you want to do it again, or for the people on video, this is a Notion page that has the entire workshop, and it actually goes and gives you homework after.

So if you want to continue, there's prompts there of how to continue your agent afterwards to keep it moving, because we only have an hour here, which isn't a ton of time.

Allright. And

is anyone still waiting on this link here? OK. I can always comeright back to this if we need it.

And in there, you'll have this page.

And you guys have a little bit of work to do starting off so that you can actually use n8n. So you can go into this linkright here, register for an n8n Cloud account. You'll automatically get a 14-day free trial there.

That's enough for now. You don't have to upgrade now, but then make sure you go and do this today or tomorrow, because I'll remove these codes after.

I got you guys a year of Cloud Pro, which is $600 value, which we don't do very often. I like to be generous. So you guys can go in and use that. You get a year for free.

So I'll just give you guys a minute. If you already have your own n8n instance, like if you use it already, if you use self-hosted and you have credentials set up and everything, that's great. Just make sure you're on 2.14.2, latest stable version.

If you have your own Cloud version, make sure you upgrade it to that. If you have a new self-hosted thing and you haven't used it much, just know if you run into issues related to your configuration, I unfortunately can't really help you in this session.

It's a little out of scope. We have to make sure we keep moving fast. So I'll just give everyone a few minutes to get this set up. I know there's a question there, and it takes a minute to load.

Allright.

And the people here who use n8n, do you use it at work, just personally, for fun?

Guest6:08

Both.

Liam McGarrigle6:09

Both? Is that usually the consensus? Are you guys the ones who are bringing it to your job at work?

Guest6:13

Yeah.

Liam McGarrigle6:14

Yeah? That's great.

Guest6:16

For example, use Creator, for me, it's very handy every day. The AI tools, so every day I can find news, different sources, and everything. So I use n8n for that, for example.

Liam McGarrigle6:29

That's great. That's great. If you guys need help using it at work, need help convincing your bosses, we've got two guys over here who that's what they specialize in. So you can find them. Ask me the nerdy questions.

You can ask them

the boring questions.

Guest6:48

Anybody has any questions coming in?

Liam McGarrigle6:50

Oh, for sure. So another thing I want to make sure we're not really leaving anybody behind, down here,

there is a screenshot of kind of what it looks like we're going to be building. And thenright here is the workflow JSON that you can just press this buttonright here to copy. And the great thing, one of the many great things about n8n is you can just copy and paste stuff into it.

So you can copy this, paste itright into your canvas, and you'll have the completed thing. Try to follow along, but you can go back and look at this, compare, see what I did. I'm sure I built it better here than I will live in front of you.

And if you have a question, whether it's like even if it's not really directly related, raise your hand or shout it out, and I'll stop. I really want to focus this session on getting the foundationsright, making sure everybody is good to move on and

expand this yourself afterwards.

How's progress on setting this up? Are we getting closer for can I get a show of hands of who still isn't set up in n8n? Everybody is?

Guest7:56

I'm still creating my local one, for example.

Liam McGarrigle7:58

OK.

Guest7:58

Which one? 2.6?

Liam McGarrigle8:00

You should be OK. I just there's been times where people are like 60 versions behind in a workshop.

But if you're self-hosted, you probably don't need the.

Guest8:14

I have both. So at work, we have our Cloud plan.

Liam McGarrigle8:17

OK.

Guest8:17

But I don't want to do this one.

Liam McGarrigle8:18

Oh, yeah. That's fine. I'm just going to give a quick intro to n8n as well. So

n8n Tour8:26

Liam McGarrigle8:26

this is the demo one.

So for those very new to n8n,

is this very hard to see for everybody? I can.

Guest8:40

OK.

Liam McGarrigle8:41

It will make me very sad, but I can turn on light mode.

Ugh.

Guest8:50

Oh, nice.

Liam McGarrigle8:51

Gross.

Ugh. OK.

Sorry to the people watching on YouTube. I know you're like,ugh. At least that's how I always feel, but. So this is n8n. This is the interface. If you're on self-hosted, you don't have these projects over here. You just have your personal space, which is fine.

On Cloud and Enterprise and all those, you get these specific projects. Really nice thing about that is you can have all your credentials separate. So if you have one project where you're doing one thing, another project where you're doing a completely different thing, you don't use different credentials by accident, and you can share in different people between the different projects to have good access control.

We can make a workflow here, and we'll build this manually. n8n started in 2019, before ChatGPT came out, back when AI was much more boring than it is today. And back then, it was just like an integration workflow integration tool.

So it's just a low-code way to say, if this, then do that, then do something else.

So you can, for instance, have a form. There's these triggers,right? So I'm jumping ahead. Everything starts with a trigger. So it can be when a form is submitted, which we can say lead, and then that will be name.

And then the native n8n form will come up here. You can say, my name is Liam.

Right? So that's a trigger. There's also stuff like schedule, and hundreds and hundreds of others. There's webhook and API calls and everything like that. So you have a trigger, and then there's actions, things that happen in other apps like Google, create a contact, send an email.

And like Salesforce, if you want to create a contact, just gluing stuff together. And one of the really powerful things is the control flow. So if this, then do that, you can have different conditions. If this is a personal contact, Google Contacts, Business Contact, goright into Salesforce.

And thisright here is what me and many, many others fell in love with before ChatGPT was ever released, before AI agent meant anything. This was a platform that people loved to use to build things and to build full integrated systems.

And you can do much more than you would expect with this. Anyone who is a developer or anything, you would know this is pretty much just an abstracted version of putting together API calls. You're just hooking stuff up, running logic with it.

Of course, now we do it a little bit differently.

And now we can start to follow along. If you weren't already, this we're going to build our workflow. Now we pretty much want to chat with everything. It's not really when this happens around a schedule or whatever, our primary interface a lot is a chat, or at least to get it to an AI somehow.

Agent Core11:48

Liam McGarrigle12:06

So in a new workflow, we're going to open a, put in a chat trigger. And with n8n, you can integrate to many different things. Like, for instance, you can add a Slack trigger. So Slack, and then in the trigger, like on message received, on message posted to channel, you can have it start that way.

At the end of that Notion document, that's your homework to go in and connect it to your own messaging system. But forright now, we're going to use the built-in chat just because it's easy and already built in. When you add chat to your canvas, you get this box down here where you can type a message.

This is great for debugging and just testing while you're making it, because it just starts itright there. You can even just start a workflow without any AI in there. What we'll also do, if you click in the trigger, there's this checkbox that says, make available in Chat Hub.

This is relatively new, and as long as the workflow is published, when we have that, there's this little chat iconright here in the sidebar. If we click this and go to the tab, we actually have a whole chat interfaceright inside of n8n.

So you don't have to connect it to an external tool if you don't want to. It's just easier to kind of use itright in here. I think that's this oneright here. So this is that chat trigger we put in there.

So if we say in here, hello from AI engineer, and send that, it's not hooked up to anything. But if we come back to this workflow and go to the Executions tab, thisright here is that message. Let me pull this over so you can see it, or I can just click in.

Hello from AI engineer. So you can just use itright inside of here. So that's what we'll be setting up today in this session, where you can chat with your agent here. In the future, after the session, you can set it up with your own chat tool.

And of course, we need to get AI hooked up to this,right? So you can click the little plus here. You can press N on your keyboard or this up here, and we'll just search AI agent.

And the AI agent node is a special kind of node. You can see it looks much different, where it has these little legs coming off the bottom instead of on the side. So the AI agent wants three things by default, essentially, and only one of them is required.

We need a chat model. This is the large language model. Another really big benefit of n8n is you can connect any that you want. If it's not on this list, you can actually pick the OpenAI model one and change the base URL to another provider, and that will usually work.

If you use a proxy or something like that for a big enterprise, that's how you do it. I'm going to use OpenRouter, which has a really big benefit of from that service, you can pick any model you want.

You can use ChatGPT 5.3 or Cloud Opus 4.6 or whatever you want. And even bigger bonus, I gave you a key for it. I will remove this after today, but if you copy this keyright in Notion that you should have open, you can click Set Up Credentialright here on the OpenRouter account and just paste it in, and that should work.

Now with that in there, it should load these. I'm going to use Sonnet 4.6. You can use whatever you want. Use something smart so it knows to use your tools.

And then you connect that into there.

Just keep in mind, any large language model node you use, you have to use the token for that specific

provider. So you can't use that OpenRouter token inside of something other than OpenRouter, for instance.

Allright. Any questions thus far? We're all good?

Is everybody at this point with this agent? OK. Now at this point, we can chat with the agentright here. We can say, how are you, or whatever we want, and we should get a response back just

Memory16:51

Liam McGarrigle17:05

like that. But if we say, what was my first message? You don't have any previous messages. Does anyone know here know what the problem is?

Guest17:26

It's not putting memory.

Liam McGarrigle17:27

It has no memory. OpenRouter is not being nice enough to store it for us. We have to store it ourselves. So there's this memory tabright here where there's all these different options you can use. I just always use simple memory unless I'm doing something super fancy.

Even though it says for beginners, no shame, it just makes it easy, worksright away. Do I see a hand on the back? No?

Guest17:53

I have a question.

Liam McGarrigle17:54

Yep, what's up?

Guest17:56

What are the difference periods or different types of memory you would use and for what type of applications?

Liam McGarrigle18:06

For sure. So the question was, what are the different types of memories and what are the different applications? So simple memory, we store it in n8n ourself. We handle it all for you. And inside of here, there's this context window length, which means this is five here.

So what that means is it will only remember five messages in your context, and it won't remember anything past there. That default should probably be a bit higher. People have longer conversations these days. You can make that like 50 or something.

Just know you're paying for all those past tokens. But this is all abstracted for you. It just works. You don't have to do anything else. That works for pretty much any application where you're doing a chat-based system. You would use something like Postgres or Redis or one of these other ones if you're integrating it into an existing system.

For instance, with Postgres, you can put it into a table, and then if you have another application, you can just use Postgres with your ORM or whatever to get that messages and display it. For instance, if you had a chat UI or something like a dashboard you vibe coded, you could just query Postgres and put those messages on there as one example.

But the biggest difference is just that this is abstracted. We do everything in n8n for you. With Postgres, it just goes and saves those messages to a table.

And now with memory here, the chat node gives you a session ID, and then it just passes that into the simple memory to remember it. And I guess this is a good point to mention expressions if you have not seen this before.

Some people walked inright since you should get on this for anyone who walked in after we started. This Notion page is the home of everything we're doingright now. So if you haven't gotten to this, I'll have it up for five more seconds.

Please scan or take a picture of this.

Allright.

So in n8n, you'll see these brackets and the green stuff. We call that an expression. So you can type things into fields just, and then that's just a static value. It's always just going to be that keyboard mash.

But if you change it to expression, this is still just going to be a static value, but anything that you put inside of these curly braces is JavaScript. And you'll see some suggestions here. We give some convenience functions.

For instance, like now, it'll put the date time. It really is just anything JavaScript works here. You can say like Math.random, and it does that function. But what people use the most for this is, of course, you can just take a field.

This is from the trigger node, and you can just drag a value and plop itright in there. Great thing about this, if we're building something other than this ID, you could go in and it concatenates everything, puts it into one field.

And now we have an agent that will work. You can go and chat with it, and you're essentially just chatting with the provider. But we want this specifically to manage our email and calendar bot.

So what we need to do for that is add those same nodes I put on that simple canvas that said, did you have a question? Sorry, I thought you raised your hand. Put those same nodes on to do those actions.

But the difference is with an agent, instead of putting them at the end here just as a different node, we can just give them as tools for the agent to use by itself. Every node that we have in the regular tool, like Google Contacts, Gmail, you can use as a tool, which makes it this little circle node.

And then the AI agent can just use this node at its discretion. So for instance, we can say, send a message, and then these little buttonsright here, let the AI fill it in automatically. And does everyone here use Gmail for their work or for their personal?

Otherwise, Microsoft isn't quite as easy to set up with. But just go ahead, sign in with Google. I did not mean to flash all of my stuff there, but oh Jesus.

Is it going to break the recording if I unplug my computer for a second? It will? Like, can I plug it back in after? OK. I'm going to connect my Google really quick. So while I'm doing this, you can go ahead and also click that and get your set up,

which should just be a one-click install.

And my browser crashed.

Guest24:11

It's the demo effect.

Liam McGarrigle24:13

Mm-hmm.

That's the worst thing that happens today. We're doing OK.

Yes, it's me.

Allright. Does everyone have their Google connected?

Guest24:52

Yes.

Liam McGarrigle24:52

That worked for everybody? Probably took you less time than me.

OK, we good on the recording?

OK. So now you should have oh, it connected three times. OK, great. What trips a lot of people up about n8n, if you haven't used it before, if you click this, you're going to edit your old connection. If you want to add a new one, you need to click in here and say the add new credential.

And we just authenticated Gmail. We're also going to use Google Calendar.

So you have to sign in with Google with that one as well.

And now those will be connected, and it should work for everything that we need. So now we essentially just want to go in and set up these tools. So we're going to want this agent to be able to read our emails, search our emails, archive emails, send messages.

Toolbelt25:53

Liam McGarrigle25:53

So essentially, I'm just going to go ahead and do that. You guys can go ahead and do that too. If you have questions, hit any troubles. What you will need to know when you do that, this buttonright here lets the AI set it.

And I guess this is important to cover because in a lot of, like let's say Cloud Code, for example, if you give it access to your Google Calendar, it's essentially able to go in and do whatever it wants.

It has to go and make those API calls. When we're giving something a tool in n8n, it has every single field individually. So it can only set the things that we tell it to specifically. So we could, for instance, have the subject set, the message set, and only let it set the to field.

And since that's the only thing that we have, you can actually see how this is set up. It puts this helper expression in here. This is the only field it can do. So we can never change the other ones.

So that's one side of the double-edged sword. The other side of the double-edged sword is that it means we have to set up all the fields. So we have to go in and say, subject defined, message defined, to defined, which you can click that button, but you can also say from AI like this using this expression, and it will work.

The reason why you wouldn't just always click this little magic button is because sometimes you want to mix stuff together. So imagine I'm going to get a test value by saying a message like, what's my latest emails?

You have to have that set.

What's my latest emails?

And I can stop that. And now not only can I

put in the

from AI and then put in the field name, which this lets the AI, even though it says undefined, that's just because it doesn't have a value now. When it runs, the AI will provide a value. You could hard code something else in here.

Like you can say, responding to message. And then you can type as much static text as you want, but you can also reference other fields like chat inputright here. So if you want to be really transparent about what you're doing, you can be like, this is an AI responding to message this.

And then you can just include that in your email or whatever you're setting up with. So that's why you would use the from AI if you want to template it into text like that. For usright now, I just want it to do everything here.

And let's see. Is this set up correctly? Send a message.

Perfect. One other thing you need to know with setting up your tools is the prompting. This is something that I see people messing up in n8n all the time, is you need to name your nodes really well. So this automatic name is pretty good.

Send a message in Gmail. I would even just rename it to send an email.

And then this tool description where it's set automatically, you always want to set it manually and describe the tool and prompt it here. This is passed into the LLM to show it what tools are available to it. So every LLM call, essentially, and this is how tools work under the hood for every platform, the AI can see a list of all the tools with their names and descriptions.

The node name is the tool name. The node description is the tool description. So you can actually put in full prompts here. So what I do a lot of the times, instead of adding the system prompt inside of this AI agent, which, sorry, I didn't show you that yet.

I'm getting to it. I'm sure we're all familiar with the system prompt, being that we're at AI Engineer Conference. In here, in the system message, that's where you would normally put all of your different stuff. But I like to make it a little bit more modular by I only put my email prompts like, oh, don't use em dashes, don't do whatever in the actual description, which maybe some people would disagree with that approach.

I really like it because it's modular. I can copy a tool from different workflows, and it will just work.

I'm sure people are probably ahead of me now from a tool perspective of adding them, which is good. And if you fall behind, like I am here, again, you can come into this Notion page. And inside of here, you can cheat, copy, and then you just Command-V, and it pastes everything in.

And while I have this here, so that you guys don't have to sit through me writing a giant prompt and spelling everything incorrectly,

I'll just paste in the prompt I wrote last nightright here and kind of walk through the anatomy of it a little bit while you guys fill out those tools.

And all of the different boxes in n8n, you can always expand them up to be full screen, which makes it a little easier. So as I'm sure we're all aware, you want to tell the AI in the system prompt essentially who it is and what its purpose is.

I like to keep them pretty simple and just add stuff as I need to. So if a tool isn't being called, something's not happening, you just come in here and you tell it to change. So I gave it a brief list of how to behave,

like ask instead of hallucinating, all that kind of stuff. And this is really important. I'm sure we've all experienced this. You don't want to send a

to lead name to an actual

prospective client. That's really embarrassing,

which we sayright here. Don't use the placeholders. And also, LLMs usually don't know the time. So you'll say, what's today's emails? And it'll say, you have no emails on January 2023. And it's like, what? So if you use that convenience function here, which why did that change back?

That needs to be an expression. And then you'll see date, time, and it'll show this evaluates to this on the side.

Any questions from anyone? I know I've been jumping around a little bit. We're still all working on getting tools placed. OK, good, good, good.

And then I will cheat. And I'm just going to copy these. I guess I could have dragged them, but

paste them here.

A good tip when you're setting up something, set up the first one, get your authentication set up. And then instead of making a new one and setting the values, just copy and paste it because then that field is already set inside of it.

Saves a little bit of time having to click the little button every time.

And then another

little prompting trick is inside. Like when you set this here, there's this button here that says, add a description. And then this does what it says. It adds a description to that field with the AI. You'll notice sometimes there'll be a field that maybe it picks the wrong thing.

Like for instance, in Gmail, thread ID, maybe it'll put the message ID or something like that. You can add in a prompt here, and you can make this as long as you want. Tons and tons of lines, and it's fine.

So if something happens where it passes the wrong value or something, this is just yet another box where you can steer it to go into theright direction.

Something else you can do if something like, let me find a better example than thread ID. Maybe, oh, a great example. Great example is when creating an event in Google Calendar, the name of

the, let's see, where is it?

Summary is actually the title, which is extremely confusing even for all the humans using Gmail. We should probably change the name of this to title, but we just followed what Google's API names were. When you set this, what you should do is add a description and say, this is the title of the event.

Because summary, it would just put a summary of what the event is, of course. But this tells it this is the title. You could do even one better than that and click this, and you see the automatically generated keyright here.

You can change it from summary to just a title. And then AI will go in and fill title from there.

Now I'm going to test it, see if it's working. I have some fields that aren't filled in.

Does not have access to the credential.

OK.

Sometimes when you're working inside of a project and you make a credential inside of the project, remember projects are these things on the sidebar. You'll get an error saying it doesn't have access, which is really confusing because it looks like it does.

If you ever run into this, all you need to do is go to your home

and then in credentials, you can share them. So say share, and then you share it with the project.

Save.

Another example of double-edged swords where you're keeping it.

OK, this one's already owned by it.

Allright, and now my scaling is making this a little funny. But

when we

ask it, we can see what's on my calendar for today. We can see exactly what tools it used. It used get many messages.

And then if we click into that node specifically, we can see the exact output from that. And in the bottom here, we have detailed logs of everything that happened as well. So get many messages. The input in the search field was after 26-408 and before tomorrow.

And then in the message, we just got a summary of what these are, which this was me working because was a lot of people stuck in the line outside? There's a big line out there. Maybe you guys got in early.

Is everyone at this point where they're able to chat with it? Or are we still putting tools?

We're allright? Allright, great. Then at this point, I'm already a little nervous testing this with my real account because I don't want to send an email to anyone by accident or reply by accident,right? And I'm sure you guys are like,ugh, I don't want to say send an email and just have it do it automatically.

Human Loop41:12

Liam McGarrigle41:12

And that's pretty much the whole point of today's presentation is we made it so, so easy to add a lot of peace of mind here. So everything that we would consider like destructive or sensitive, we can add a human review step.

And let's see, that would be send an email reply. I'll just drag them to separate them. Send an email. Create event. And then I would say archive email would be borderline. I'm going to let it archive my emails.

If I miss an email, not that big of a deal. So now all you do on this branchright here, there's a trash can and a plus. If you press the plus button, it brings up the human review. And you can just use the chat platform we're using.

We're using the native n8n chat.

And then this makes this little human review stepright here. And now it is not possible. It just cannot get past this layer. It can't use this tool without going through this chat. And we can give it options like what the approve button would say.

We can change this to say send. And we can also add a disallow button.

And then we can block user input, but I like to leave it off because then you can just respond to it, and responding to the message will deny. And now we can see what this looks like and say,

send a test email to.

And hopefully it listens.

And we got an error when it hit it. We can see it went and used it, but we got an error. Response mode in the chat trigger must be set to using response modes. Another tip, a lot of people really, they see something red pop up and they're like, oh my gosh.

If you read the error, it usually tells you what the problem is, honestly. And a lot of painstaking work goes into the engineers write these messages themselves. Or maybe it has Claude do it these days. But let's see.

Response mode in the chat trigger must be set. So inside of the chat trigger, let's see, under options, there's this response mode. By default, it's set to streaming. And you'll see that the words come back one at a time in that chat screen.

But for the chat nodes to work, we need to set it to using respond nodes. And that just essentially does what it says. Instead of it streaming backright from the LLM, we are controlling what messages go to it using nodes on the screen.

So that would be a node like this human review. We also just have these

regular chat nodes in here where you can just send a message. That's the wrong one.

I'll show you this because it's very cool chat tool where you can just send a message in the chat with a tool, which you can do some cool stuff with. But then

now we actually, when we set that, we need to also, it won't respond at all unless it's through a chat node. So we have to add a chat node after the agent as well. Send a message. Andright now you can see that's blank.

I think this is JSON.message. It might be chat output. We'll test it though.

Say, hi.

And it'll come back. And what's the output?

Well, it's hanging now. That's another demo syndrome.

OK, I'm going to deactivate this node. Send a message. It's always good to have test data in there. I think the problem was this was undefined. OK, it's output. It's not message. So then we can just drag thisright to send a message.

Now we can test it again and make sure we get a message back. And then we can see it doesn't stream back. It sends it back in one chunk. Does that kind of make sense? I know that can trip people up.

You just have to respond with nodes at all times. Something else you can do cool with that as well is set like if branches,right? So you can check something in that message with an if branch and have different conditions of how to respond.

But we don't need to worry about thatright now. We're just responding with that. And now this will work again. So we can go back to testing and say, send a test email to.

Allright, and now we can see here in the chat,

if we can scale this up, the agent wants to call send an email. And if you're looking at that on your phone, you're probably going to say, OK, end, because obviously that's not really showing us anything. So we are going to press decline because I want to see my message.

And when we click into the human review node, now that we have that example, we can see where that came from. In this message, the agent wants to call tool.name. In this field, we can use this tool convenience function by saying money sign tool.

Live Test47:19

Liam McGarrigle47:45

And then parameters, which every field in n8n that's called the parameter under the hood. If you ever get this object object, the people who work in JavaScript will know what that's about. But you can say .to JSON string as a tip to see what the output is.

And even just thisright here would tell you the information that you need to know to the human review step, but obviously that's kind of ugly. So what I would rather do is say to, and this can say .message or .to,right?

And we don't need this to JSON string anymore.

From, we're not from, subject. Tool.parameters.subject

message.

Tool.parameters.message. And now we can see that the agent, that message will be something we can actually reasonably approve or deny.

And I will actually just rename this to the agent wants to send an email. Great.

And now I'm actually going to publish this so that I can see it in the chat hub. I'll go over here and

I'll say, again, send a test email to. I'll actually, I can't open my email, unfortunately. Whatever.

MCG.

And it comes back and says the agent wants to send an email and does all of that. And we can see it. And we can send it or decline it. And you can also deny it by just responding.

So we can say, I'd rather the message be marked down. Write an email that has different markdown features. And then that denies it. And it'll pretty much just try again.

It didn't listen to the markdown because it listened to the tool description much more. But you can see how that works. And then I can go ahead and send myself this junk email.

And there we go. Hope that kind of shows how powerful and cool this is because that is not able, that tool can't be called without going through that. It's just in the way. We at n8n made that layer to just intercept it in the middle.

And one of the really cool things about it is it doesn't even really know that there's a human review step there. So if you have your tools working and you add a human review step, it's not calling that human review step.

It's calling the tool and we're intercepting it. Like a lot of things in AI, that's also a double-edged sword because AIs will typically be wary of that. AIs that are a little smarter, they typically won't just send an email without asking unless you specifically tell it to.

So what I found is that sometimes in the descriptions, in these prompts, I'll say this won't send automatically. Don't be afraid to send a message. Message there is a human in the loop. And that usually fixes it because it'll be like, OK, it won't just be blasted out.

It will be used. Right?

So you can also, if you're really lazy like I am sometimes, you can actually put

multiple tools under one human in the loop. So we could put like the draft one under here as well. And then it will intercept it for both without anything having to change. It's just the fields are different and we made a custom message for it.

So we're going to add a different one. But laziness still prevails. So I'm going to try something. We'll see if the demo syndrome hurts us here.

And I'm going to say, add human in the loop just like it is on send an email to the.

And this is the n8n AI builder. Let's see, let me make sure this prompt is good. Add human in the loop just like it is.

Name the params and everything to match the tools. I found what helps a lot is if you have a lot of things that repeat, you can make one and then just say, OK, do this over there as well.

And you don't have to really click through. It'll actually do it faster than you're able to.

And we have this on cloud and enterprise. It's not on self-hosted yet. We're working on getting it there. But we did just release an MCP feature where you can hook it up to Claude Code or whatever agent you have.

And it can do the same functions that this has just through the CLI with the MCP.

And did this work? It looks like it might have. Validating the workflow. We can click in. It looks like it's working. OK, great. So now I'm going to publish this

and say, I'll go back to chat hub because it's a little nicer to see here.

Add a calendar invite for work calendar for lunch today at noon in the email. Oh my gosh, I don't know my own email.

Asking if he wants to go.

Send. Looks good to me. Wants to create a calendar event, lunch. Oh, that's kind of ugly. OK, so I'm going to create it because it won't change what's actually in there. But we can fix that. Let's make it better.

And this makes it so nice for testing because you can do dummy events and actually

see if it's going to the wrong person or doing the wrong thing. And you can just decline it. So you know you won't do anything by accident.

Remember in the beginning when I said, oh, you can see what goes wrong and everything? In this executions tab, you will see all of the times it was executed. It marks the test ones with the flask. But we'll see that execution from chatright here, we can see it went into the human in the loop and then it went down and created the event.

If you click copy to editor, we can now work with this data in here. So if we click into the tool, we see these dates that are super ugly here. And now this is where the JavaScript really comes in handy.

If you don't know JavaScript, you can just go ask a chat to tell you, format this date for me. But we can just say to date time and then .format.

And I think I can do ddddt.

Cannot convert. Oh, why not?

Let's see.

Oh my god, I tried to convert lunch to a date time.

We can't blame the demo luck for that one. OK, and then see now it knows that this is compatible. So when you press the .to date time, just already comes up. If we press the .again format, already comes up.

And the very nice engineers at n8n went in and added docs for us in here so we can see what all these things do. And you could even say, like C and minus, they show you code examples and everything.

It's very nice to go in and read it. I know we're tempted to just go ask Claude everythingright now. But if you read the things on the screen, I promise it is very helpful. But if we'll format this and say capital D, I think, yeah, there we go.

Nice. If you add a couple more Ds, it just becomes even nicer.

DDDD and then TT.

And this is if you're wondering what this is, this is just the Luxon date functions. It's just the date library we use.

Is what this DDT. I just have written it enough times to remember. But you can just ask Claude to format it for n8n and it'll do it. So now that looks much better. That's much easier for us to approve without having to read a UTC

timestamp. So we'll publish it again and say, put dinner on the cow for seven.

Q&A58:27

Liam McGarrigle58:27

There we go. It's fixed. And we can see how easy that is to go in and tweak and play around with everything. Does this all make sense here? Any questions? It doesn't have to be specifically related. Oh, and there's an email coming through, I guess.

Guest58:47

No, only discount code doesn't work.

Liam McGarrigle58:51

Only a month?

Guest58:51

Only a month of the year.

Liam McGarrigle58:54

Oh, really?

Only a month. Are you on Cloud Pro when you select it?

Guest59:01

Yeah, when I select it, I can always set up for a month of the year. But I select a month.

Liam McGarrigle59:07

I will go and make a new oneright now. Or check after. I'll make a new one so I don't leak how to create coupons.

Guest59:13

Yeah, after the session, I will come to you.

Liam McGarrigle59:16

Yeah. So I'll put it up. I'll leave it up for 24 hours. And then I'll remove it. Sorry about that. Fun thing, I actually made an entire discount system. Like our coupon generator at n8n is created entirely in n8n.

And it abstracts all of the different coupon systems we have across merch, enterprise, giveaway stuff, cloud. It all has a single entry point with a REST API that goes through n8n. And it has all the

audit logs and all that. It's really interesting. And I built the entire system in like six hours. So it's really, really powerful stuff. Yep.

Guest59:59

Yeah. You mentioned something about.

Liam McGarrigle1:00:01

Oh, do you mind waiting for the mic?

Guest 21:00:05

Thank you. You mentioned MCP server because up till late, there was an unofficial one on GitHub that I've actually been using so far. And it's been working great with Claude Code. Can you share a little bit more about the native MCP server that you have and if it's available?

Liam McGarrigle1:00:22

Yeah, absolutely. So this is really, really exciting. You should just be able to go into settings andright here, instance level MCP. If you click in here, you can just enable it and give it access to workflows. So

let's see what we have here. Workflows that are published or have a webhook form schedule or a chat trigger. So that should be ours. Email and calendar bot, enable. You have to give access per workflow,

which you can do up here as well. And say, settings available in MCP. That's just so that if you connect it to your thing, it won't go and change the wrong workflow by accident. It has to be enabled.

And now in that MCP thing, you can say connected clients or how do you connection details. You just put in your server URL in OAuth. So

in, let's see, in Claude. I'm almost afraid to open my Claude. But we are an official connector in Claude. So you could just say, connect n8n. You put that URL in. It'll connect with OAuth. You just press login.

Or if you are doing access token, you can copy that here. And you will copy this, paste it into your configuration file, and replace your access token with this. And it does all the same things that that MCP does, except we didn't have the limitation of having to work with the existing API we had.

We built itright in. So it does all the same stuff. I would say you can try both out and see. But ours is going to be adding more and more over time.

Did that answer your question? I guess I didn't really go into that much detail. But essentially, it's able to create, read, do all that. It's actually also able to execute. So you could say to Claude, run my email and calendar bot.

And it will send a chat message to it. And it's able to interact with it. So that's something else I don't think Roman's MCP can do. Yeah, so that's something that our MCP is able to do. Any other questions?

It can just be a random question like that too if you have any MCP stuff. Yep?

Guest1:02:53

I think there was another one.

Liam McGarrigle1:02:56

Oh, yes. Sorry.

Guest 21:02:59

Thank you. So assuming I want to build a company-wide workflow,right? And I want to have specific human in the loop from specific departments, specific actions, if that makes sense. Is there a way that I can log and see where the whole workflow delays?

So like a heat map of logs of who takes longer to respond, something like that.

Liam McGarrigle1:03:28

Hmm. Who takes longer to respond? That's an interesting use case. I was going to say we have lots of we have like audit logging functionalities in our enterprise plans. But that wouldn't be something baked in. But it's something you can make with n8n.

Because what happens with this, I'll show you really quickly. This still says waiting, even though that's not true. But I will say, send an email to that same other email. Do anything. Just test. So if we.

OK. So now what happens is this workflow that's the wrong thing. This workflow goes into a waiting state. And you can see it here. And then once it resumes, it shows finished. You can use a n8n node.

To get the execution. And it will show when it started waiting, when it stopped waiting. And then if you have your Slack connections and everything, it'll show all those details. So it would just be a matter of parsing that data.

So it's something you can make separately in n8n, aggregate the data together. That's an interesting use case. I'll write that. I'll think about that. Because audit logging, human in the loop, is something that we should definitely really get polished.

Let's see. Time check. We're at 11:50. I want to show you guys one more thing specifically to set you guys up. And that is

converting this to Slack. So if we take did anyone have any other questions before we do that? OK. So I'll just add Slack here. Does everyone here use Slack or Microsoft Teams? Hopefully, no one uses Teams. Slack, yeah.

I figured it would be mostly Slack. So my personal agent I use for myself, I use Slack. And it's really nice. I even have it set up. Soright here, I put in a Slack node to add a loading animation, which is a GIF of something dancing.

And then at the end, after it responds, it takes the thing away. So it even has like a loading indicator. It's really nice. You can go in and just replace the trigger and this response with Slack and do the same thing here where these go through Slack.

So that all works the same way you saw in Chat Hub. It would work in Slack. Something even cooler, though, or depending on what you think is cool, I suppose, instead of having this run

just when you message it, imagine if we just added a schedule trigger

and had that run every hour, once per hour, and added a prompt there to the schedule trigger

that says,

clear my inbox or whatever. Then it would run once per hour, do those actions. And these can be connected to Slack to just ping a channel. So it's still human in the looping for everything, but just running in the background.

You don't even have to initiate it. So you can imagine all the things in the background. What I use this for, if there's a GitHub issue or a PR or something, I have it come in. I have it go through, scan the code, do whatever, and send off messages to people asking them details that I know I'll have when I read through it.

And then I just have the message come to me. Because I don't want to AI message coworkers or clients or anything without seeing it first.

Does that make sense? Yeah. And all of that is actually in this Notion document as the next steps here.

In the next step, you can give it memory. So it can persist memory through sorry, you can hardly see that. But if you're in the Notion document, you can see. You can give it persistent memory. It will remember across sessions.

I give you everything you need to set that up. This is the instructions to go through and make it autonomous where you can still chat with it through Slack. But it also runs hourly and has everything set up.

And that's all in here for you to experiment with and expand this past, which hopefully I've set you up decently to be able to do that. We have 10 minutes left. And instead of starting the next thing, I would just like to answer anyone's questions or just chat about what's coming next for n8n, what you want it to be, anything like that.

So any questions? I would be happy to take you.

Guest 21:08:29

I want to ask about the human-in-the-loop executions. My case is a self-hosted instance in which we have a limit on concurrent executions. So I was asking whether the waiting executions count as

running executions. Because, for instance, if you have a 10 limit on concurrent executions, you may

become stuck because maybe 10 users just don't respond.

Liam McGarrigle1:09:12

Yeah.

I don't know the answer to that. I don't think it does. But it might. I'll give you something you can do if it does count. This will make it a little less painful. You can limit wait time. So you can say, after 10 minutes, automatically deny it.

So then you won't just have them piling up indefinitely. If someone just misses it, I know that just happens sometimes. And it's not like, OK, we're inevitably going to hit a point where we have this run out. So you can set a time limit.

Do you know the answer to that?

Guest1:09:47

I don't know.

Liam McGarrigle1:09:48

Yeah. So we can follow up with you for sure. I can find out after the session.

Guest 21:09:55

Thanks.

Liam McGarrigle1:10:00

Any other questions?

Guest 21:10:11

Hey. Yeah. So in a team setup where you have multiple people potentially working on the same workflow and so on, what's the approval process? And do you have something similar to a normal PR flow where you have someone who has to go in and approve the changes and so on to make sure it makes sense for the context,right?

Liam McGarrigle1:10:30

Yeah. So you could have in the trigger and this is what's great about it all being so customizable. So you said Microsoft Teams?

Guest1:10:37

No.

Liam McGarrigle1:10:38

Oh, if you have Teams.

Guest 21:10:39

No, but.

Liam McGarrigle1:10:40

Inside of a team. Yeah. So what you can do is the trigger, let's say it's Slack, it can take the user ID. And then the one that responds to it just references the user ID to respond to from there.

But then let's say that this tool is requesting vacation days. Obviously, that shouldn't go to the person who asked,right? So then that Slack message, you can just change the to field to whoever that decision maker is or whatever channel that is.

And then they can press approve or deny. Is that what you were asking?

Guest 21:11:10

Not really.

Liam McGarrigle1:11:10

Oh, sorry. What was the.

Guest 21:11:12

But it's a good additional thing. No, my question was more around managing workflows in general. You have a project. You have someone who initially sets it up. And then you invite some other people onto your team plan who also are supposed to help out, maybe adding some notes, tweaking, maybe your own vacation, someone.

Do you have some sort of approval process within the n8n platform that says, hey, I made changes? Like I branched out from this, made changes. I want to push this. Who can accept this and so on?

Liam McGarrigle1:11:45

Yeah. So the answer would really depend on if you're enterprise or not. Assuming it's not an enterprise plan, that would be just a matter of workflow design to do that and then just managing that internally of you make a copy of it.

And then whoever's in charge of managing it will replace it with those changes. If you are on enterprise, there's a whole environments and Git feature, which is exactly that. It has Git integrations. You can have multiple environments. So you can have dev, staging, prod.

And you can have people managing that and specific approvers.

But in terms of multiple people using do you mean multiple people using the same workflow or editing it?

Guest 21:12:31

More editing, yeah.

Liam McGarrigle1:12:33

Yeah. That's something that can be tricky with branches. Like if you wanted to have a feature branch or whatever, that would be something you would need to copy with to just copy it, bring it back, make the changes, or use enterprise and use the Git integrations.

That did get a whole lot better recently. Because there's now the there's not full two player yet where you can see two people working on the workflow where you can work on the workflow with another person live, but it live updates in the background now that we have auto save.

So if you're working on a workflow with another person remotely, you can see each other moving stuff around and stuff like that.

Guest 21:13:15

OK. Thanks.

Liam McGarrigle1:13:16

Yep.

Allright. Last couple of questions if anyone has anything. Yep.

Guest 21:13:29

What about human-in-the-loop for cases in which you have no UI? Because I saw that it shows two buttons, like accept and decline. But if you I guess that if you just respond accept to the LLM, he cannot just execute the tool.

Liam McGarrigle1:13:57

Exactly.

Guest 21:13:58

So in cases like a phone call, which

has no buttons to click, you expect the agent to ask for a confirmation. For instance, on a phone call with an agent that books appointments for you. And maybe he just asks for a confirmation before doing that. So can it handle such situation in which the prompt should suggest which button to click?

Liam McGarrigle1:14:41

So I'm not sure if we'll ever have the because that would require the LLM deciding if it's approved or denied, which the entire purpose of this is human review. It cannot get passed otherwise. So that's a brick wall, DMZ, nothing getting past it,right?

That being said,right now it's only chat platforms. I would like us to also have the ability to say custom. And it gives you back webhooks. Because under the hood, what it's doing is it's just making an endpoint that then those chat platforms send API requests to.

I would love if I just had those two API links, which it just puts a unique token so it knows which is which. And then you can integrate it yourself. So hopefully, that will come eventually. But for your specific use case, what I would say is you can use a sub-workflow and do that logic manually.

So you can make a sub-workflow. And you can have the action where it goes in and actually asks the question. You get it back. And then you just do an if node, if it's approved, if it's not. And then you have two branches based on that.

And you could do that in a tool with the execute sub-workflow. And you can just name it, confirm. And then it can respond true or false or whatever it needs to do. So you could do that, abstract away that into a tool.

It would just be workflow design instead of the human review step. Does that make sense?

Guest 21:16:09

Yes. Thanks.

Liam McGarrigle1:16:10

Allright. One last question.

Guest 21:16:14

Yes. Let's say you design a workflow in n8n and you want to use it as an API and call it from someplace else. Like in my company, we have we are able to deploy Microsoft stuff. The rest is complicated.

But use it as an engine and then just call it and hide the is that possible?

Liam McGarrigle1:16:36

Absolutely. I make full REST APIs in n8n all the time. And I make the fancy swagger docs and everything. Like I mentioned with the coupon generation, I made that whole coupon tool. It's a REST API so that other people on our team can integrate it into their n8n workflows and into the external tools.

And I made all of that and then just gave them REST API docs. And it's all inside of n8n. And everything's managed inside of there, including all the human in the loop and everything. So I hope that answers your question.

Absolutely. You would just make a webhook trigger like this.

Guest 21:17:15

OK.

Liam McGarrigle1:17:16

And then you get a pathright here. And you could do RESTful names too. So you do user and then, I don't know, post to create a user, for instance, if that makes sense.

Allright. And I think that's pretty much all the time we have. I hope that this was helpful and showed you new things and that you learned stuff and that you will go later and expand this to have much more than just Gmail and Google Calendar to do all of the things your heart wants.

One thing I would say, if you're going to add a bunch more tools to this, use the sub-agent tool, agent. And then you can have one agent that calls other specialized agents. So this agent we just made can go to be a calendar and email management sub-agent.

And you can build these out as many as you want. This one could be your GitHub issues. This one could be your, God forbid, Jira management agent. And the list goes on. That way, you're not adding so much context to just the main agent.

And you can change the model between each one. Each one can have a different LLM optimized for its different thing. Hope that makes sense. And I'm excited for you guys to try it out. If you guys see either of us or me at any other time during the conference, please come up and chat.

And don't forget to go and use your coupons.

Guest1:18:48

Don't forget to tell the other device.

Liam McGarrigle1:18:49

Yeah. I've been pressing defer on this for the last month straight. And I'm like, it's going to force an update during the thing. So it came up at exactly 12:00. So that's the session. Thank you guys so much.