I built an AI newsletter in system N8N that works on autopilot (free template)

In this tutorial, the presenter demonstrates how to construct a fully automated AI newsletter system using the n8n (referred to as NAN/NAM) workflow automation platform. The video walks through each node of the workflow: a scheduled trigger, a Tavily search step that mimics Google search, looping over returned URLs, extracting page content, using an LLM to identify relevant topics, storing intermediate results in Google Sheets, a research agent that deep‑dives into the top topics with additional Tavily search and extract steps, a writing agent that formats the final newsletter as styled HTML, a Gmail draft creation step, and a cleanup step that clears the sheet for the next run. The presenter runs the workflow live with a "latest AI news" query, shows how scraping errors are handled via a switch node, explains prompt engineering for the LLM, and displays the generated HTML newsletter with interactive buttons and source links. Throughout, he highlights where the free template can be downloaded from Commonush, how to import JSON files into n8n, and how users can customize or contribute their own templates. The overall narrative showcases a repeatable, end‑to‑end pipeline that produces daily, custom newsletters without manual intervention.
Chapters
What's up guys, in this video I'm going to be showing you a newsletter system that I built that can generate you completely custom newsletters every single day on autopilot without you even having to think about it. I'm going to give you a quick breakdown of the entire system and then we'll run it through so you can see how it all works and then we'll go into it in a little bit more depth. Also, by the way, the free template for this is available and I'll show you how you can get the free template later in the video. So if you're looking to get started with this straight away, then stick around and I'll show you how you can get the template. Okay, so we're inside of NAN now and you can see here this is the system and it's not a massive system, but depending on how much you've used NAM before, some areas of it may look a little bit complicated. So I'm gonna give you an overview of basically what the system is doing and then we'll give it a run through so you can see how it actually works. So at the beginning here, we just have a trigger node and you can set this to whatever kind of trigger you like. So it could be every Monday, Wednesday, and Friday, or it could be every day or a certain time, or it could be once a week, however you like. And then we have a Tavli step here and this is essentially acting as like a Google search step. So we can search the internet for things. We could put in a search query and it's going to give us back results. And then from that, we're going to get a bunch of different URLs of the search query that we search in there. So for example, if you have a newsletter on finance, let's say for example, your search query for this step may be something like latest finance news and then the date. And then every day that's going to run through and it might give you back 5 URLs of, you know, blog posts containing the latest news on finance for the day. And then we're going to loop over those items. Let's say we got 5 URLs back. We're then going to loop over each of those items. We're going to extract the content from that URL. That's then going to get passed to an LLM that is just going to extract the actual relevant information from there and sort of the actual, um, topics that we can focus on in the newsletter. And it's going to add that to a Google Sheet and it's going to keep looping around until it finishes all of those URLs. And then it's going to come up here. We're just going to get all of that information that we've put into the Google Sheet. And then we have a research agent here. That's going to take 5 different topics that have been generated by this agent here and put in the Google Sheet. It's gonna take 5 that it thinks are the most relevant and the most interesting, and then it's gonna search them in a little bit more in depth with these 2 Tavli tools here. Here it can search up the specific topic, and then here it'll be able to extract the information from the URLs that it gets back from the search. And then this agent here is just gonna output 5 different topics with all of the summaries that we would need to write a newsletter on it, and also the links to the source and any other additional information. And then this writing agent is actually going to kind of put all of that into a newsletter in a nice format. It's going to output in HTML, which means it's actually going to look nice and not look like just a standard email. And then we have a Gmail step here that's going to create a draft so we can review it, change if we want, and then of course just send it off. And at the end, we just have a Google Sheets step that's just going to delete all of the content from that Google Sheet. That way, the next time this runs, the Google Sheet will be blank and it can start back over again. Okay, so we're going to run this through now. And then our Tavli search step at the beginning The, uh, input is literally just latest AI news. So pretty generic, but what we're gonna do is we're gonna hit execute workflow and you can see this all run through and then we'll look at the actual data that's being passed through here to give you an idea of what is actually going on. Okay, so it's just finished looping through those items, adding it to the Google Sheet. So it went to the done route and now it's going up here. We got all of that information from the Google Sheet and now we have the research agent looking into all of these in a little bit more detail. And given us some insights. And then that will be passed to the writing agent, which does take a second to actually, um, write it. It's writing quite a bit of content. Um, so yeah, and then it will be drafted in Gmail, and it's just going to delete all of that content out of the row ready for the next one. Okay, so it's just finished now. It passed it to the writing agent, which then drafted it, and then like I said, deleted the content from the Google Sheet ready for the next one. So if we have a look in our drafts, this is what's just been drafted. So the subject line is just AI news, and then if we expand this You can see here that we get this fully, um, sort of fleshed out newsletter that actually looks nice and doesn't look like just a generic email. So, um, yeah, this is how it looks. There's buttons to read more, uh, you can see read more, watch a demo. So it's also found a demo video for this story and then read more, view survey results. This one was obviously about a survey, so it's actually linking to relevant sources, not just the source that it got the information from, actual sources that will be sort of beneficial to the user or to the reader that's reading this. By the way guys, if you want to get the free template for this, all you have to do is come over to Commonush. You can type it up or you can just follow the link in description and it will take you right to the template that you're looking to download for this video. And in here is just a massive database of all of my different templates that are completely free to download. All you have to do is find the one you want. Like I said, you can either come over here by searching it up or you can follow the link in description. And when you hit view details, you can say I want this template and then you'll be given all of the JSON files that you can just upload straight to your NAN instance. And you'll also be able to watch a video along with this in case you forget how it all works and you want to refresh it. And of course, if you want to upload any of your own templates to this, then all you have to do is just sign up for a free account, hit add template, and you can start adding your own templates. So if we have a look again at the system, we'll just break this down step by step so you can see exactly what's actually going on here. So the scheduled trigger is set for every day, so we set this to 1, so it's just going to run once a day. And then the trigger can just be at midnight. You can set this to whatever you like. And then we have the Tably search step here. The search query is latest AI news, and this is what it outputs. So it gives us a URL, it gives us a title, it gives us an overview of the content of that URL, and then it just repeats that. You can see for this one it gave us 4 different, uh, results. And then we just have a code step here that basically what it does is it goes through all of those results and then it will break them up into 5 different items. So for this, we actually got 5 results, sorry, because it starts at 0. And then ends at, uh, 4. So we've got 5 different results, and this code step here will just extract the URL and give us 5 separate items. That way we can deal with each of them individually rather than getting one item with all 5 URLs. We have 5 items with each URL, so then that way we can loop through all 5 of those items. So we just have a simple loop over items node, and we're just passing through the URLs like this. And then we have a Tavily step here, and this is going to be an extract step. And all we do is we put in the URLs that we're looking to scrape, and it will just output a nice text summary query like this of all the content of that page, and it will do that for each of the URLs as we scrape through all of them. I have found, um, when you're, when you're searching generic things like latest AI news, a lot of the time it will be blog posts and sort of articles from big companies reporting on things, and a lot of the time they can be kind of hard to scrape. So a lot of the time you will get errors with this. What I do is I put down a switch node, and basically you can see this one worked fine But sometimes the, um, results will be empty and we'll get an error that basically just says you can't scrape this because they have all of these like firewalls and things blocking you from scraping it. So sometimes that will happen. Uh, you can see 3 went through and it looks like 2 weren't able to be scraped. So what we do here is we put in the results from the extract step and just say if it's empty, then it means we weren't able to scrape it. If it's not empty, it means we were able to scrape it. So if it is empty, we just shoot that back to the loop over items and it's just going to go to the next one. So let's say the second one we weren't able to scrape, it'll shoot back up here and then it'll just start on the third one. And then we pass the information of the ones that are actually able to be scraped to this AI model here. And you can read the prompt, but basically what we're saying is we're giving you the content from articles on the latest AI news, and I want you to go through this and output different topics and stories that we can actually report on and give it to us in a nice structured format. Like this, and it's been instructed to just output 2 or 3 of the most relevant things that we can actually focus on. And then that will give us an output that looks something like this. And then we just have a Google Sheets node here that basically just adds that content to the Google Sheets. So if we open up this Google Sheet right now, it's going to be blank because we deleted them at the end of this run, but it's just one column which is just latest AI news stories. We just put the output from this AI model into that input there, and then it just puts all of the, um, latest AI news stories that it's got from those pages that we scraped into the Google Sheet. And then once it's looped through all 5 items, it will go to the done route. And you can see here it passes through 5 items, and this is one of the things that you'll probably encounter a lot with NAM. It's going to pass through 5 items because of course it was looping through 5 items. So then what we have to do there is we have to aggregate that, and we don't actually need the data from this done route because all the data we need is in the Google Sheet. So we just have an aggregate step here that just aggregates all of this information. But the only reason we do that is to change this from 5 items to 1 item, because when you're passing through 5 items— let's say we did this 5 items here straight into the Google Sheet— it would actually search the Google Sheet 5 times. So it kind of acts as like a multiplier because it's 5 different items, even if you aren't actually using any of the inputs from these items. It will, like I said, it just kind of acts like a multiplier downstream. So this would output, instead of 3, it would output 15 items because it would go through 3, uh, 5 times and end up outputting 15 items, obviously majority of them being duplicates. So that's why we do that. And then of course we just have the get rows in Sheets, and we just get all of the rows from that Google Sheet. In this case, it was 3 rows here because, like I said, 2 weren't able to be scraped, so only 3 actually went into the Google Sheet. And then we just have a code node here that puts all of them into one item. So at the moment it's 3 separate items that look like this. If we look in a table, you can see 3 separate items, but the schema will only give us one at a time. So we need to put all of those into one item with just a simple code node. And if you don't know how to write these code nodes, by the way, don't worry. I hardly know how to write them either. All I do is just, I just give all the context to ChatGPT and just get it to write. A JavaScript function, and then it does it for you pretty much flawlessly every time, especially if it's just simple things like this. So you can see now we just get one item with all of the stories that were in the Google Sheet, and then we can pass that over to this agent here. So we've inputted the results from here, which is just all of these stories, and then we've just given it a prompt, and we're basically saying you are a research agent that can research specific AI news stories to generate more insights. And then we said it'll be given a summary of all these different AI news stories and your job is to pick 5 that seem the most interesting and relevant and also the ones that are duplicated the most because there's gonna be duplicates in there because it's going through different pages and the LLM as it's looping through obviously doesn't know what the last LLM put, if that makes sense. So there's probably gonna be some duplicates in there and chances are if it's been repeated multiple times across different places on the internet, it's probably worth talking about. And I've also told it it's got 2 Tably tools to search for these further. And then the two Tavli tools it has is Tavli Search. That will be the same as this node here where you can just put in a search query and it will give you results back. And then it also has access to the, bear with me, the Tavli Extract tool where you can input URLs and get all of the content back. And we just want it to output 5 news stories with all of the relevant information about each story that you have gathered. Please also output a source URL for each topic that you report on. And then I've just told it the date as well, just because I found sometimes it wasn't sure of the actual date and it wasn't included in these stories here. Here. So it was searching for things like, uh, that topic and then 2024 at the end, which is obviously giving it the wrong results. So if you just let it know the date of today, then it can just add the date of today at the end of its search queries if it needs to. And then the two tools it has are the same two tools that we have here. So this tool and this tool, the search and extract. The search tool, very, very simple. It's just a query and we're letting the model define the parameter. And the way we do that is just by clicking this sort of sparkly looking button here. We just click that and then our AI agent can put whatever it wants in that input. And then extract, again, same thing. We're just setting this from search to extract, and then the operation is URLs. And then in here, again, we're just letting the model define the parameter, and it can put in the URLs that it gets from this search step. So if we actually have a look at the inputs and outputs, it inputted marketing AI consumer trust crisis 2025, AI tools shopper disrupt personal data handling impact advertising strategies. Regulations. So a bit of a mouthful, but obviously that was one of the things that were generated from the LLM steps before and put into the Google Sheet. And then this is the output it got. And then for the extract, it would have put in this URL here, which you can see is relevant to what I actually searched up. So I found an article that was relevant, and then it scraped it to get more insight on that specific topic. And then it outputted something that looked like this. You can see 5 different stories. So we've got number 1, and then number 2, and then obviously it goes all the way to 5. But it's quite a big output here. And then we pass that to our writing agent. So we just give it all of that information from here in our user prompt. And then the system prompt: you're part of a system that can generate newsletters every single day based on the most recent AI news. You'll receive 5 up-to-date AI news stories with all the relevant information you will need on them, and your job is format these into a newsletter. And then just sort of saying please expand the points, uh, make sure it's friendly and interesting. Then also provide the source links that would have been given in this user prompt. And then I've just given it some styling things with the HTML because it's going to be outputting in HTML because Gmail automatically renders HTML, which is pretty nice. So we're just giving it this style guide, um, and you don't really have to read it, but it's just a style guide on how it should use the HTML and how it should format this. And then it will give us an output like this, which is just obviously a big chunk of HTML, pretty hard for us to read. Um, it's pretty long. And then what we do is we have a Gmail step here that is create a draft, and we just put in the output from here. And again, it's just a big chunk of HTML that is pretty hard for us to read. Make sure to set the email type from text to HTML, otherwise it won't render. Um, the subject AR News. You can name this whatever you want. You can also add recipients in here if you want, but you could also do that from the actual Gmail web interface and, um, yeah, do it that way if you want to review it first. And then we simply have delete rows or columns from sheet, and we just output— and we just delete the first 10 rows because, um, there might have been more news stories here. This time I only did 3, but there might have been a little bit more. So just to be on the safe side, we say to delete 10, and it's just going to delete all the data from that Google Sheet. And then when this runs again it's going to be starting from a blank spreadsheet, so it's not going to be confusing any of the stories from yesterday or the week before or anything like that. So then, as I said earlier, this is how the output actually looks. And one of the cool things we can do, if I just send this to myself quickly, then you can see this is how a user would actually see it. Um, you can adjust all the styling and everything like this, but I think this gives you a pretty good idea of how it could look. And then these buttons, they actually work, which is pretty cool. So if we hit Read More in here, takes us to this relevant article. And then Watch Demo, for example, takes us to this YouTube video, and then view survey results, for example, takes us to see the results of the survey that it was reporting on here. And then there's an unsubscribe link, there's a sort of sign-off bit here, there's an address if you want to add an address. Um, so yeah, it's a pretty fleshed-out actual newsletter that is pretty much ready to just send off.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










