Deploy an advanced email newsletter automation with n8n on AWS
The main idea of this article is to share a way to deploy an n8n app on your AWS account through an everyday example.

n8n is a workflow automation tool that enables you to quickly and easily create and manage workflows for your tasks. You can use n8n’s integrations to automate any task across your team, whether it’s development or marketing related. This brings huge benefits to the organization, like improved communication and coordination; faster project completion; increased efficiency and productivity.
This article is a step-by-step tutorial on how to create an automated email newsletter when a new blog is published on your website, and deploy this solution on AWS using Microtica’s production-ready n8n template.
Why deploy n8n workflow on AWS?
Here are some of the reasons why it would be a good idea to deploy your n8n app on AWS:
- Application vertical and horizontal scaling
- Self-hosting on AWS means you own the infrastructure and data
- Out-of-the-box Kubernetes infrastructure
- Production-ready solution
Getting started
To follow this tutorial you’ll need to:
- Create a Microtica account by signing up with your email or your Git account.
- Have an AWS account to run n8n in. Here you can sign up for an AWS account.
- Have or create an n8n account so that you can create the workflow and test it out.
Deploy the n8n template
Microtica’s n8n.io template runs n8n on a Kubernetes cluster in your AWS account, with a repository that deploys on every push. Open Templates and find n8n.io under Services. The template walks you through these steps:
- Create the repository. Pick your Git account. Microtica creates a repository with the n8n setup, so every push to it deploys automatically.
- Name it and set the database password. Enter a name for the n8n app, lowercase letters only, and the password for its database.
- Choose the cluster. Pick a Kubernetes cluster in your environment. If you don’t have one, add the Amazon EKS template first. The React on Kubernetes guide shows how, and the cluster takes around 15 to 20 minutes to create. If the environment has no AWS account yet, Microtica asks you to connect one.
- Review and deploy. Check the summary and deploy. Microtica builds the n8n image and rolls it out to the cluster, and you can follow the build log while it runs.
- Give it an address. Services on a Kubernetes cluster don’t get a public address automatically. Open the n8n app under Apps, go to its Settings and assign a domain. Once that’s deployed, open the domain and sign up for your n8n account.
That’s it: n8n runs in your AWS account, on infrastructure you own, and you’re ready to build the workflow.
Create the email automation in n8n
Now, to create a blog post email automation in the n8n app available on the custom domain, we’ll use the following nodes:
- Webhook
- HTTP Request
- HTML Extract
- If (to perform a check)
- SendGrid integration
You can simplify this scenario if your website is hosted with Webflow, WordPress or any other CMS website builder, and use the already existing integrations in n8n for these platforms. I’ve chosen to do it in a more generic way, that can be applied to almost any website.

1. Connect the webhook
The webhook node provides Test and Production URLs that you can setup in your website. For example, in a Webflow website, you can setup the webhook trigger in Site Settings → Integrations, under Webhooks. Webflow should trigger the webhook on Site Publish.

2. Get all blogs from the blog page
The next step is to create an HTTP request to get the blogs published on your blog page. Since the Webflow webhook triggers every time there is a Site publish, meaning it doesn’t have to be a Blog publish necessarily, you need to do some checks to be sure the publish is for a new blog post. So here is how an HTTP request to get the blogs might look:

3. Extract the latest blog post
The response is the blogs HTML page. To extract the first blog post, navigate to the CSS selector of the blog’s title and select Copy selector.

Do the same for the blog URL, then past this data into the HTML Extract node in n8n. Executing this node should give you the title and URL of the latest blog post published on your website as output items.

We will use this information to get more details about the blog post, like the description and thumbnail image to include them in the email we want to send to our blog subscribers.
4. Get details about the latest blog post
Use the previously extracted blog URL to do another HTTP request to the specific blog page and get the HTML content as an output.

Use the HTML extract node again where the input would be the blog post’s HTML output from the previous HTTP request node. By copying out the CSS selector from the elements you’re interested in, you can get information about the blog post - like a description you’d like to add to the email, and the banner image connected to the post.
If you have the publish date displayed on the blog post page, extract that as well, as you’d need that information in the next node.

5. The IF node
Use the IF node to check if the latest blog is posted today. Use the previously extracted published date value for this.

If it’s a new blog post, which has been posted today then send an email to your blog subscribers. If not, then skip the workflow.
6. Send an email to blog subscribers
Connect the true branch of the IF node to the SendGrid node. You can of course use any other email-sending integration that you prefer, like Mailchimp, Mailgun, SendInBlue, etc.

My list of blog subscribers is already setup in SendGrid, so I’ll be using the SendGrid node twice. Once to extract the list from my account and get the emails to which we’ll send an automated email that a new blog post is available on our site.
And a second time, to actually send the email via SendGrid. Using a dynamic email template, you can use the values you extracted in the previous nodes and substitute them with dynamic fields in the template to create the design you intend.
Go back to previous inputs and use their outputs in the SendGrid node. Do this for the title, blog URL, description, and blog image.

And this is the final result that your blog subscribers will get in their inbox any time you publish a new blog post on your website.

Bonus: Cleanup
To remove the AWS resources, undeploy the environment from its settings. Microtica deletes the resources in AWS and keeps the configuration, so you can deploy the app again later.


