Build this Multi AI Agent System for Research and Content Creation in n8n

Dr. Violet Howard builds a content pipeline in n8n that pulls articles from Tavily, feeds them to three AI agents, and generates platform-specific posts for LinkedIn, X, and blogs. The workflow starts with a Google Sheet, uses specialized LLM agents to tailor content to your audience, and writes posts back to the sheet automatically.
Chapters
So right here we have a content creation database where we input a campaign name, a subject, and a target audience. And then this Agentic workflow right here will take these 3 things and make very tailored LinkedIn posts, X posts, and blog posts, like I said, based on the information that we provide. So in this demo, we'll be looking at the campaign of OpenAI News. The subject is recent news about OpenAI, and then the target audience is AI enthusiasts. So we'll come in here, we'll hit test step. And then we will come back into the database and watch this happen. It's going to generate all 3 of these posts for us that are going to be very tailored towards AI enthusiasts. As you can see, it's finishing up the blog right now, and then we'll take a look at what comes back in our Google Sheet. So here comes the LinkedIn post. Let me just expand this real quick. So LinkedIn post, as you can see, it's, it's very optimized for mobile. It has emojis. It's very professional but also friendly. It ends with a call to action and hashtags. For the X post, it's a lot shorter, more concise, and it also ends with a call to action. And for the blog post, we get sort of a more structured 2-paragraph blog. And obviously you can change the way that this stuff comes back based on the way you prompt it. But that's a quick demo of how this content creator agent works. It, you know, takes our, our subject, it automatically does research, it goes and gets recent information, and then it's going to form those posts. So let's get into this actual build. All right, so here's the workflow we'll be breaking down today. As you saw in the demo, basically you're going to put in information within a Google Sheet or some sort of database. Airtable could work great too, where you're telling the agent, okay, this is the campaign, this is what I want you to search for, and I want you to tailor your posts towards this sort of target audience. So that's what's going on in the Get Campaign. So real quick, let's come in here and we'll walk through an example happening live. So for campaign, let's do, um, let's do food trends. We will do recent trends in the food service industry, and then target audience, we will just do small business owners. So not sure that exactly is all cohesive, but this is the example we're looking at, and we'll see what we get back. So we'll load this into N8N. So we'll just test this step to get the campaign information. We got 4 items back, so we're just limiting it to 1. Also, one thing I want to mention is, um, at the end of the video we're going to change this up so it's actually a Google Sheets trigger, so you don't have to test everything. We'll make it an active workflow, and then that way when you type in information in your content creation database, the workflow will just take place automatically. But for testing purposes and to see everything visually happen, we want to do it manually so we can see node by node, understand what's going on in each one. So anyways, we got the information here, and now we're limiting it to just that last row. So we're getting the campaign As you can see, food trends, recent trends in the food service industry, and then target audience is small business owners. And then later it's going to fill in the LinkedIn, the X, and the blog post for us. So next, what we're doing is we're just setting up the field. So I'll run this real quick. We're, we're setting a query and a target audience. So obviously that stuff is coming from right here and we want, um, the query is the content subject. So whatever you type in that subject is what we're going to have. Tavily is what we're using for our searching. But Tavily is going to be searching with this query of recent trends in the food service industry. So we're just setting that and we're doing the same thing with target audience. Um, it's coming from here obviously, but we want to set it here. And then we're getting into our actual HTTP request. So in this HTTP request, that's where we're feeding in this information to actually get article information back. So we're using Tavily. So I have the URL right here for Tavily. Tavily is a super cool sort of, you know, third-party API. Search engine where it's really, really tailored towards LLMs, RAG AI agents. As you can see here, search API, fast, accurate results, reducing hallucinations. So something I've been playing around with and it's super cool. Anyways, so we're just connecting to Tavily through their documentation and we're sending over this JSON body. So in here, obviously you put in your API key. We put in the query, which as you saw from earlier was recent trends in the food service industry. And then just some other parameters. You will be able to configure this stuff in here, but we're looking for news. So it's going to be looking for recent information, which is super cool, especially when you're wanting to make posts on LinkedIn and X and all this kind of stuff that's very recent and has obviously information from the past couple days or weeks rather than last month, last 2 months. So anyways, that's how we configured this and it's looking for our query, like I said. So I'll hit test step. And while this is running, I just wanted to say this whole workflow right here will be available for download in my free school community. Link for that will be down in the description. And then if you want to check out my paid community and want to dive deeper into AI automations, real use cases, and, um, 5 weekly calls, then check out the paid community, like I said. And then finally, if you want me to build out some sort of automation like this, or you're looking for consultancy services, then check out my website. Link for that will also be down in the description. But anyways, if we switch over here to JSON, we can see what's coming back. So we got 3 different articles. As you can see, we got 3 URLs. We're getting the raw content from these articles, and then we're getting the title. And then we're also getting information on when these were published. So all of these were published today, December 2nd. So, you know, you're getting accurate real-time information. So once we're getting that information back from Tavaly, we're just pretty much organizing the data real quick. So we're splitting it out so that we're getting it, um, so that we can then aggregate it. So now we have it all sort of in one item with the 3 different raw contents and titles of the articles. So from here, we're feeding it into 3 different agents. So the first one is going to be specialized in LinkedIn. So I won't dive too deep into these prompts. Like I said, the workflows will be linked in the free school community available for download. So you'll be able to check out all this kind of stuff on your own. But basically what we're doing is we're feeding each of these agents the article content, and then we're feeding it the target audiences. And actually what I wanna do is in the demo and in the previous ones I've done tools agents, we're gonna switch these to conversational just to see how that works because as you can see, they don't have any tools. They're pretty much, um, this might be better for making things sound more human-like. They're taking some information and then structuring it in a way based on, you know, how we prompt it. So we'll try conversational agent and, um, let's hit this off and then let's look at the prompts real quick. So basically all I'm saying is, oh geez, okay, great reminder, if you switch the type of agent, the prompt will disappear. So anyways, we'll run this again. Um, we changed it to conversational agent from a tools agent and And also one thing I wanted to mention is originally I tried this with Grok because Grok's a lot cheaper. We're using Foro Mini in this case, as you can see, using Foro Mini. But Grok had an issue with the emojis and I wanted emojis back to separate headers and stuff. So we got this LinkedIn post. So elevate your small business with plant-based innovations as we wrap up 2024. The demand for plant-based options is booming. Innovative ingredients. As you can see, it ends with a call to action. What plant-based innovations are you excited to try in your business? Share below. So it's towards small businesses. And then we get some hashtags too. So it's a simple prompt, you'll be able to check out yourself. And then from there, we feed it in to the X agent. So this prompt is tailored towards making things, um, posts optimized for X. And as you can see in here, we're giving it the article content and the target audience from previously. And we need to do the same thing here. We're referencing the article content once again and the same target audiences. So small biz owners ready to harness data to drive growth. Pour My Beer's self-pour tech not only elevates customer experience but offers key insights into preferences and trends. Optimize your offerings and boost today. So, um, simple prompt for a shorter X post. And then finally, we'll go into the blog writer. We'll run this, and same thing, we're giving it target audience and the article content, and it should be very tailored towards, um, small business owners. It's going to be about— I told it about a 2-paragraph. As you can see right here, it cuts with the two, with the line breaks, but a two-paragraph informative blog. So I'm not going to read through this whole thing, but as you can see, it's a little more formal. There's no emojis, and that's how that works. From there, we're just feeding back the three posts back into that same row where we initially created the campaign. You know, this is where you could route them out to actually automatically post, but I think I like the idea of having it put back into a database for just some manual human intervention. That way you could maybe attach a few relevant images or change some grammar if you didn't like some way the emojis came back or something like that. But all we're doing is we are matching on the column name of campaign. So we grab the campaign from the original node that got the campaign just so we're aligning the rows correctly. And then we just fed in for the column LinkedIn, the LinkedIn post, for X, the X post, and then for the blog, the blog post. So if we hit test step, switch back over to content creation, we'll see these pop in here. There we go. So we just got our LinkedIn post, our X post, and then our blog. So that's pretty much how that works. And now what we're going to do is just set up the, what's it called, the Google Sheets trigger. That way when you come in and create a campaign, you don't have to come back and edit and hit test workflow. It'll just all happen for you. Okay, so first thing we're going to do is we're going to delete this, delete this, and we can get rid of our limit. We're going to now make a Sheets node, a trigger on row Added. So when the row is added, we're obviously going to be pulling from that same document, Content Creation, same sheet, Sheet 1, Row Added. And then we'll just hit Test Step. And so this will pull back all of the rows. So as you can see, we got everything back here. Let's just real quick connect this guy into there. And then all we need to do is update the update node because otherwise it's not going to know where to fill it back into. So what we want to do is reference the Google Sheets trigger node. We'll be looking for item— not item matching, we're looking for item.json.campaign because that's the actual thing that we're using to match, of course. And that should pretty much be it. All right, workflow is now active. We're going to come into the content creation database, paste in our new campaign. Um, there we go, Christmas Deals is the name. It's searching for best deals this Christmas, and then it's going to be targeted towards the parents as far as our posts go. So we'll come into the actual content creation, we'll go to executions, and we'll just wait here because as you can see, um, the execution node is going to be pulling every minute. So we'll wait here for the execution and then we'll hop into the database and see what we get. Okay, just got the execution back. As you can see, it just started. So we'll hop into the database and we should be getting back our 3 content posts any second now. Okay, here they just popped through. We've got, um, the first LinkedIn post is holiday shopping alert for parents. As you can see, we've got Apple AirPods Pro, Apple AirPods Pro, um, decorations, home essentials, and we've got some more information here. Cyber Monday, score big, you can get AirPods Pro 2 nearly 40% off. And then we've got our blog about, once again, it comes back with Apple AirPods Pro and other information here. So that's pretty much how this one works. Um, so that's all I've got for this one. A couple ways you could expand off this build, for example, you could have this be a chat interface where you talk to the agent and then it fills in the your campaign, and then it pulls from your campaign to do the searching and the posting. You could obviously completely automate the posting, but I like to have a little bit of manual touchpoint in there. And then maybe something else cool is you can call some sort of third-party API in order to add some sort of visual elements to your post, which could be another cool way to just make this stuff smarter and cooler. But anyways, if you guys appreciated this video, please leave a like. It definitely helps me out a ton. Like I said, this workflow will be available for download within the FreeSchool community, which is linked down in the description. Check out the paid community, check out my website if you want me to help you build some of this stuff out, or if you're looking for consultancy services. But that's all I've got for this one, and, um, really appreciate you guys making it to the end of this video. So thanks everyone.










