N8n AI Agents Secrets to Book More Calls in GHL [Step-By-Step]

Maxime Warnault builds an AI scheduling agent in n8n and GoHighLevel that books calls automatically. The agent collects contact info via chat, checks available slots, and books appointments without human help. He connects it to a lead-qualification pipeline so qualified prospects get scheduled instantly, 24/7.
Chapters
All right guys, so in this video we are going to create an AI agent that books appointments, reschedules appointments, and cancels appointments for you via chat on autopilot. Okay, so what we're going to do is we're going to create a new note in here just to keep things separate. I like to do that in NLN, and I'm going to say AI Scheduler, and we can do book, reschedule, cancel calls. Okay, so that's it. Now what I'm going to do is I'm going to copy this, probably just this, paste, and this way I don't have to start from scratch, and I'm going to duplicate this one as well, and we're going to link it here. Perfect. So this one I'm going to rename AI Scheduler. So this is going to be my AI agent. This one is going to be Webhook for Scheduler, and we're going to rename it AI Scheduler. This one is going to be webhook setter. AI setter, AI scheduler, OpenAI memory. We're gonna need the update first name and the output as well. Response. Okay, so in this AI agent, we're going to have a lot more tools than we have here, and the response is going to be always virtually the same. Okay, let me just get my prompt. I already have one created in here. So, the scheduler is going to be all of this, and I'm going to paste it in here. And— we're going to need to rename the webhook to be this. Okay, so now we have the prompt, the webhook AI scheduler body booking page. And so what I'm going to do is I am going to test it. So we're going to test. All right. Oh, so we had the pinned data. I don't want, I don't want this. Because this is going to be the setter, as you can see. So what I want to do is go to Systems to Scale, and I want to go to— I want to go to my AI Agent Scheduler, and here we're going to run a test. So this is going to be NN Test. So if you don't know this, here you can have a test URL, and this is what I added here. Okay, so we have a few different things here. We have the scheduler, the calendar ID in which we are going to book calls. We have the lead score from the lead from the previous step. We have the booking page and the booked page. Okay. So let me just run a test for this one. Test again. We're going to use this with me, and let's make sure that it is running. Test workflow. I'm sorry, cancel that. We need to remove the pinned data. Okay, so now it's going to listen and it's going to wait for some data. So that's what we have here. Send test request, and we're going to see— boom— that it— problem in response because we don't have the AI Seller, it's now AI Scheduler. Okay, we can see that now we have the booking page, we have the thank you page, and we have the message is null. We see the lead score, everything we need to book a call. Okay. So what the AI replied with is, what's your email address directly? So not very friendly, but here we should actually stop the, like the next step by asking a question based on what you've shared. Would you like, would you be open to hearing how that works? Yes. And so we can pick it. Backup here by saying something like, first message, awesome, do you want to find a date here that works for you, or you'd rather I send you the booking link directly? And validate contact. What's your first name? So we have the first name. What's your email address? Okay, so basically what we want to do now is just create the tools that we are going to need here. So I'm going to start by duplicating this. I know I'm going to need a phone number. I know I'm going to need an email address, so I'm going to update this. Update contact first name. Okay, we're gonna do update contact email address, and we're gonna do update contact phone number. Update contact phone number. Sorry for the noise. Okay, so we are gonna need to attach these tools here. Done. So if we do that, now we have the update first name, update email address, update phone number. So the first name is going to work because this is what we've been using before, but now we need to update the email address to not have the first name but the property email, and we're going to let AI define this data. Okay, then we have the phone number, so we need to do the same with the phone number. I tried to have all of them at once, but it just didn't work because if you update the first name in GoHighLevel and you don't have the email address, it's going to give you an error and it's not going to work. So I just have them separated. Okay, so that's how it works. And now we can ask for their email address, we can ask for their first name, we can ask for their phone number before we actually book the call. Now what we're going to need to do is— stop light— go to the GoHighLevel API, and we need to— actually, the first thing we're going to need to do is to get the appointments for a contact. So we can get a contact, we can update a contact, we can get free slots. So we're going to start with the get free slots. Okay, so calendar, get free slots. Here, and we can go to the API, and we can see this is a GET. So what we're going to need here is we're going to need an HTTP module to make a request, API request. The— this is going to be— let me see what we add in here. This is going to be the the calendar_id. Okay, so we're gonna use— I'm just gonna paste this here. I need to get it from somewhere else here. Generally just do copy and paste like this. So HTTP, so this one is going to be GET 3 slots. Okay. Okay. So here, now we're going to replace this with calendar ID. Oops, I forgot the C, but this is going to be calendar ID. And we need to check expression, otherwise it's going to be used as a text only. Okay. So now you can see what it looks like. Results. We have calendar. The calendar ID is this one, and we get the free slots for this. You can use placeholder for any part of the request to be filled by the model. Okay. I don't know why this is here. So what do we need? Calendar ID in the path parameter, the start date, the end date as the query parameters. So query parameters. Okay. Do we have any headers? Yeah, we have. I like to start with the headers. Headers, version, and we're going to get this using field below. Cool. We don't have a body. This is the response, so we only have query parameters. So start date, end date. So this is going to be— so let me click here, start date. We're going to get the— this from the AI. Okay, so AI is going to— our AI agent is going to pass this data, start date, end date, and we're going to get the free slots for all of this. Description— actually, I put this in the wrong place, so now we put— need to put this in the URL description. Maybe we can get free slots for a calendar, request free slots in particular time zone for a particular user. And what I want to say here is the start date— this we don't need— the start date should always be in milliseconds. The start date and the end date should always be in milliseconds. So you can see the format here. This is a millisecond format. Millisecond date format, I think it is Unix epox— epoch. But yeah, milliseconds is more than enough. So the start date and the end date should always be, or must always be, in milliseconds. For example, and I know I have this in my prompt in here, I just like to have this in the description as well because this is the tool that we're going to use. So The description of the tool is used by the AI agent to know how it works. Okay, so we're going to use the start date here and end date here. Okay, so now if we look here, you can see clearly. So it's today plus 1 day to UTC time zone to London. So in the middle of the world, and 2 milliseconds. And the end date is now plus 2 days. So today is the date with midnight as the date, and we had plus 1 day, so it's tomorrow at midnight, or tonight at midnight, or tomorrow at midnight, I don't even know. And on this one, we had 2 days, so it's in 2 days, and right now it's 10:34 AM. So it is going to be 10:34 AM in milliseconds. Okay, so that's all we need in here. All right, so now what we need to do is to— let's see what we have in our AI agent tools. Get contact, we don't need this because we're going to get the data from the ID, the email, all of this in here. We're going to have update contact first name. So I split this into different ones. First name, use this tool to update the contact's first name. Let me put this big. Then we have email, the contact email address. And, and this one is going to be the phone number. Phone number. Use this tool, will update the contact. Okay. Get free slots, use this tool to get available slots date using the millisecond format. Get appointments for contact. Okay. So now what we need to do is to get the appointments for a specific contact. Okay. So we're going to go Calendar event, it's here. Contact, get appointment for contact, and we have the GET here. So all we have to do is duplicate this, get free slots. We need to link it to the AI agent. We're going to rename it GET. I'm lazy, so we're going to just do it like this, get appointment for contact. We're going to copy the link in here, and we're going to copy this in here for contact. And so what we need in this one is the contact ID, and that's it. Okay, so what I'm going to do is copy this, So, this is the ID of the contact that we're going to get the appointments for. So, you can see this is the contact ID in here, and this is a GET method. We don't need any query parameters. So, path parameter is the contact ID. So, we have that. We have the version, which is a different version here. And the path, send query path, we don't have any because we, all we need is the customer ID or the contact ID to get all of the appointments for a specific contact. So that's all good. Actually, what I missed is the authentication in here. So we need to go to the high-level authentication. Don't forget to use a sub-account in here. And we're going to need to do the same for the get appointment booked— or get free slots, sorry. Always use a location, not the agency. And that should be good to go. So that's the second tool to get the appointments available for a contact. So we're going to use this in order to get the appointments, if the contact wants to reschedule, we ask them which call do you want to reschedule. If they have multiple calls, we're going to give them a list and we ask them which one they want to reschedule, okay, or which one they want to cancel. So now we're going to use book appointment, reschedule appointment, and cancel appointment, okay. So let's go ahead and do that. So pretty easy here as well. So everything we need is just to— oops, not deactivate, duplicate. So this one is going to be in the appointments, and we're going to events, create appointment. So this is a POST now. So we're going to do book appointments for this one, rename. Book appointment. So we're going to put this here, we're going to link it, and this one is a POST. You can see it's in blue, so we need to change the method to POST. And here, so what does it ask us? We need the header, so the authorization, we need the version. So once again, I'm starting with this. The version. We have the authorization in here, the authentication. And so create appointment, we're going to need calendar ID. Okay, body, we're going to need calendar ID. So where is the body? Send the body. And we can have an example of the body in here on the right. So Basically what we want is, uh, useJSON. I don't think that was the one that I used. Get free slot, get calendar, calendar event, update appointment, delete. Maybe it is. Yeah, I don't see any other, so I think that must be it. Create calendar. Yeah, this is just a calendar, calendar group, calendar event. Yeah, that is the one that should be using. Okay, so you can see it required, required, required, required. So we have the calendar ID and we're going to do all of this is going to re— oh, we need to turn on expression. Let me put this in big. Basically, we need the calendar ID, the location ID, the contact ID, the start time. But this needs to be— okay, so I'm going to need to do it using the fields below. Okay, so we're going to start with calendar ID. So let's just go here, calendar ID, using the field below, and we're going to need here the calendar ID. All right. So, to book the appointment— boom! Next, we need the location ID. So, this is going to be using field below, and instead of calendar, we have location ID. And you can see it works. Then we need the contact ID using the field below. Once again, this one is just ID because we pass the contact directly. And then we have start time, which is going to be defined by the model and is required. Okay, so when we book a call, we actually ask the the person to give us the start time. The rest we already have it figured out, but we need to ask the person when do they want to book their call. So this is why we use this by model and is required, because as you can see, this is required. And we're going to be defining this value with the user by talking to them. Which date and time do you want to book your call. So let's save this. Always a good idea to save. So what are we missing here? Start time. But you can see here the start time is in ISO. ISO. So what we want is to provide the same description as we had in the getFreeSlots or like a similar, but we want to say book an appointment for a contact. The start date, start time, start time, oops, here, start time and end time must always be in ISO date format. Oh, we need to do datetime format. This is the one that we need to use. I already have this in my prompt, but I want to show you datetime format. And then we're going to say, for example, so let's go into the prompt and we're going to need to tell it 2 milliseconds to ISO. Okay. ISO. For example, start to UTC, to ISO. Okay, so I can do the same for this one. So basically we need to choose start time, end time, and you can see now that the start time is so tonight at 22, so at 10 PM. And this one is 2 days from now at 8:46. Okay, so that is an example. So we're gonna say plus 1 hour. Oh, today. So this way, because when we book a call, it's generally going to be 1 hour. So we have 22 plus hours, yeah, from 11 to midnight. So this is the today, so it's 22. Yeah, okay, so that makes sense. 22 at 11 PM, and then it's the 23rd at midnight. Cool. Good, good, good. Now we have everything we need in here. So the next one is going to be reschedule a call. So basically what it's going to do is going to get the appointment for the contact and then we're going to reschedule the call. So let's duplicate this and we're going to rename reschedule appointment. We're going to attach this to the AI agent, and we're going to ask it to update an appointment. So now this is PUT and— PUT. PUT. So this one is a little different. I'm going to keep the event ID like this. So you can use a placeholder for any part of the request to be filled by the model. Provide more context about them in the placeholder section. Okay, so basically what this does is we're going to ask the contact here, get appointments for contact, and to choose if they have more than one appointment to edit. And in the prompt, we ask it to always return the event ID. Why do we have this? Yeah. So, reschedule appointment, use get appointment for contact to find an appointment to reschedule, and always return the event ID to reschedule appointment. So, this is what we're going to pass in the reschedule appointment here to reschedule the appointment. Okay. What we can do is placeholder definition. We're going to have a placeholder name. So, this one is event ID, ID of the appointment to be rescheduled, type, this is going to be a string. Yep, perfect. So that's all we need. And here, update an appointment by ID. And so what do we need? The event ID in the path, the version, always make sure that you have the right version in here, header, the authorization is done. And then what we need is going to be the calendar ID. So we update the calendar in the same calendar, in the same location. And so what do we need here? Title— basically, it's just to reschedule. So we're just going to change the start time and the end time. So once again, it's in ISO format, and all we need is the calendar ID. We don't need the location ID, we don't need the contact ID on this one. We just need the calendar ID. Right, cool. Body. Maybe we do. I think this is not done properly. Successful response. Let's see what they have in here. Pick an example. Example 1. Test calendar. No, they just have the calendar ID. Provide all the required— okay, please provide a valid calendar ID event. Okay, it's fine. We probably don't need this information, so we're going to keep it like this. Calendar ID is going to be the one needed. We start time, we use— yeah, that's all we need. So the start time must be in ISO. Perfect. Good. Let's save this. And the final one is going to be delete an event. So, this is going to be the cancel appointment. So, we're going to duplicate this. We're going to rename this cancel appointment. And as usual, we're going to connect it to the AI agent. We can clean all of this up. And we can say cancel an appointment by ID. Okay, so once again, we're going to need the event ID. So I'm going to keep this. So this is the same date appointment. Yes. Yes. So Now it's going to be delete for this one. And let's make sure we have the right URL in here. Delete event ID. We have the description of ID of the event to be— okay, version. Boom. And Succeeded. Yeah, that's all we need. We don't need any body in here, we just need the header. Perfect. Uh, so we're going to remove this. Perfect. And so now we should have everything we need for this AI scheduler. Cancel appointment, reschedule, book, get appointment for contact, get free slots, update the contact first name, email, phone number. All right, so let's try this. So let me get my phone and we are going to make sure that we have the right, the right person here. So we need to go to my contact and we're going to check if we have everything ready to go. So AI agent, we have the score. We have AI Scheduler in here. So what we need to do now is going to start chatting with the AI agent. So we're going to say, "Let's go," and we're going to see what it does in the execution. So it's 10:55 now. Let's see. Oh, one thing I forgot to change here is I keep— kept the— oops, I just kept the test, so it needs to be the live version if we want to test this live. Okay, so I'm just going to say let's go, and we should See it. So because it was a test webhook, now it sent me an object. But now on this one, it should go in the right place. Cool. Oh, it still forgot to replace this. What's your email address? I don't know why it asks what's your email address directly, but it's all good. We can update the prompt later on. Here we're going to use AI Scheduler. So what this did was output a question for the person. So it updated the contact first name and went into OpenAI What's your email address? Cause didn't we have the email address? We have the email address. I don't know why it went directly to what's your email address. Where do we have this? What's your email address? Check if the email phone number is empty. So what we can do here is in the execution, we can see what is the data and what is exactly the prompt that is being passed. Here. And as you can see, we have the name, email, phone number, if the email is empty. Okay, so the memory. Let's see what we have here. Maxime, what's your email address? So it asked me 3 times, what's your email address? Okay, so we're going to play along with this. I'm just going to type my email address. So boom, now I should actually receive the message, because now I did not receive the message, um, because there was an error in the response, but I fixed it. So now all succeeded. What's your phone number? It asked me, so I'm just going to copy this same phone number. I don't know why it's reasking for it. But I'm just playing along with what it asks me. Running. So now it's probably going to get the free slots and recommend me free slots. So let's see. Yep. So as you can see here, we have, "I found some available slots for you. Here are the options for your appointment: April 24th." So we are the 23rd now. April 24th at 2:00, 2:30, 3:00, or 3:30. And it verified my contact information before, so when I book the call, it's actually going to send me the email, send me the SMS that we need. So it does the thing in the right order. So I'm going to say April— or I'm going to say the 25th at 4 PM. Okay, so now we're going to see if the book appointment works. So on this one, what it did is it updated the first name, email address, contact phone number. It got the free slots available and formulated an answer based on that. Now I told him I want the 25th at 4 PM, and it seems to be working. So now I booked the appointment. We have a new appointment, and we're gonna see a lot of this. So, new appointment created. And it should have replied with something. Your 60-minute call has been booked for April 25th at 6 PM your local time zone. You'll get an email with the meeting link shortly. Here's the link to join. If you need to cancel or reschedule, please send me "cancel" or "reschedule" and I'll help you do that. And looking forward to chatting with you soon. Here are a couple of resources and clients' contacts before we move forward with our call. So then you can go to the thank you page. And so basically now what it asks them to do is to reply yes to confirm that they will attend the call. What I want to do is let's try to reschedule now just to make sure that the reschedule is working. So I'm going to tell it reschedule, and what it's going to do is going to get the appointment for the contact and ask me if that's the one I want to reschedule, and then get the free slots to ask me what time I want to reschedule. Let's see. Seems like everything is working perfectly. So as I said, get the free slot, get the contact, get the free slots. And it apparently rescheduled the appointment already. So it's not really the behavior that I want to have. Okay. I don't know why it rescheduled for 2 PM. Updated, changed, and then we receive the thing again, but that, that needs to be changed in the AI Scheduler. I just wanna make sure that this is working for the reschedule. What I'm testing now is the API. Then I can update the prompt to make it logically work. But yeah, this one has been rescheduled. So if we go to the appointment, We have cancelled, cancelled, cancelled, and this one is actually the one that is confirmed. 8 AM EDT. So we're gonna see EDT, 2 PM in Barcelona. Perfect. So now I want to cancel the call. So cancel, and it should go directly into, or it should get the appointment for the contact and it should cancel the call. I think it asks for confirmation before canceling the call. So, "You have a confirmed appointment. Would you like to reschedule this appointment before I cancel it?" No, just cancel it. So, that's all to be added in the prompt. So, to have confirmation, to make it flow the way you want it to flow. Okay. So now we are testing the cancel appointment, making sure that it's working. And it seems to be working. Response succeeded. And it replied to me, "Your appointment for April 24th, 2025 at 2 PM has been successfully canceled. If you need to reschedule or have any other questions, feel free to let me know. I am here to help." Cool. So everything is working. We can now chat with our AI agent to book calls for us, and it gets the appointments we have. We can ask it, do I have any appointment booked? And it's going to look into the contact, get appointment for contact. It's going to book calls, it's going to reschedule calls, it's going to cancel calls for you. So this way you can, as soon as the AI setter is done, it's qualified, the lead score is above 5, it's going to be sent to the AI Scheduler because we tag it here in the AI Scheduler, and that's what it's triggering the automation on the other side. So when this is AI Scheduler, this AI Seller is going to be removed, and this is now going to go to this one. And then there and there we can help people actually book an appointment, do whatever I just showed you to do. That's it for this video. I'm just going to clean this up and yeah, like now we have an AI scheduler that works for us 24/7 without us having to do anything. So we qualify the leads, we get them to book an appointment on complete autopilot. So if you guys have any questions, let me know below and I will see you guys in the next video. Peace.
More from Maxime

I was talking to one of my clients' husband today and she's very not tech savvy and her hu

Most of the time we undercharge in the marketplace because we feel we do is not valuable e









