Automate Social Posts from Hacker News GitHub with n8n and AI

This workflow automates curating trending GitHub projects from Hacker News, generating engaging Twitter and LinkedIn posts using AI, and posting them with a 5-minute review delay. It saves hours spent on manual content curation and social media management.
httpRequest
code
airtable
+10
Workflow Identifier: 1172
NODES in Use: HTTP Request, Code, Airtable, Merge, Filter, Markdown, OpenAI, Telegram, Wait, Twitter, LinkedIn, Schedule Trigger, No Operation
Automate social posts with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow finds new GitHub projects shared on Hacker News and creates social media posts for them automatically.
It saves time by avoiding manual searching and writing.
The workflow generates posts for Twitter (X) and LinkedIn, sends a Telegram message for review, and posts after 5 minutes.
It stops duplicate posts by checking an Airtable database.
This helps keep social media fresh and saves about 5 hours every week.


Who Should Use This Workflow

People who manage social media for tech topics and want to share new open-source projects fast.
Users who want to reduce errors and save time by automating content curation and posting.
Those comfortable using n8n and have required accounts for Airtable, Twitter, LinkedIn, Telegram, and OpenAI.


Tools and Services Used

  • n8n: Workflow automation platform.
  • Hacker News: Source of trending GitHub links.
  • GitHub: Repository pages to gather project details.
  • OpenAI GPT-4o-mini model: AI text generation for social posts.
  • Airtable: Database to track posted projects and prevent duplicates.
  • Twitter (X) API: Publishing Twitter posts.
  • LinkedIn API: Publishing LinkedIn posts.
  • Telegram Bot API: Sending notification messages.

Inputs, Processing, and Outputs

Inputs

  • Hacker News homepage HTML response.
  • GitHub repository HTML pages.
  • Airtable existing records for deduplication.

Processing Steps

  • Extract GitHub project links and metadata using Python code.
  • Search Airtable to find previously posted projects.
  • Filter out duplicate projects.
  • Visit each GitHub page to scrape project details.
  • Convert HTML content to Markdown.
  • Generate two social media posts: Twitter (under 280 characters) and LinkedIn (detailed).
  • Check AI output validity.
  • Send Telegram notification for review.
  • Wait 5 minutes for manual check.
  • Post content to Twitter and LinkedIn.
  • Update Airtable statuses for tracking.

Outputs

  • Social media posts published on Twitter and LinkedIn.
  • Database records updated to mark posts done.
  • Telegram messages showing content ready for review.

Beginner Step-by-Step: How To Use This Workflow In n8n

Import The Workflow

  1. Download the provided workflow file using the Download button on this page.
  2. Inside the n8n editor, click on “Import from File.”
  3. Select the downloaded workflow file to load it.

Configure Credentials And IDs

  1. Open each node that requires credentials like Airtable, Twitter, LinkedIn, Telegram, and OpenAI.
  2. Add your API Keys or OAuth tokens where prompted.
  3. Update any IDs, such as Airtable base or table IDs, Telegram chat ID, or social account info.
  4. Replace URLs or prompts in code nodes or OpenAI prompts if customization is needed.

Test And Activate

  1. Run the workflow manually once to confirm it works and debug if needed.
  2. Look at the Telegram notification to verify the posts generated.
  3. After confirmation, toggle the workflow ON to activate scheduled runs.

For privacy or control, consider self-host n8n before deploying in production.


Edge Cases And Possible Failures

  • If Hacker News changes their HTML structure, Python code may find no GitHub links.
  • Invalid or expired API Keys can stop posting on Twitter or LinkedIn.
  • Duplicate posts happen if deduplication code or Airtable search fails.
  • AI might return incomplete JSON, causing content generation errors.
  • Telegram notifications may fail if chat ID or bot token is wrong.

Testing each step and keeping credentials updated helps avoid these issues.


Customization Ideas

  • Change the posting frequency by adjusting the Schedule Trigger node.
  • Add other code hosting sites by modifying Python filtering logic.
  • Support other social media platforms by adding their API nodes.
  • Edit the OpenAI prompt to change post tone or style.
  • Add more Airtable fields to track extra info like engagement metrics.

Code and Prompt Examples

Python Extraction Code (Partial Example)

This code uses BeautifulSoup to find GitHub links in Hacker News HTML.

from bs4 import BeautifulSoup
import simplejson as json

html = items[0]['json']['data']
soup = BeautifulSoup(html, 'html.parser')
posts = []

for item in soup.select('.athing'):
    link = item.select_one('.storylink')
    if 'github.com' in link['href']:
        post = {
            'post_id': item['id'],
            'title': link.text,
            'url': link['href'],
            # add other fields...
        }
        posts.append(post)

return [{'json': p} for p in posts]

OpenAI Prompt Example

This prompt tells GPT-4 to write two posts: Twitter and LinkedIn, with no emojis, in JSON format.

Write a JSON with two fields: "twitter" and "linkedin".
The twitter post must be under 280 characters.
The linkedin post should be detailed with a professional tone.
Use this input:
Project title: {{ $json["title"] }}
Project details in markdown: {{ $json["markdown_content"] }}
GitHub URL: {{ $json["url"] }}

Reply only with valid JSON.

Summary of Benefits and Results

✓ Saves about 5 hours every week by automating discovery and posting.
✓ Prevents duplicate social media posts with Airtable tracking.
✓ Produces professional, platform-specific posts for better engagement.
✓ Allows a short review window via Telegram before publishing.
✓ Easily customizable and extendable for other platforms or sources.


Automate social posts with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

It searches the Airtable base for existing post IDs and filters out projects already posted before creating new social media content.
The Python code that extracts GitHub links may fail, so the user needs to update the BeautifulSoup selectors to match the new HTML structure.
Yes, the workflow can be extended by adding API nodes for other social networks and modifying the posting steps accordingly.
Users import the workflow file, add their API Keys and credentials, update IDs or prompts if needed, test the workflow once, then activate it for scheduled runs.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.