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

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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.


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 Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free