AI Income LabJoin AI Income Lab ↗

n8n social media AI agent template: Google Trends research

Jump to video chapters

Watch on YouTube ↗ Subscribe on YouTube ↗

By · · 14:09 · 501 views

Written guide: n8n Social Post Template: Trends, Research, Posting

Import an n8n template that researches trending topics and posts to social media, then walk through its steps: a daily trigger, a SerpApi Google Trends call, topic and keyword picks, a ChatGPT topic choice, Perplexity research, posts to Facebook, LinkedIn and X, and a Google Sheets log. The workflow does not run end to end because the Perplexity credentials fail and the social accounts are not connected. Despite the title, it is not built in ten minutes.

Video summary

The video covers 9 parts: Social Media Automation, Import N8N Template, Schedule Trigger Setup, Google Trends Scraping, Trending Topics Selection, Keyword Research Automation, Perplexity API Setup, Social Posting Credentials, and Free AI Community.

What this video covers

What you build

A local self-hosted n8n instance with an imported multi-platform posting template, with the Trends and keyword steps tested and the research and posting steps unfinished.

Tools used

Key steps

Not covered

Summary written from the video's transcript and chapters.

In this video

  1. 0:00 Social Media Automation
  2. 0:40 Import N8N Template
  3. 1:25 Schedule Trigger Setup
  4. 2:05 Google Trends Scraping
  5. 3:10 Trending Topics Selection
  6. 3:55 Keyword Research Automation
  7. 4:40 Perplexity API Setup
  8. 5:40 Social Posting Credentials
  9. 6:40 Free AI Community

Questions and answers

Does the workflow run?

No. Mike says it has issues that must be fixed first and calls it a proof of concept.

Where do the templates come from?

The n8n templates site, which Mike says has about 5,900 free workflows, plus a local folder of roughly 2,000 workflows from GitHub.

Why skip LinkedIn?

Mike's earlier account was suspended and he does not want to use automation tools there again.

Transcript

Hey there, welcome to the channel. In this video, I'm excited to share with you how to build out an AI-powered multi-social media post automation within N8N. So, this basically is just going to post to Facebook, LinkedIn, and Twitter, and it's going to do the research using Perplexity and another tool called SERP API for scraping Google Trends. So, without further ado, let's get into the tutorial. Please subscribe to the channel if you haven't already. And here we go.

So, first of all, I'm just going to pull up the template right here. It's under social media marketing. You just search for Facebook, and this will pop up, and you can use it for free. So, if I want to import this into my local self-hosted instance running on Linux, all I have to do is come over here, pull up my terminal right here, and I can just run N8N.

Read the rest of the transcript

I've already made a tutorial on the channel showing how to install this on Ubuntu Linux, so you're welcome to check that out. Uh works great, and then you don't have to pay for subscription fees for N8N. So, I highly recommend it. So, I'm just going to pull this up, and you will see that N8N is going to load on my local machine, and I've already got the template uh pulled in here, the AI-powered multi-social media post automation.

So, I'm just going to click on that and pull it up. And as you can see here, this is the full automation. I'm not sure if I actually finished building the entire thing during this tutorial, but I at least want to show you how it works. So, first of all, we've got the schedule trigger. This is the the to execute the automation, and it's just going to run every day at 6:00 a.m. local time zone. Right?

So, if I want to execute that, I can just click on execute step, and it will run that particular step, and you can see the output right here. That's it. And then the next step is going to be scraping Google Trends using this URL and an API key, which I've provided down here. This is the API key field. We've also got a couple other ones as well, including engine, data type, and geolocation.

So, I'm looking for uh trending topics in the US and in the AI space. So, if I just type in AI agents right here, and I execute this step, it will pull in and output the JSON right here. So, it's executing the node, and that's using SERP API. They have a Google Trends uh API, which we're calling. So, I'm just going to search for trends real quick. And if we pull up the API, you will see the different fields that it needs.

