Step By Step: Automating Lead Nurturing with No Code in n8n

Dr. Violet Howard builds a no-code lead nurturing workflow in n8n that triggers from Google Forms, uses GPT-4 to write personalized emails and assign lead tags (high, medium, low), then updates Google Sheets and notifies Slack. The tutorial covers every node: OAuth setup, wait steps, prompt engineering for JSON output, and Gmail integration, with live tests showing how the workflow adapts for different leads.
Chapters
Today I'm going to be walking through step by step how to build this super simple workflow that's going to capture leads' information and then automatically email them, update in the CRM, and then notify your team about this new lead. This workflow uses absolutely no code, and by the end of this video you'll have it up and running for yourself. And I also wanted to mention that if you join my free school community with the link down in the description, you'll be able to download this exact template and just plug it into your own N8N, plug in your own credentials, and you'll have it up and running for yourself. Don't want to waste any time here. Let's do a quick demo and see what each note is doing, and then we'll get into the step-by-step tutorial. First things first, you can see that we have a Google Sheets trigger here. So every time that a new row is added to our Google Sheet, which is this sheet, um, the workflow execution will take place. And so this sheet is just responses from a Google Form that I've made right here. So it's very simple. It asks, interested in working with us? A lead will come in here, enter information like name, email, what they're interested in, their budget, that sort of thing. Similar to a form that's on my website where if people want to have me help them work on a project, they'll come and submit this form. And you could attach this to different websites or different groups based on a webhook within NNN. So that's how you could set up that trigger. But for the purpose of this video, we're just using this Google Form. Next, it's gonna go on to this wait step. In this example, we just have it waiting 1 second, but you could have it wait, you know, 5, 10, 15 minutes. That way, when someone submits a response to your form, they're not automatically being hit with an email. It'll feel more realistic when, you know, a human reaches out, which is just the workflow rather than, you know, an automatic reply that's going to feel like a robot. And then we have an OpenAI message model node. This one's going to actually create the email. It's going to be very personalized based on information they submitted in the form. And then it's also going to tag them as sort of like a high value lead or a hot lead. And that's going to update within your CRM. In this case, it's just a Google Sheet, but it's also going to give us a status of the lead and tell them you know, Sarah was reached out to at 12:55 on Monday. And then finally, after this step, it will go into the Slack node, and it's going to notify you and your team about the lead and what type of lead they are. So as you can see, this workflow is currently active. So that means anytime a form is actually submitted, it will take place. So let me fill out this form with some example data, and then we'll see the workflow in action. All right, we have the form filled out with some example data. We've got Sarah Johnson, her email, what type of services she's interested in, her budget, that sort of thing, and we'll submit this. So hopping over to the Google Form, we can see that this information has just populated in here. So in the background right now, N8N will be pulling this information and going through all this sort of logic. So I'll check back in in a sec and we'll look at the email, the new sheet, and the notification in Slack. All right, the workflow just finished running. We can see we just got this new email. So the subject is ABC Corp, excited to explore top-level AI options with you. Hi Sarah, thank you for reaching out to ABC Corp. We are thrilled to see your interest in our premium package, and we can't wait to explore top-level AI solutions with you. Understanding that you're ready to get started ASAP, we are here to ensure a smooth and efficient process. With a budget range of over $10,000, we can certainly tailor our offerings to meet your needs and provide the best AI consulting services available. Given your preferred contact time in the morning, I'd be delighted to arrange a discovery call at your earliest convenience, blah, blah, blah, blah. And then as you can see, it's signed off, Pam, customer service rep. ABC Corp. So it feels very personalized, definitely doesn't seem like an automatic message, um, especially if we added in a wait of, you know, 10 or 15 minutes. Then hopping back into the original Google Form sheet response, this is the information that came through. And as you can see, it updated the status and the tag. The status says Sarah Johnson was contacted by email on October 31st, 2024, 10:43 AM. The team has also been notified via Slack, and then she was tagged as a hot lead. So that's definitely important for you know, the team to know. And then finally hopping into the Slack channel, as you can see, we've got an alert, new hot lead alert, Sarah Johnson interested in the premium package, budget over $10,000. And then you have the option to check the lead in Google Sheets for more details. You can click on this link and it pulls up that sheet that we were just in. So that was a super quick example of what this workflow does. Hopefully you understand what each node is sort of doing, but if you don't, don't worry, we're about to build this thing step by step. Okay, I opened up a new workflow. Now we're going to walk through each node step by step. So as we know, the first thing we always need to do is add a trigger, and in this case it's going to be a Google Sheets trigger. So we're going to grab On Row Added because we want this to execute every time a new row is added. I think you guys understand that by now. So the first thing we have to do in this node is to set up a credential. So I already have mine set up, but you would come in here, click Create New Credential, and you need to grab a client ID and a client secret. So all you're going to do is you'll, you'll open Docs and you will go to Google Cloud. So once you set up your Google Cloud account, this is what it will look like. You'll be in your console. You want to go to APIs and Services. You want to enable Google Sheets API. So you'll search for Google Sheets and you'll click in here and you'll see that you can enable it. And then once you have that done, you want to go to your credentials. You'll create a new OAuth client ID. And if you're a little confused, I made a video on this. In my NNN video, I walked through this live. I also did it in a couple of my other videos. It's not too difficult. And then you'll just come into your client ID and you'll be able to grab a client ID and a client secret, which is what you'll paste in here. And then you'll just sign in with Google and it'll go green because you'll be good to go. But once you have that set up, then we can configure the rest of this node. So the poll times is going to be every minute. So every single minute, this, this node will check and see if any new row was added. And then After that, we have to choose the document and the sheet for this node to pull from. So it's called Lead Form Responses and the sheet is called Form Responses 1. As you can see right here, Lead Form Responses, Form Responses 1. So that's all that's happening here. And obviously it's going to trigger every time a row is added. So we can hit Fetch Test Event right here and we should see the information that's in our Google Sheet. So as you can see, we've got our headers and we have 2 items here. The headers are kind of duplicated and then we have this Sarah Johnson one that we just did for our demo. And I took out status and tags, so for the purpose of testing, we can continue to go through and see this information. But that is how you would set up this Google Sheets trigger. But I'm also going to add a, a regular Google Sheets node just to get this information very clean for us. So I'm going to come in here and do Get Rows in Sheet. Same exact thing, we just want to get row in lead form responses. And in form response is 1. And I'm going to test this step because we just want to get this information with the correct headers. So right here, as you can see, um, it's coming through twice because it's feeding in from this other one. So let's just delete this connection and we'll test this one again. And now we will see just that first row that we want with the correct headers. So this is the one we'll be using for testing this video, but this is the trigger and that's how you'll set it up when you actually want to make your workflow active. Okay, so from here we have our information we want. Now we want to add that wait step. This wait step is very easy. All you have to do is, you know, set up how much time you want to wait— seconds, minutes, hours, days. We're just going to do 1 second and we'll hit test. So it's going to wait a second and then it's going to move this information on to the next node. So as you can see, here's our information about Sarah Johnson. From here, we're going to add the node that's going to create the email and tag the lead. So that is going to be OpenAI. I know I use OpenAI in most of my videos, but I just, I like it. I'm pretty loyal to it right now. And once you get into this node, you're going to set up your credential. Once again, this one's a little easier. All you need is an API key. So in your OpenAI account, if you don't have one, go make one real quick. And then you're going to go grab your API keys. You'll hit create new key, name it whatever you want, create key, and then it will give you this value to copy into and then you'll paste that right there and you'll be good to go. So once you have that connected, the resource we're sending to this model is text. The operation is obviously message model. And then you choose the model from a list. As you can see, there's a lot of options with different GPTs, but we're going to do 4.0. And in this case, I'm doing 4.0 because it seems to be the most consistent and kind of the smartest when it comes to making something like a really personalized message. And that is what this node is going to be doing. So that's why I'm using 4.0 here. The next thing we need to do is prompt this agent. So usually when you're prompting sort of like a node, you want to make it a system prompt because as you can see right here, usually used to set the model's behavior or context for the next user message. So that's what we're going to be doing, a system prompt here. And give me one sec. I'm going to type out a big prompt and I don't want you guys to see that. So I'll be back in a sec. Okay. Kind of a gnarly prompt here. This node is going to be doing a lot of work for us. So let's get into it real quick. So I started off with, you are a lead nurturing assistant. Your job is to write an email to a new lead who just filled out the form on our website, which is an AI consulting website. So all I'm doing here is just giving it some context and some background of its job and some information. Your name is Pam and you work as a customer service rep for ABC Corp. Make sure your email is friendly and always signs off in a professional way. You should never include any placeholders like lead's name, your name, your company, et cetera. Please only address the lead by the first name if they entered their full name. So here's some information here. If you're wondering why some of this stuff is in here, like don't include placeholders. If you don't include that, sometimes it'll sign off as like, you know, best regards, your name, your company, or even say like, hey, lead's name. So we don't want any of that to happen. Obviously that's very obvious that it was automated. So then we come into giving it actual information. So here's information about the lead. We've got name, email, what they're interested in, all this kind of stuff, so that this node can make a very personalized email based on the information they submitted in that form. So let's, um, turn this into an expression because it's going to change every single time a new form is, is put in. So as you can see now, it's very simple. All we have to do is drag information from this left-hand side into where we want it. So obviously for name, we want the name value to be in here. So it's in this green notation with these two curly brackets, JSON.name. This is just a JavaScript variable that just basically says, okay, this is gonna change every time. As you can see on the right, it's Sarah Johnson. And same thing with email, it'll come through over here as JSON email address, but over here it's, you know, my, one of my emails, natehurk88@gmail.com. So we're gonna do the same thing, services interested in, budget range, preferred contact time, Project timeline and additional comments. So now on this right-hand side, you can see we have all this information filled out correctly, and this is what it's going to be using to make that email. Okay, so continuing on with the prompt, your email should be very personalized based on what they entered into the form. You should thank them for their interest in the— that they specified and include any relevant information. At the end, please include a call to action, like if they have any questions or if they'd like to schedule a discovery call. You should also output 3 fields separately. So this is the information coming in this node, and then on the right it'll be information coming out of the node. We want 3 different fields. We want one for the email subject called subject, one for the email body called body, and one for the tag, which is how we're tagging a lead. You'll see that in a sec. And this, this one's gonna be called tag. So the fields should always be called subject, body, or tag, otherwise the automation will break. Then I wrote the subject should always start with ABC Corp and then a brief description of the email. That way when it comes into the email, they see ABC Corp right away. And then we get into how you actually decide the value for a tag. So high value lead, the description is a lead with high budget, interested in premium services or specific urgent needs. I gave it some indicators like budget over $10,000, premium package, product timeline immediate, and then just a little bit of a purpose. And I did the same thing with medium. Value lead, low value lead, and hot lead. So I won't read all these, but let's just read low value lead real quick. So this is a lead with a limited budget, flexible project timeline, and interest in basic services or initial exploration. Some indicators, basic package, under $5,000 budget, and then, you know, pretty much same thing with all these other ones. So it's kind of an early prompt, like I said, but it does the trick. So then the last thing we need to do is output this content as JSON, and I'll show you guys exactly why. So let me just hit test step. So we told it to output 3 fields separately: subject, body, and tag. And so if we don't output it as JSON, it's going to put everything in one field. So as you can see, it's called content, and it has our subject right here, and then it has our body right here, and then at the bottom it should have our tag of hot lead. So that's not what we want. So if we output it as content or sorry, if we output the content as JSON and we run it again, it will actually split those 3 fields into 3 fields. So you can see here, now we have a subject, now we have a body, now we have a tag. So that's exactly what we wanted. This node is configured. And as you can see, I won't read this whole email, but it's going to be very personalized. It reaches out to Sarah, it signs off, best regards, Pam, customer service, ABC Corp. And yeah, it talks about exactly what she talked about in the form. So we know that is good to go here. So now we have the 3 tasks we want to do. We want it to email the lead, we want it to update that Google Sheet, and then we want it to send the notification in Slack. So first things first, we'll do the Gmail node. We're going to be sending a message here. And once again, you have to sign in with your credentials. It's a little easier now if you have your ID and secret set up. and then once again, you'll just sign in. So the resource that this node is doing is gonna be sending a message. Sorry, send message. And then we have to just fill out who it's going to, the subject, email type, and the message. So first thing I'm gonna do is turn this email type to text. And now it's super easy. Once again, just drag and drop. So to, we have the email that they were giving us from the original Google Sheets node. So we can see the email address is right here. Once again, we're just gonna drag and drop and it's very easy and it fills in with the the correct email subject. Now you can see why we wanted to get them in 3 different fields so that we can just drag subjects right in here. And it's as simple as that. ABC Corp. Welcome, Sarah. Let's explore top-level AI consulting options. Um, and then for message, we just want to drag in the body. And that is how, you know, the email is actually going to get sent off. As you can see, it's formatted pretty nice like an email too, which is awesome. And then the last thing we want to do is go to append NNN So we'll test the step, make sure everything's working right here. It will say that it was sent. And then if I hop back into my email and we refresh, we should see right here ABC Corp. Welcome, Sarah. We've got the information here. You know, it might mention her budget, it might mention whatever it is, but it's going to be a little different every time. But, you know, premium package and it's very going to be very personalized, which is awesome. All right, so that is good for the Gmail node. Next thing we want to do is drag this out. You always have to make sure all your nodes are connected, but we drag it from here. And now we will do a Google Sheets node once again. So this time we're not getting information, we're going to be updating a row. So there's Update Row in Sheet. We'll click on this one here. Same thing, you got to configure information. We're going to the sheet called Lead Form Responses. We're going to the sheet called Form Responses 1. And now we have to map out what we actually want to update. So this might pop up— or sorry, it will pop up, but it might seem a little daunting, but it's really not. First thing we have to do is match our columns. So we want to match on, you know, we could do any of this really. We're just going to match on name because it'll pretty much be unique. You could also do email if you wanted, but right now we're just going to do name. And all you have to do is drag in the name from the Google Sheet. So it's basically saying anytime, or when this gets triggered, when it's Sarah Johnson, it's gonna update that row where the name equals Sarah Johnson. And so all we want to update here is the status and the tag, so we can delete all this other stuff. So timestamp, email, phone, all this kind of stuff we can delete because we don't want to update that. We just want to update status and tag. So for status, what we want to say is something like, you know, Sarah Johnson. So as you can see, I dragged in the name Sarah Johnson was was contacted by email on, and now we want to say like what time it is. So if you do two curly brackets, you can see some suggested things right here. We've got now. So as you can see, this is just going to output the current date and time. So whenever this runs, it'll say what time the email was actually sent. But this is super ugly, datetime(2024, blah, blah, blah). It's got all this stuff. So we just need to format this time. So I'm just going to copy in this variable right here. And this will also— I'll make sure to put this in my school community as well. But it's a simple— it's the same dollar sign now, but then we just format it. So toFormat, all this kind of stuff. And now we can see it's coming out as October 31st, 2024, 11:09 AM. And that's exactly how we want it. And then we'll end off that sentence and then just say the team has also been notified via Slack, or, you know, however else you want to notify the team. So Sarah Johnson was contacted on the date and the team was notified. And then finally for tag, this one's easier. All I have to do is go back to the OpenAI node where we had it create an email and tag and just drag tag right here. So as you can see, it's coming through as a high value lead, and that way It's going to update those rows within the Google Sheet. So here's the response. These are the two columns we wanted to update, status and tag. Let's go into n8n, hit test step. It will say, um, here's the information that came through. And then we go into the form and you can see this stuff was updated and it came through correctly. All right, so this node is configured. Now we just need to set up that last one, which is the Slack notification. Okay, so once again, we'll drag this node out here. We want to connect it to a Slack node, and within Slack, all we want to do is send a message. So we got that right here under message actions, send a message. You'll connect to your Slack account. I'm pretty sure this one is, you know, you just have to sign in, so it's very easy. The operation is send, the resource is a message. We're going to be sending the message to a specific channel, so it's nice that it lets you choose. I'm going to choose the channel YouTube Testing. And the message type, you have different things you can choose from. We're just going to be doing a simple text message, very easy. And then let me copy in this message real quick. Okay, so here's the message we're sending. New blank alert. We're going to give the name, the interest, the budget, and then the link to the Google Sheet that we were just in. So we want to go to, um, first of all, grab our tag from the OpenAI node so we can put that right in between new alert. So now we have new high value lead alert. And then we need to just do the same thing. We'll grab this from the Google Sheets node. For name, obviously we're putting in the name. For interest, we're going to put in the services that Sarah is interested in. And then budget, we can just grab our budget range, um, variable. So as you can see over here, it's coming in as new high value lead alert. Sarah Johnson interested in the premium package, her budget's over $10,000. And then if you need more details, you can click on this link and it will take you back to that original form response from her. And then the last thing we want to do here is include link to workflow and turn that off. This will just ensure that the message comes through very clean. Actually, I'll turn it on and show you guys what happens if you don't do that. So the message got sent, we'll go into the Slack, and as you can see at the bottom, it says automated with this NAN workflow, which is kind of cool. You can click on it and see the workflow, but we want it to be a clean message like this one. So hop back in NNN, turn this off, test the step again. And now you can see this most recent message, there's no automated message at the bottom. So that's coming through nicely. And really that's it as far as like what we wanted to set up. Um, you probably just want to label your nodes. I labeled these two and, um, we'll just call this one like Notify Team. But yeah, um, that is all that we have really. So we will actually hook up this Google Sheets trigger now and resave this. And now we can see another live version of this stuff coming through. So let me just make this one active. Okay, so we've got it, this one's activated. And so we've seen Sarah Johnson's information come through. Let me go in here and submit another response, and we'll make this one maybe like a very low-value lead, and we'll see that tag come through, and we'll see what the email looks like. Okay, just filled out another form response. This one is for Michael Scott. We've got, um, he's interested in basic package, budget range under $2,000. He's flexible on his timeline and he's just exploring options. So let's submit this one. We'll see it come through right here in that Google Form, and there's no status or tag. So N8N should be working right now in the background in order to automate this. All right, that workflow just finished up running. First thing we'll look at is the email. So as you can see, we got this. ABC Corp. Exploring AI options with our basic package. Hello Michael, thank you for reaching out to ABC Corp. We are delighted to hear about your interest in our basic package. I understand that you're currently just exploring options and looking to learn more about how AI can benefit your needs. Our basic package is a perfect start for individuals or businesses, blah blah blah. Since your preferred contact time is in the evening, I'd be more than happy to arrange a time that works for you to discuss your needs further. We can cover any questions you might have and explore how we can align with your goals. Please let me know. Warm regards, Pam, customer service, ABC Corp. So that's awesome. We'll hop into the form real quick. As you can see now, we got a status and a tag. He was tagged as a low value lead, and Michael Scott was contacted by email on October 31st, 11:16 AM. The team has been notified via Slack. Hop into Slack. New low value lead alert. Name, Michael Scott. Basic package. His budget's under $2,000. You can click on this link. And it will pull up that form in case we want to see any more information, like if they wanted to maybe reach out personally on email. And yeah, so that is all working properly. All right, so this was a very simple use case of sort of capturing some sort of form from a lead magnet. It's going to go through and it's going to email them, update stuff, notify your team. But there's also definitely ways you could work off of this, like you could have some sort of campaign off of here where you're monitoring this thread, and if there's no response, you could reach back out again automatically. You could have them update in a CRM and sort of like add action steps for your team. You know, you can connect to other workflows in order to just sort of expand on this. So you're automating, you know, even more of the lead nurturing and sort of personalized outreach process than what goes right here. But hopefully that this opened your eyes on, you know, the power of a single node. It was able to take a massive prompt and assign out different tasks based on the way we were able to prompt it. And, it's just, I guess, super cool that you can also like add a wait step. It feels very personalized. And the fact that you can just have a form sitting there and stuff will still be happening in the background is super, super beneficial. And I think it's super cool. So if you guys made it all the way to the end, thank you. Really appreciate you guys watching. And I hope I can see and talk to you guys in the school community. And yeah, appreciate all the support. And that's it for today. Thanks, guys.










