Build an AI Tech News Agent on AWS
Deploy a self-hosted n8n AI agent on EC2 that curates tech news to Google Sheets.
Introduction
30 Second Summary
Keeping up with tech news is overwhelming. New AI papers, product launches, and startup announcements drop every hour across dozens of sources.
In this project, you will build a self-hosted AI agent on AWS that automatically pulls articles from multiple tech news feeds, uses AI to summarize and categorize each one, and writes the results to a Google Sheet on a daily schedule.
What You'll Build
A cloud-hosted AI tech news agent that runs 24/7 on an AWS EC2 instance, ingests articles from multiple RSS feeds, passes them through a Google Gemini-powered AI agent for summarization and categorization, and writes structured output to a Google Sheets spreadsheet.
By the end of this project, you'll have:
- An EC2 instance running n8n inside a Docker container, fully self-hosted on AWS.
- A configured n8n workflow that pulls tech news from Hacker News, ArXiv, and TechCrunch RSS feeds, then sends each article through Gemini for AI-powered summarization and categorization.
- A fully automated daily schedule that populates your Google Sheet with curated, AI-summarized tech news without any manual intervention.
- Secret Mission: Add deduplication logic so articles never repeat across runs.
Are there any prerequisites?
You'll need an AWS account (Free Tier eligible), a Google Cloud account with a Gemini API key from Google AI Studio, and a Google account for Sheets. Basic familiarity with Docker and n8n is helpful but not required.
Launch EC2 and Deploy n8n with Docker
Your AI tech news agent needs a home in the cloud where it can run 24/7 without your laptop being open.
In this step, you will launch a virtual server on AWS EC2, install Docker on it, and get n8n running inside a container. By the end, you will have n8n accessible in your browser from your EC2 instance's public IP address.
In this step, get ready to:
- Launch an EC2 instance and SSH into it.
- Install Docker and run the n8n container.
- Complete the n8n initial setup and confirm the canvas is ready.
Launch a Free Tier EC2 instance and SSH in
EC2 is Amazon's virtual server service. You will launch a t3.micro instance, which is eligible for the AWS Free Tier. You also need to configure a Security Group that opens the ports n8n needs.
- Sign in to the AWS Management Console at https://console.aws.amazon.com.
- In the search bar at the top, type EC2 and select EC2 from the results.
- Click Launch instance.
- Enter a name for your instance, such as n8n-server.
- Under Application and OS Images, confirm Amazon Linux 2023 AMI is selected (it should be the default).
- Under Instance type, select t3.micro (labeled Free tier eligible).
- Under Key pair (login), click Create new key pair.
- Enter a name like n8n-key, keep the defaults (RSA, .pem), and click Create key pair. The .pem file downloads automatically.
What is a key pair?
A key pair is like a secure digital key for your server. The .pem file you just downloaded is the private half. You will use it to SSH (securely connect) into your EC2 instance from your terminal.
- Under Network settings, click Edit.
- You will see a default rule allowing SSH on port 22. Keep this rule.
- Click Add security group rule.
- Set Type to Custom TCP.
- Set Port range to 5678.
- Set Source type to Anywhere (0.0.0.0/0).
- Click Launch instance.
Why port 5678?
Port 5678 is n8n's default web interface port. Opening it in the Security Group allows your browser to reach the n8n editor running inside your EC2 instance.
- Wait until the instance state shows Running (click the refresh icon if needed).
- Select your instance and copy the Public IPv4 address from the details panel. You will need this address throughout the project.
Now SSH into your instance from your local terminal.
- Open your terminal. Press Cmd+Space (macOS) or the Windows key (Windows), type Terminal, and press Enter.
- Navigate to where your .pem file was downloaded (typically your Downloads folder) by running:
cd ~/Downloads
- Set the correct permissions on your key file by running:
chmod 400 n8n-key.pem
- Connect to your EC2 instance by running:
ssh -i n8n-key.pem ec2-user@[[EC2_PUBLIC_IP="your EC2 public IPv4 address"]]
- When prompted "Are you sure you want to continue connecting?", type yes and press Enter.
You should see a welcome message from Amazon Linux and a command prompt starting with ec2-user.
Permission denied or connection refused?
- Make sure you ran the chmod 400 command on the correct .pem file name.
- Double-check your EC2 public IP address. It is shown in the Instance summary section of the EC2 console.
- If your instance is still initializing, wait a minute and try again.
Help me troubleshoot my SSH connection to EC2.
Now install Docker on your instance.
- Update the system packages by running:
sudo yum update -y
- Install Docker by running:
sudo yum install -y docker
- Start the Docker service by running:
sudo service docker start
- Add your user to the Docker group so you can run Docker commands without sudo:
sudo usermod -a -G docker ec2-user
- Apply the new group permissions by logging out and back in. Close your SSH session by running:
exit
- Reconnect to your instance by running the same SSH command:
ssh -i n8n-key.pem ec2-user@[[EC2_PUBLIC_IP="your EC2 public IPv4 address"]]
- Verify Docker is working by running:
docker info
You should see a block of output about the Docker engine. This confirms Docker is installed and running.
Seeing "Cannot connect to the Docker daemon"?
- Make sure you disconnected and reconnected your SSH session after running the usermod command.
- If it still fails, try rebooting the instance with sudo reboot, wait 30 seconds, then SSH back in.
Help me fix my Docker daemon connection issue on EC2.
Run the n8n container with Docker
Docker lets you run applications inside isolated containers. You will pull the official n8n image and run it with a persistent volume so your data survives container restarts.
- Create a Docker volume for n8n's persistent data by running:
docker volume create n8n_data
What is a Docker volume?
A Docker volume is a dedicated storage area that persists even when a container is stopped or removed. Without it, all your n8n workflows and credentials would disappear every time the container restarts.
- Start the n8n container by running this command:
docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="[[TIMEZONE="your timezone e.g. America/New_York"]]" -e TZ="[[TIMEZONE="your timezone e.g. America/New_York"]]" -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -e N8N_RUNNERS_ENABLED=true -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n
What does this command do?
- -p 5678:5678 maps port 5678 on the EC2 host to port 5678 inside the container, so you can reach n8n from your browser.
- -e GENERIC_TIMEZONE and -e TZ set your timezone for scheduled workflows (use IANA format like America/New_York or Europe/London).
- -v n8n_data:/home/node/.n8n mounts the volume you created so n8n stores its database and credentials persistently.
- docker.n8n.io/n8nio/n8n is the official n8n Docker image from n8n's own registry.
Find your IANA timezone
Not sure what timezone string to use? Common examples are America/New_York, America/Los_Angeles, Europe/London, and Asia/Tokyo. You can find the full list at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
You will see n8n starting up in the terminal with log output. After a few seconds, look for a line indicating n8n is ready and listening.
- Open your web browser and navigate to:
http://[[EC2_PUBLIC_IP="your EC2 public IPv4 address"]]:5678
You should see the n8n setup screen in your browser.
Can't reach n8n in your browser?
- Double-check you are using http:// (not https://) in your browser address bar.
- Confirm your Security Group has an inbound rule for port 5678 with source 0.0.0.0/0. Go back to EC2 > Security Groups in the console to verify.
- Make sure the docker run command is still running in your SSH terminal (it runs in the foreground).
Help me troubleshoot why I can't access n8n in my browser.
Complete the n8n initial setup
When you open n8n for the first time, it asks you to create an owner account. This account controls your entire n8n instance.
- On the n8n signup screen, enter your email address.
- Enter a first name and last name.
- Create a password (must be at least 8 characters, including at least one number and one capital letter).
- Click Next.
n8n logs you in with your new owner account and shows the main canvas. You should see a blank workflow editor ready for building.
What is the n8n canvas?
The canvas is n8n's visual workflow editor. You drag nodes onto it and connect them with wires to build automations. Each node performs one action, like reading data, calling an API, or writing to a spreadsheet.
Your cloud infrastructure is ready. You have an EC2 instance running n8n in Docker, accessible from anywhere via your browser. Next up, you will configure the credentials that let n8n talk to Google Gemini and Google Sheets.
Configure Credentials in n8n
Your n8n instance is live on EC2, but it cannot talk to external services yet.
Before you can build any automation, n8n needs credentials that let it connect to Google Gemini (for AI summarization) and Google Sheets (for storing results). In this step, you will create both credentials and prepare the Google Sheet that will hold your curated news.
In this step, get ready to:
- Create and test a Google Gemini API credential in n8n.
- Create and test a Google Sheets OAuth2 credential in n8n.
- Set up a Google Sheet with the columns your workflow will populate.
Create the Google Gemini API credential
The Gemini credential is a simple API key exchange. n8n sends your key with every request to the Gemini API, so no OAuth flow is needed here.
- Switch back to your n8n editor in the browser (running at your EC2 public IP on port 5678).
- Click the Create button in the upper-left corner of the side menu.
- Select Credential.
- In the search field, type Google Gemini and select the Google Gemini(PaLM) API credential type.
- In the API Key field, paste the Gemini API key you generated from Google AI Studio.
- Click Save. n8n automatically tests the credential when you save.
Where is my Gemini API key?
If you have not generated one yet, visit https://aistudio.google.com/apikey and click Create API Key. Copy the key immediately. It is only shown once at creation time.
You should see a green banner confirming the connection was tested successfully.
Connection test failed?
Double check that you copied the full API key with no extra spaces at the start or end. Also confirm your EC2 instance has outbound internet access (the default Security Group configuration allows this).
help me troubleshoot my Gemini API credential in n8n
Create the Google Sheets OAuth2 credential
Unlike the Gemini key, Google Sheets requires a full OAuth2 flow. You will create an OAuth app in the Google Cloud Console, then authorize n8n to read and write your sheets.
Why does Google Sheets need OAuth2?
Google Sheets accesses data in your personal Google Drive. OAuth2 ensures you explicitly grant n8n permission to read and write on your behalf, rather than handing over a permanent key.
First, set up a Google Cloud project and enable the required APIs:
- Open the Google Cloud Console and sign in with your Google account.
- In the top navigation bar, click the project dropdown and select New Project.
- Enter a project name (e.g. n8n-news-agent) and click Create.
- Make sure your new project is selected in the top navigation dropdown.
- Open the left navigation menu, go to APIs & Services, then Library.
- Search for Google Sheets API and click Enable.
- Go back to the Library and search for Google Drive API. Click Enable. Google Sheets requires the Drive API as well.
Next, configure the OAuth consent screen:
- In the left menu under APIs & Services, select OAuth consent screen.
- Select External as the user type and click Create.
- Enter an app name (e.g. n8n News Agent) and select your email for the User support email field.
- Scroll down, add your email again in the Developer contact information section, and click Save and Continue.
- On the Scopes page, click Save and Continue without making changes.
- On the Test users page, click Add users, enter your Google email address, and click Save and Continue.
Now create the OAuth client credentials:
- In the left menu under APIs & Services, select Credentials.
- Click + Create Credentials and select OAuth client ID.
- In the Application type dropdown, select Web application.
- Give it a name (e.g. n8n OAuth).
- Leave this browser tab open. You need to paste the OAuth Redirect URL from n8n into the Authorized redirect URIs field here.
Switch to n8n and create the credential:
- In your n8n editor, click the Create button in the upper-left corner of the side menu and select Credential.
- Search for Google Sheets and select the Google Sheets OAuth2 API credential type.
- Copy the OAuth Redirect URL shown at the top of the n8n credential modal.
- Switch back to your Google Cloud Console tab. Paste this URL into the Authorized redirect URIs field.
- Click Create in the Google Cloud Console.
- Google displays a modal with a Client ID and Client Secret. Copy the Client ID and paste it into the matching field in the n8n credential modal.
- Copy the Client Secret and paste it into the matching field in n8n.
- In n8n, click Sign in with Google to start the OAuth authorization.
- A Google consent screen appears. Select your Google account and click Allow to grant n8n access.
- Click Save in n8n. The credential should show a green success message.
What about the unverified app warning?
Google may show a warning screen saying the app is not verified. This is expected for personal OAuth apps that have not gone through Google's verification process.
Since your app is for personal use (fewer than 100 users), you can safely proceed. Click Advanced, then click the link to continue to your app.
OAuth flow not completing?
Confirm the Authorized redirect URI in Google Cloud Console exactly matches the OAuth Redirect URL shown in n8n. Even a trailing slash difference causes a mismatch error.
Make sure you added your email as a test user in the OAuth consent screen. Only test users can authorize while the app is in testing mode.
help me fix my Google Sheets OAuth2 credential in n8n
Create the Google Sheet and test both credentials
Your workflow needs a destination spreadsheet with specific columns. Setting this up now means the workflow can write structured data immediately when you build it in the next step.
- Open Google Sheets in a new browser tab.
- Click Blank spreadsheet to create a new sheet.
- Rename it to AI Tech News by clicking on the title in the top left.
- In the first row, enter these column headers in cells A1 through F1: Title, Source, Category, Summary, Link, Date.
Why set up column headers now?
When you later configure the Google Sheets node in n8n, it reads the first row of your sheet to discover available columns. Having headers in place lets n8n map workflow data to the correct columns automatically.
Now verify both credentials work by running a quick test in n8n:
- Switch back to your n8n editor and create a new workflow by clicking the Create button and selecting Workflow.
- Click the + button on the canvas to add a node. Search for Google Gemini Chat Model and add it.
- Select your Gemini credential from the dropdown. If the credential loads without errors, Gemini is working.
- Add another node by searching for Google Sheets. Select the Google Sheets node.
- Select your Google Sheets OAuth2 credential. In the Document dropdown, browse for your AI Tech News sheet. If it appears in the list, your Sheets credential is working.
- Delete both test nodes by selecting each one and pressing the Delete key. You can also delete this test workflow entirely.
Both credentials should show a green success status. Your Google Sheet should appear when browsing sheets in n8n.
Google Sheet not showing up in n8n?
Make sure you enabled both the Google Sheets API and the Google Drive API in Google Cloud Console. The Sheets node uses the Drive API to list your spreadsheets.
Also confirm that you completed the OAuth flow with the same Google account that owns the spreadsheet.
help me troubleshoot why my Google Sheet is not appearing in n8n
Both services are now authorized and ready to use. Next up, you will build the RSS ingestion pipeline that pulls tech news from multiple sources into a single stream.
Build the RSS Ingestion Pipeline
Your n8n instance is running and both credentials are ready to go. Now it's time to build the actual automation logic.
In this step, you'll create a workflow that pulls articles from three tech news sources on a daily schedule. Each source uses a different RSS feed format, so you'll normalize the data into a clean, consistent structure before it reaches the AI agent.
In this step, get ready to:
- Add a Schedule Trigger and connect it to an RSS Read node for Hacker News.
- Add two more RSS Read nodes for ArXiv and TechCrunch, then merge all three feeds together.
- Normalize the merged data with an Edit Fields node so every article has the same field names.
Add a Schedule Trigger and first RSS Read node
Every automation needs a trigger to start it. The Schedule Trigger fires your workflow at a set time each day without any manual clicks.
- In the n8n editor, click the + button on the canvas to add a new node.
- Search for Schedule Trigger and select it.
- Set Trigger Interval to Every Day.
- Set Hour to your preferred time (e.g. 8 for 8 AM).
- Leave Minute at 0.
- Close the Schedule Trigger configuration panel.
What is a Schedule Trigger?
The Schedule Trigger tells n8n to start your workflow automatically at a set time. In "Every Day" mode, it fires once per day at the hour and minute you pick. This means your news agent runs hands-free once you activate the workflow.
- Click the + connector on the right side of the Schedule Trigger node to add the next node.
- Search for RSS Read and select it.
- In the URL field, paste the Hacker News feed URL:
https://hnrss.org/newest?points=50
- Close the RSS Read node panel.
Why filter by 50 points?
The ?points=50 filter ensures you only receive articles that the Hacker News community has upvoted at least 50 times. This keeps low-quality posts out of your news digest.
Your canvas now shows Schedule Trigger connected to an RSS Read node. Two nodes down, several to go.
Add two more RSS Read nodes and merge all feeds
A single news source gives you a narrow view. You'll add ArXiv for academic AI research and TechCrunch for startup and product news, then combine everything into one stream.
- Click the + connector on the right side of the Schedule Trigger node to branch a second connection.
- Search for RSS Read and select it.
- In the URL field, paste the ArXiv CS.AI feed URL:
http://arxiv.org/rss/cs.AI
- Close the node panel.
- Click the + connector on the Schedule Trigger node again to add a third branch.
- Search for RSS Read and select it.
- In the URL field, paste the TechCrunch feed URL:
https://techcrunch.com/feed/
- Close the node panel.
You now have three RSS Read nodes, each connected to the Schedule Trigger. Next, you'll funnel them into one stream.
- Click the + connector on the output of the first RSS Read node (Hacker News).
- Search for Merge and select it.
- In the Merge node, set Mode to Append.
- Set Number of Inputs to 3.
- Drag a connection from the output of the second RSS Read node (ArXiv) to Input 2 of the Merge node.
- Drag a connection from the output of the third RSS Read node (TechCrunch) to Input 3 of the Merge node.
- Close the Merge node panel.
What does Append mode do?
Append mode waits for all connected inputs to finish, then outputs every item from each input one after another. The result is a single list containing articles from all three sources.
Only seeing articles from one feed?
Make sure all three RSS Read nodes are connected to separate inputs on the Merge node (Input 1, Input 2, Input 3). If two feeds share the same input, only the last one to execute passes through.
Also confirm Number of Inputs is set to 3 in the Merge node. The default is 2.
help me debug why my Merge node only shows articles from one RSS feed
Normalize the data with an Edit Fields node
Each RSS feed returns slightly different field names. Hacker News uses title and link, but ArXiv might use content where TechCrunch uses description. The Edit Fields (Set) node lets you map everything to a consistent structure so the AI agent always receives the same shape of data.
- Click the + connector on the output of the Merge node.
- Search for Edit Fields (Set) and select it.
- Make sure Mode is set to Manual Mapping.
- Under Fields to Set, add the following five fields. For each field, set the Name to the value on the left and use an expression for the Value on the right:
- Name: title / Value (expression): {{ $json.title }}
- Name: link / Value (expression): {{ $json.link }}
- Name: description / Value (expression): {{ $json.content || $json.description || $json.summary || '' }}
- Name: pubDate / Value (expression): {{ $json.pubDate || $json.isoDate || '' }}
- Name: source / Value (expression): {{ $json.creator || $json.link.includes('arxiv') ? 'ArXiv' : $json.link.includes('hnrss') ? 'Hacker News' : 'TechCrunch' }}
- Under Include in Output, select No Input Fields. This strips out all original fields and keeps only your five normalized ones.
- Close the Edit Fields node panel.
Why normalize the data?
Different RSS feeds label the same information differently. By mapping everything to five consistent fields (title, link, description, pubDate, source), you guarantee that the AI agent and Google Sheets node downstream always know exactly where to find each piece of information.
Toggle to Expression mode
When adding a field value, hover over the field and click the Expression toggle (switching from Fixed) to type expressions like {{ $json.title }}. If you stay in Fixed mode, n8n treats the value as plain text instead of evaluating it.
Time to test the full pipeline end-to-end.
- Click Test Workflow in the top-right of the n8n canvas (or press the play button).
- Wait for all nodes to finish executing. Green check marks appear on each node when they succeed.
- Click the Edit Fields (Set) node to open it.
- Click the Output tab.
You should see a list of articles. Each article has exactly five fields: title, link, description, pubDate, and source. Articles from Hacker News, ArXiv, and TechCrunch are all mixed together in one list.
Seeing empty fields or errors?
If description is empty for some articles, that is normal for certain ArXiv entries that only include a title and link. The AI agent can still summarize based on the title alone.
If you see a red error on an RSS Read node, check that the URL is pasted exactly as shown above. Extra spaces or missing characters break the feed lookup.
help me troubleshoot errors in my n8n RSS ingestion workflow
Your ingestion pipeline is pulling real articles from three sources and reshaping them into a uniform format. Next up, you'll connect a Gemini AI agent that reads each article and generates a summary and category.
Add the Gemini AI Agent for Summarization
Your RSS pipeline is pulling articles from three sources and normalizing them into a clean, consistent format. The next challenge is turning raw article data into structured intelligence.
In this step, you will connect a Gemini AI model to your workflow. It will read each article's title and description, generate a concise summary, and assign a category. The output is structured JSON that you can write directly to your Google Sheet.
In this step, get ready to:
- Add a Basic LLM Chain node with a Google Gemini Chat Model sub-node.
- Configure a dynamic prompt that injects article data and requests structured JSON output.
- Test the workflow on a single article to verify Gemini returns valid JSON with a summary and category.
Add the Basic LLM Chain and Gemini Chat Model
The Basic LLM Chain node sends a prompt to a language model and returns the response. You will attach a Google Gemini Chat Model as the language model that powers it.
- In your n8n workflow, click the + connector on the right side of the Edit Fields node to open the node search.
- Search for Basic LLM Chain and select it to add the node to your canvas.
- In the Basic LLM Chain node panel, set the Prompt dropdown to Define below.
- Now attach the language model. Click the + button underneath the Model connection at the bottom of the Basic LLM Chain node.
- The search dialog appears, filtered on Language Models. Select Google Gemini Chat Model from the list.
- In the Google Gemini Chat Model panel, set the Model dropdown to gemini-2.0-flash.
- Under Credential to connect with, select the Google Gemini(PaLM) API credential you configured in Step 2.
- Close the Google Gemini Chat Model panel to return to the Basic LLM Chain node.
Why Basic LLM Chain instead of AI Agent?
The AI Agent node is designed for autonomous multi-step reasoning where the model decides which tools to call. For this project, you need deterministic, structured output for each article. The Basic LLM Chain gives you direct control over the prompt and pairs cleanly with a Structured Output Parser.
Don't see gemini-2.0-flash in the dropdown?
n8n dynamically loads models from your Google Gemini API account. If the model is not listed, confirm your Gemini API key is valid and has access to Flash models. You can test this by visiting https://aistudio.google.com/apikey and checking your key status.
help me troubleshoot why gemini-2.0-flash is not appearing in the n8n model dropdown
Write the prompt with dynamic expressions
The prompt needs to inject each article's title and description dynamically, then instruct Gemini to return a structured JSON response with a summary and category.
- In the Basic LLM Chain node, find the Prompt (User Message) text field.
- Paste the following prompt into the field:
You are a tech news analyst. Given the following article title and description, provide:
1) A 2-sentence summary
2) A category from this list: AI Research, Startup News, Product Launch, Developer Tools, Cloud/Infrastructure, Cybersecurity, General Tech
Article Title: {{ $json.title }}
Article Description: {{ $json.description }}
Respond in JSON format with keys: summary, category
What does this prompt do?
The first section sets the role and instructions for Gemini. The {{ $json.title }} and {{ $json.description }} expressions dynamically pull in each article's data from the Edit Fields node that runs before this one.
By constraining the categories to a fixed list and requesting JSON format, you get consistent, machine-readable output that maps directly to your Google Sheet columns.
- Now enable structured output parsing. In the Basic LLM Chain node, toggle Require Specific Output Format to on.
- A new Output Parser attachment point appears at the bottom of the node. Click the + button on this attachment point.
- Select Structured Output Parser from the list.
- In the Structured Output Parser panel, set Schema Type to Generate from JSON Example.
- Paste this JSON example into the text field:
{
"summary": "A two-sentence summary of the article.",
"category": "AI Research"
}
What does the Structured Output Parser do?
The parser tells n8n what shape to expect from Gemini's response. By providing a JSON example with summary and category keys, n8n validates that the model returns these fields. If Gemini's response does not match, the node flags an error instead of passing malformed data downstream.
- Close the Structured Output Parser panel.
- Back in the Basic LLM Chain node, expand the Options section at the bottom of the panel.
- Click Add Option and look for temperature and token settings on the connected Google Gemini Chat Model sub-node instead. Open the Google Gemini Chat Model sub-node by clicking on it in the canvas.
- Set Sampling Temperature to 0.3.
- Set Maximum Number of Tokens to 256.
- Close the sub-node panel to return to the canvas.
Why set temperature to 0.3?
A lower temperature makes Gemini's output more deterministic and consistent. Since you want reliable JSON with predictable categories, a value of 0.3 reduces randomness while still allowing natural language in the summary. Setting max tokens to 256 keeps responses concise and avoids unnecessary API usage.
Test the AI summarization on a single article
Before running the full pipeline, you should verify that Gemini returns properly structured JSON for a single article.
- Click the Test workflow button in the top right corner of the n8n canvas.
- Wait for the workflow to execute. The RSS nodes will pull live articles, merge them, and send the first batch to the Basic LLM Chain.
- Click on the Basic LLM Chain node to open it and view the Output tab.
- Verify that each output item contains a JSON object with two keys: summary (a 2-sentence string) and category (matching one of your predefined categories).
What should I see?
Each item in the output shows a JSON object like this:
{
"summary": "Researchers at MIT developed a new transformer architecture that reduces inference time by 40%. The approach uses sparse attention patterns to maintain accuracy while cutting compute costs.",
"category": "AI Research"
}
The exact summaries and categories will differ based on the live articles your RSS feeds return. The important thing is that every item has both keys and the category matches one from your predefined list.
Seeing an error or malformed output?
If the Basic LLM Chain node shows an error, check that your prompt expressions use the exact syntax {{ $json.title }} and {{ $json.description }} with double curly braces and a space after each opening brace.
If the output is plain text instead of JSON, confirm that the Structured Output Parser is connected and that your JSON example includes both summary and category keys.
help me debug why my Basic LLM Chain is not returning valid JSON from Gemini
Your AI summarization engine is working. Each article now gets a concise summary and a clean category label, all in structured JSON. Next up, you will connect this output to your Google Sheet and activate the schedule so the whole pipeline runs automatically every day.
Write Results to Google Sheets and Schedule
Your AI agent can now read tech articles and produce structured summaries with categories. The final piece is getting those results out of n8n and into a format you can browse, filter, and share.
In this step, you will connect a Google Sheets node to write each summarized article into your spreadsheet. Then you will publish the workflow so it runs automatically on schedule every day.
In this step, get ready to:
- Add a Google Sheets node and map each column to the correct data field.
- Publish the workflow so the Schedule Trigger fires automatically.
- Verify that your Google Sheet fills with AI-categorized tech news.
Add the Google Sheets output node
The Google Sheets node takes the structured JSON from your LLM Chain and appends one row per article to your spreadsheet.
- On the n8n canvas, click the + button on the right side of your Basic LLM Chain node.
- Search for Google Sheets and select it.
- In the Credential to connect with dropdown, select your Google Sheets OAuth2 credential from earlier.
- Set Resource to Sheet Within Document.
- Set Operation to Append Row.
- Under Document, select From list and choose your tech news spreadsheet.
- Under Sheet, select From list and choose the sheet that has your six columns.
Now map each column to the correct data from previous nodes.
- Set Mapping Column Mode to Map Each Column Manually.
- For the Title column, use the expression {{ $('Edit Fields').item.json.title }} to pull the article title from your Edit Fields node.
- For the Source column, use {{ $('Edit Fields').item.json.source }}.
- For the Category column, use {{ $json.category }} to pull the category from the LLM Chain output.
- For the Summary column, use {{ $json.summary }}.
- For the Link column, use {{ $('Edit Fields').item.json.link }}.
- For the Date column, use {{ $('Edit Fields').item.json.pubDate }}.
Why Map Each Column Manually?
Your incoming data field names (like pubDate and source) don't exactly match the Google Sheet column headers (like Date and Source). Manual mapping lets you explicitly connect each field to the correct column regardless of naming differences.
If you had made the Edit Fields output match the sheet headers exactly, you could use Map Automatically instead.
Don't see your spreadsheet in the list?
Make sure your Google Sheets OAuth2 credential is selected. If the credential is correct but the sheet still doesn't appear, try clicking the refresh icon next to the Document dropdown to reload the list.
help me find my Google Sheet in the n8n node
Publish the workflow and run it manually
Publishing a workflow in n8n makes it run automatically whenever its trigger condition fires. For your Schedule Trigger, this means the workflow will execute once per day at your configured hour.
- Click Publish in the top navigation of the n8n editor.
- In the publishing modal, optionally give your version a name (for example, v1 - full pipeline), then click Publish.
What does publishing do?
Publishing locks the workflow to a specific version and enables production executions. Your Schedule Trigger will now fire automatically at your configured time each day. n8n auto-saves edits, but those edits only go live when you publish again.
Before waiting for tomorrow's scheduled run, verify the full pipeline works right now.
- Click Execute Workflow (the play button) to trigger a manual run of the entire workflow.
- Wait for all nodes to finish executing. The execution may take 1-2 minutes depending on how many articles the RSS feeds return and Gemini's response time.
Each node should show a green checkmark when it completes successfully.
Seeing errors on the Google Sheets node?
Check that your column mapping expressions reference the correct node names. If you renamed any node on the canvas, the expressions must use the updated name.
Also verify that the LLM Chain output contains summary and category keys. Click on the LLM Chain node's output to inspect the JSON.
help me debug my Google Sheets append errors in n8n
Verify results in Google Sheets and the Executions log
- Open your Google Sheet in a browser tab.
- Confirm that new rows have appeared with all six columns filled: Title, Source, Category, Summary, Link, and Date.
Each row should have a 2-sentence summary and a category like AI Research, Developer Tools, or Startup News.
- Switch back to the n8n editor and click the Executions tab at the top of the workflow.
- Confirm that you see a successful execution listed with a green status indicator.
How do I check scheduled runs?
After your next scheduled trigger time passes (the hour you configured in the Schedule Trigger node), return to the Executions tab. You should see a new production execution listed automatically. Production executions are marked differently from manual ones, confirming your schedule is live.
No rows appearing in your sheet?
Open the execution in n8n and click on each node to inspect its output. The most common issue is that the RSS feeds returned items but the LLM Chain produced empty output. Check that your Gemini credential is still valid and the prompt references {{ $json.title }} and {{ $json.description }} correctly.
help me troubleshoot why my n8n workflow isn't writing to Google Sheets
Secret mission
Add Deduplication Logic
Your workflow runs daily, but what happens when the same article appears in the RSS feed two days in a row? Right now, it gets written to your Google Sheet again as a duplicate. In this secret mission, you will add a Code node that checks existing entries before writing new ones, so your sheet stays clean and duplicate-free.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
This project uses an EC2 instance that is Free Tier eligible. If your Free Tier period has expired, leaving the instance running will incur charges.
Cost warning
If your AWS Free Tier has expired or you exceed the monthly hour limit, t3.micro costs approximately $0.0104/hour (~$7.50/month).
Always check your Free Tier eligibility in the AWS Billing Dashboard. If you are no longer in your Free Tier period, choose Pause or Delete below to avoid unexpected charges.
Resources you used:
- EC2 instance (t3.micro, running n8n in Docker).
- Security Group (inbound rules for ports 22 and 5678).
- Docker volume with persistent n8n data (stored on the EC2 instance's EBS volume).
- Google Sheet populated with AI-summarized tech news articles.
Keep everything running
No action needed. Choose this if you want your AI news agent to keep running on its daily schedule.
- Your workflow continues to execute daily, adding new articles to your Google Sheet.
- Monitor your Free Tier usage in the AWS Billing Dashboard to avoid surprise charges.
- The Gemini API free tier allows 15 requests per minute for Flash models. Your daily workflow stays well within this limit.
Pause - I'll come back to this later
Stop the EC2 instance to pause compute charges while keeping your data intact. Your n8n workflows and credentials are preserved on the EBS volume.
- In the AWS Console, navigate to EC2 and select Instances from the left sidebar.
- Select your n8n instance by checking the box next to it.
- Click Instance state, then select Stop instance.
- Click Stop to confirm.
What happens when you stop an instance?
Stopping an EC2 instance halts compute charges, but EBS storage charges still apply (covered under Free Tier limits). Your Docker volume and n8n data remain intact.
To resume later, select the instance and choose Instance state then Start instance. Note that your public IP will change. Use the new IP to access n8n.
Delete - I don't want to use this again
Remove all AWS resources to ensure no charges accrue. Your Google Sheet data remains in your Google account unless you delete it separately.
Terminate the EC2 instance:
- In the AWS Console, navigate to EC2 and select Instances from the left sidebar.
- Select your n8n instance by checking the box next to it.
- Click Instance state, then select Terminate instance.
- Click Terminate to confirm. This deletes the instance and its EBS volume (including the Docker volume with n8n data).
Delete the Security Group:
- Wait a few minutes for the instance to fully terminate.
- In the EC2 console, select Security Groups from the left sidebar under Network & Security.
- Select the security group you created for this project (the one with ports 22 and 5678 open).
- Click Actions, then Delete security groups.
- Confirm the deletion.
Delete the Google Sheet (optional):
- Open Google Drive in your browser.
- Find your tech news Google Sheet.
- Right-click and select Move to trash.
Nice Work!
Nice Work!
You just built a fully automated, cloud-hosted AI agent that curates and summarizes tech news on a daily schedule. That is real-world infrastructure powering real-world AI reasoning.
You've learned how to:
- Deploy a self-hosted n8n instance on AWS EC2 using Docker, proving you can stand up cloud infrastructure for automation workloads.
- Build a multi-source RSS ingestion pipeline and connect a Gemini AI agent that summarizes and categorizes each article into structured JSON output.
- Automate the full pipeline on a daily schedule writing AI-generated results to Google Sheets, creating a production-ready system that runs without manual intervention.
- Secret Mission: Implement deduplication logic using a Code node to prevent repeated articles across scheduled runs.
Ready to quiz yourself?