So, we're passing in geo, the geolocation, data type, um also a couple other ones as well, including engine, and then most importantly, the API key. So, in order to get the API key, all you have to do is come over to your account in the upper left-hand corner, and then there's the API key. Very, very easy. And then you'll just input that into the automation. So, as you can see, it says status success. Uh there's the endpoint. Here's the URL.

So, if I just copy and paste this URL and bring it up over here, you should see all the output. There we go. So, that's the related queries: best AI agents, what is AI agents, what are AI agent an agent. That's the output. So, there we go. And that's the first step to get to basically pull Google Trends. And then the next step is going to get the two most trending topics. So, all this is doing is it's just getting uh the the two trending topics.

So, if I execute this step, there's the top two. So, it's effective context engineering for AI agents, and what is the primary function of a planner agent within agentic AI systems? I don't know why that's so popular, but that's what it returned, so that's what we're going to go with. And then next step is finding high search volume keywords. If I execute this step, you can see here's the specific keywords that are high volume.

And this is a done-for-you template, so you don't have to know really how it works all that much. You can just use it and get started right away to learn how to build out some workflows in N8N. It's they've got over 5,000 to choose from. So, if I come back to templates here, you can see there's 5,900 workflow automation templates available, most of them completely for free, on the official N8N website. So, no reason not to be learning how to use N8N.

It's even more powerful than make.com in a lot of ways, which is mostly what I talk about on this channel, but I also want to make some tutorials showing how to use this powerful platform as well. So, with that being said, the next step is going to be choosing the blog topic. So, all this is doing is it's just calling ChatGPT, which I've already got authenticated inside N8N, and it's messaging a model. From here, you can choose the model uh type.

So, it's just using GPT-3.5 Turbo in this case. And this is the specific prompt, right? So, you are a part of a team that creates world-class blog posts. Your job is to choose a topic for each blog post. And then we're entering in the keyword one and two down here. That's the input from the most trending uh topics that we got in a previous step. Next step is going to be calling Perplexity.

Now, this part I'm having a little bit of trouble with because it's not accepting my authentications uh credentials. So, if I go to a generic credential type, I should be able to enter in my API key here, which I've created over here in Perplexity. So, there was this article right here where you can read through, and you can actually create um an API key within Perplexity over here. So, all you have to do is scroll down, and you you can get credits, too.

So, in order to generate API keys, you actually need to refill your credits, and it looks like I only have $0 remaining. So, I can obviously I can fill this back up again, but for now, I already have the API key. So, I should just be able to copy this, and then come back over here and enter it into the credentials. So, I click on create a new credential, but as you can see here, there's no way to enter in the API key.

So, this is actually an HTTP request, which isn't exactly what I want. I want to see if they actually have a built-in Perplexity module, which it looks like they do. So, if I just click on Perplexity and then message a model, I should be able to add the credentials here. Okay, so there we go. That's the API key that I can enter in using the specific module. But once again, it says it couldn't connect with these settings. Authorization failed. Please check your credentials.

So, it's possible that I need to create a new API key, and in order to do that, I will need to add more credits to my account. So, basically, I just have to buy more credits. Like, let's say I don't know, three three dollars. Let's try three dollars of credits, and I can just confirm that purchase real quick. There we go. So, now I should have three dollars of credits inside Perplexity, and hopefully I'll be able to create another API key once that goes through.

But so far, it hasn't actually gotten the the credits coming in yet. But looks like actually I don't have a payout account connected. So, I'll have to do that later. But anyway, you get the idea. Basically, you just have to, you know, connect this up, and you can use the HTTP request module right here, or you can just use the built-in Perplexity. I'm not exactly sure how to add the credentials using this module. So, if anybody knows, let me know in the comments below.

Would Would love some advice. But basically, once that runs, it's going to then wait 10 seconds, and then it's going to split these out. So, it's basically just going to split out the message content that we got from Perplexity, assuming Perplexity was working correctly. And then it's just going to spit it split it up into different, you know, outputs, and it will post on Facebook, LinkedIn, and Twitter right here.

