X Content Aggregation and Curation to Telegram using Gemini AI - n8n Workflow

Automate social media aggregation! This powerful n8n workflow scrapes X (Twitter) posts, uses a Google Gemini AI n8n node to summarize and deduplicate content, and posts rich messages to Telegram.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Social media managers needing automated content curation.
Marketing teams distributing curated news feeds.
Users looking for advanced examples of using the n8n AI Agent node.
Anyone needing robust, scheduled n8n templates for web scraping and AI refinement.

Overview

Managing multiple content channels manually is time-consuming. This comprehensive n8n workflow solves the problem of keeping a Telegram channel updated with high-quality, relevant content scraped from X (formerly Twitter). It leverages the power of external scraping tools (BrowserAct) integrated via an HTTP Request n8n node, combined with advanced AI capabilities provided by the Google Gemini model within the n8n AI Agent. This specific n8n workflow ensures that only summarized, unique, and valuable posts are distributed, enhancing audience engagement without manual effort. This makes it one of the most efficient n8n templates available for social media automation.

How it Works


  1. Schedule Activation: The process begins with an n8n trigger, specifically the Schedule Trigger n8n node, set to run every 12 hours.

  2. Scraping Initiation: The n8n workflow uses an HTTP Request n8n node to initiate a web scraping job on X's homepage via the BrowserAct API.

  3. Status Monitoring: A series of If n8n nodes and Wait n8n nodes create a polling loop. The n8n workflow repeatedly checks the job status until the scraping task returns a finished status, ensuring all data is ready before proceeding.

  4. AI Curation: Once data is retrieved, the n8n workflow passes it to the AI Agent n8n node, configured with the Google Gemini Chat Model. The agent's task is defined clearly: summarize post summaries, refine the structure, and remove duplicate entries.

  5. Data Preparation: The output from the AI is restructured using the Code in JavaScript n8n node, preparing individual posts as separate items for the final delivery stage of the n8n workflow.

  6. Conditional Telegram Posting: An If n8n node checks if the post contains an image URL (Pic). If an image is present, a Telegram n8n node sends a rich photo message; otherwise, a simple text message is sent. This flexible n8n template ensures optimal message formatting.

Installation Guide

Importing this powerful n8n workflow template is straightforward:


  1. Download & Import: Copy the provided JSON code. In your n8n instance, go to "Workflows," click "+ New," and select "Import from JSON."

  2. BrowserAct Credentials: Set up HTTP Bearer Auth credentials for BrowserAct in the relevant HTTP Request n8n node. You must also update the workflow_id parameter in the initial HTTP Request node to match your specific X Content Aggregation template ID from BrowserAct.

  3. Google Gemini Setup: Configure the Google Gemini (PaLM) API credentials and ensure they are linked to the AI Agent n8n node.

  4. Telegram Configuration: Add your Telegram API credentials and verify the chatId parameter (e.g., @Test) in both Telegram n8n node instances matches your target channel or group.

  5. Activation: Once all credentials and configurations are complete, activate the n8n workflow using the toggle switch. The Schedule Trigger will now automate the aggregation process.

Node Details

Schedule Trigger: The primary n8n trigger, initiating the entire n8n workflow every 12 hours to ensure fresh content aggregation.
HTTP Request: Used twice to interact with the BrowserAct API—once to initiate the scraping task (POST) and once to poll the status (GET). Key Configuration: Requires specific workflow_id to run the scraping template.
If / Wait: Core logic n8n nodes used to manage the asynchronous nature of the scraping job, creating a robust polling mechanism. The wait nodes pause the n8n workflow for 20 seconds or 1 minute before retrying the status check.
AI Agent: The central intelligence n8n node of this workflow. It uses the Google Gemini Chat Model and a Structured Output Parser to process and refine raw scraped data based on a custom prompt (summarizing, deduplicating).
Code in JavaScript: A custom code n8n node used to transform the AI-generated array of refined posts into a list of separate items, compatible with downstream nodes.
Telegram (Send a text message / Send a photo message): The final action n8n nodes responsible for delivering the curated content. Key Configuration: Uses the $json.Pic value to determine if a text or photo message should be sent, providing dynamic output for this n8n workflow.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

I’m a PhD in Physics turned AI enthusiast, passionate about uncovering how AI is transforming content creation, business, and daily life.

Featured*