Once again, I will need to add the proper credentials here, the access token for the graph API on Facebook, and then also the credentials for LinkedIn. So, you have to create new credentials. They're making it a bit more difficult now, where essentially you have to have a company page, which I don't have anymore because my LinkedIn account was actually suspended permanently about three years ago, and I've never been able to get it back again.

So, I'm actually starting over from scratch on LinkedIn, which is very unfortunate. Um but now, since my profile is not verified, you have to go through this verification process by uploading your passport and all this stuff. I'm not actually able to create a company page. So, it's a bit tricky to post to LinkedIn, and honestly, I don't want to be using automation tools on LinkedIn because I've already burned that bridge once, and I do not want to uh go down that path again.

I want to make sure that my my LinkedIn profile stays valid. All right. So, I would probably just actually remove the LinkedIn module from this, but it's completely up to you. This is just a proof of concept to show how this works. And then also Twitter. So, you can create your credentials. You will need a client ID and client secret secret in Twitter if you want to post on Twitter, and then the last step is just Google Sheets.

So, it's inputting this information into Google Sheets uh using values. So, it's just basically opening up a Google Sheet, which I've already authenticated here. In order to do that, you will need to enter your client ID and your client secret, which you can get through uh Cloud Console right here. This is the Google Cloud Platform. And then you basically just have to add the Google Sheets API to this, and then you'll be able to get the API key. That's essentially how it works.

So, basically, once all of this is connected up properly, um then it should do the research, um create the prompts using ChatGPT, find the most trending topics, uh find the high-search volume keywords, and then do the research using Perplexity, if assuming this was working properly, which it's not right now, and then split it up and post it to just Facebook, LinkedIn, X, and then add the information into a Google Sheet.

Now, if I run this, obviously, it's not going to work because it says it has issues that can't be executed. So, I have to fix those first, but I can save this for later and come back to it at another time, and then obviously, I can take a look through some of the other automations workflows that are available here. Here's one that will generate AI viral videos with Nano Banana and VO3 and share them on social media using a module called Blowtado.

So, I will make another tutorial showing how to set this one up soon. It doesn't look super complicated. I can zoom in here and just take a look at the different modules quickly and easily through n8n. Works great, and again, it's all installed locally on my Linux desktop machine using apt. So, if you're interested in that tutorial, I've also created a tutorial about that on my channel. You're welcome to check it out, and let me know if you have any questions in the comments below.

I would be happy to help however I can. And also, before we finish the video, I wanted to show you my free AI community on Skool. We just hit 1,000 members in here 2 days ago, and it's growing fast. We're getting people posting in here all the time, asking questions. Um I also provide a lot of value inside this community, and then we also have the classroom as well, where you can access all of these different modules, guides, tutorials, templates, courses, um even full full tutorials

and n8n templates in here as well. So, you can get access to about 2,000 n8n templates, which I also have installed on my machine over here. Downloads, and then n8n workflows, and then we can go into workflows here, and there's all of the workflows directly from GitHub on my Linux machine. So, if I wanted to, you know, add find a workflow for WhatsApp, there's the workflow. It's got all the JSON files in there.

I can easily import them into my n8n, create a workflow, and import it in. So, I'll show you what that looks like real quick. I'm just going to import from file, and then I can come into downloads. Believe it was under downloads. Go to n8n workflows, workflows here, and then I'll just scroll down to, let's say, WhatsApp or WordPress. I don't know, whatever module whatever workflow you're looking to build, you can just import that in, and boom, there's the module. Uh sorry, there's the workflow.

And we can execute this, but obviously, I will need to fix up a bunch of steps before it runs properly. And that's pretty much all there is to it. So, hopefully, you've enjoyed this tutorial. Please subscribe to the channel if you haven't already, and feel free to check out some of my other videos. I'm growing this channel pretty quickly, almost over 1,000 subscribers now, and providing a lot of value.

And then also, like I say, feel free to join the Skool community, get the n8n templates, and make a post introducing yourself in the community. With that being said, signing off. Thanks for watching. Peace from Thailand. See you in the next one.

Not ready to join? Get the weekly build notes: new guides and tested builds in one short email.

You may also like