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

Opening Problem Statement ⚙️

Meet Sarah, a social media manager at a tech startup passionate about sharing the latest open-source projects. Every day she spends hours sifting through Hacker News to spot GitHub projects worth sharing. Manually checking each project, writing tailored posts for both Twitter and LinkedIn, and ensuring no duplicates wastes upwards of 5 hours per week. Mistakes happen too—missed posts or reposting the same project annoy her audience and reduce engagement, costing potential followers and opportunities.

The core problem Sarah faces is the repetitive, error-prone manual effort to extract, summarize, and share trending tech content efficiently on different social platforms. She needs a reliable, automated way to curate and post high-quality content with minimal oversight.

What This Automation Does

This unique n8n workflow solves Sarah’s problem by automating the entire process from content discovery to social posting. When triggered every 6 hours, the workflow performs:

  • Crawling Hacker News homepage to extract all GitHub links from trending posts.
  • Scraping each GitHub repository page linked to get project details in markdown format.
  • Using OpenAI GPT-4 model to generate two separate, engaging social media posts—one for Twitter (under 280 characters) and one for LinkedIn—with a professional, narrative tone.
  • Filtering out already posted projects by checking an Airtable database to avoid duplicates.
  • Sending a 5-minute Telegram notification to Sarah with the generated posts for review.
  • After delay, posting automatically to Twitter (branded as X) and LinkedIn and updating Airtable statuses to track completion.

This workflow saves Sarah about 5 hours weekly and prevents duplicate posts, boosting her efficiency and audience engagement.

Prerequisites ⚙️

  • n8n account with nodes: HTTP Request, Code (JavaScript & Python), Markdown, Schedule Trigger, Merge, Filter, Wait, Airtable, Twitter (X), LinkedIn, and Telegram.
  • Airtable base for storing curated post data and status tracking. (Airtable Personal Access Token required) 🔑
  • Twitter Developer account set up with OAuth2 credentials for posting. 📧
  • LinkedIn OAuth2 app credentials for posting on your behalf. 💬
  • Telegram bot and chat ID for notifications to the social manager. 🔐
  • OpenAI API credentials for GPT-4 model usage to generate content. ⏱️
  • Optionally, a self-hosted n8n environment for privacy and control (for example, using Hostinger) 🔌

Step-by-Step Guide to Build This Workflow

Step 1: Schedule Regular Content Crawling

Go to the n8n editor, add a Schedule Trigger node.

Configure it to run every 6 hours: Click “Add Interval” → Choose “Hours” → Set to 6.

Confirm the trigger fires on schedule by checking the next execution time.

Step 2: Crawl Hacker News Homepage for GitHub Links

Add an HTTP Request node named “Crawl HN Home” connected to the Schedule Trigger.

Set method to GET and URL to “https://news.ycombinator.com/”.

Enable “Full Response” and “Never Error” options to ensure response capture even on minor errors.

This node fetches the homepage HTML for parsing GitHub post links.

Step 3: Extract GitHub Links and Metadata Using Python Code

Connect a Code (Python) node called “Extract Meta” to the HTTP Request node.

Paste the provided Python script that:

  • Installs BeautifulSoup and simplejson asynchronously.
  • Parses the HTML content to find posts linking to GitHub repositories.
  • Extracts fields: post ID, title, URL, score, author, age, comments, and Hacker News URL.
  • Filters only GitHub URLs.
  • Outputs a list of JSON objects, each representing a GitHub post.

You should see an array of posts with those metadata after execution.

Common mistake: Ensure the input data path is correct (e.g., accessing HTML via items[0][‘json’][‘data’]).

Step 4: Search Airtable for Already Posted Projects

Add an Airtable Search node named “Search Item” linked to “Extract Meta”.

Configure to search your Airtable base/table filtering by the “Post” field matching the post ID from extracted metadata.

Expected outcome: Any duplicate posts will be retrieved to help filter them out.

Step 5: Merge New and Existing Data for Deduplication

Insert a Merge node configured to combine “Extract Meta” outputs and “Search Item” results.

This merge facilitates filtering new posts not present in Airtable.

Step 6: Filter Out Posts Already Posted

Attach a Code (JavaScript) node named “Filter Unposted Items” after Merge.

Paste the JS snippet that:

  • Builds a Set of IDs from Airtable (posts already posted).
  • Filters out any GitHub posts found in the Airtable data to avoid reposting.

Output is a filtered list of new GitHub posts to process.

Step 7: Visit Each GitHub Page to Extract Project Details

Connect an HTTP Request node “Visit GH Page” to “Filter Unposted Items”.

Set the URL dynamically to the GitHub project URL (expression: {{$json.url}}).

This fetches the raw HTML content of the GitHub repository page for next steps.

Step 8: Convert HTML Content to Markdown Format

Add a Markdown node “Convert HTML To Markdown” connected to “Visit GH Page.”

Feed the HTML content from the HTTP request to this node to get markdown suitable for the AI prompt.

Step 9: Generate Twitter and LinkedIn Posts Using OpenAI GPT-4

Insert an OpenAI (Langchain) node “Generate Content” connected to “Convert HTML To Markdown.”

Configure it with the GPT-4o-mini model, set the system prompt to instruct crafting split-format social media posts:

  • Twitter post under 280 characters.
  • LinkedIn post with a more detailed story.
  • Friendly, narrative tone without emojis or hype words.
  • Include project title, markdown details, and GitHub URL dynamically.
  • Output JSON with separate “twitter” and “linkedin” fields.

This step automates authoring of social media content tailored for each platform.

Step 10: Validate Content Output for Both Posts

Add a Code (JavaScript) node “Validate Generate Content” after “Generate Content.”

This checks if the AI response includes both twitter and linkedin content. If not, it returns an empty object to skip faulty entries.

Step 11: Filter Out Invalid or Errored Content

Attach a Filter node “Filter Errored” to remove any items with errors from the AI generation step.

Step 12: Create Airtable Records for New Posts

Add an Airtable Create Item node “Create Item” after “Filter Errored.”

Map fields from filtered data, storing URL, post ID, title, and the generated Twitter and LinkedIn posts.

Step 13: Send Notification via Telegram for Review

Insert a Telegram node “Ping Me” connected to “Create Item.”

Configure to send Sarah a message with the ready-made posts so she can review before posting.

Step 14: Wait 5 Minutes Before Posting to Social Media

Add a Wait node “Wait for 5 mins before posting” after “Ping Me” to allow time for human review.

Step 15: Post to Twitter (X) and LinkedIn

Connect Twitter (named “X”) and LinkedIn nodes to the Wait node.

Use the generated post texts from the AI output.

Set error handling to continue to ensure one failure doesn’t stop the workflow.

Step 16: Update Post Status in Airtable

Add two Airtable Update nodes “Update X Status” and “Update L Status” connected after “X” and “LinkedIn” nodes respectively.

Mark posts as “TDone” and “LDone” to track what has been sent where.

Connect each Airtable update node to a “No Operation” node to complete the chain.

Customizations ✏️

  • Adjust Posting Frequency: In the Schedule Trigger node, change the interval from 6 hours to any preferred schedule to better suit your content cycle.
  • Expand Source Sites: Modify the Python Extract Meta code to include other domains beyond GitHub, like GitLab or Bitbucket, by updating the URL filter condition.
  • Change Social Platforms: Replace Twitter or LinkedIn nodes with others like Mastodon or Facebook by integrating their respective API nodes in n8n.
  • Modify AI Tone or Content Style: Edit the prompts in the Generate Content OpenAI node to reflect your brand voice or preferred storytelling style.
  • Add More Fields in Airtable: Enhance Airtable records to track additional metrics like post engagement or scheduling notes by adding fields and mapping them accordingly.

Troubleshooting 🔧

  • Problem: “Extract Meta” Python node returns no GitHub posts.
    • Cause: Hacker News HTML structure changed or wrong HTML path accessed.
    • Solution: Update the BeautifulSoup selectors in the Python code to match the current Hacker News site layout.
  • Problem: Twitter or LinkedIn posts not publishing.
    • Cause: Incorrect OAuth tokens or permission issues.
    • Solution: Reauthorize credentials in n8n and verify API permissions for posting.
  • Problem: Duplicate posts appearing.
    • Cause: Airtable filtering or deduplication code logic issue.
    • Solution: Verify “Filter Unposted Items” code logic matches Airtable “Post” IDs accurately and test workflow with different data sets.
  • Problem: AI generation output malformed or incomplete.
    • Cause: OpenAI API limit or prompt misconfiguration.
    • Solution: Check OpenAI usage limits, refine prompt content in “Generate Content” node for clear JSON output.

Pre-Production Checklist ✅

  • Confirm all API credentials for Airtable, Twitter, LinkedIn, Telegram, and OpenAI are valid and authorized.
  • Test the HTTP Request nodes for Hacker News and GitHub URLs return expected data.
  • Verify Python code parsing in “Extract Meta” outputs correct GitHub post metadata.
  • Run test cycles with sample data ensuring no duplicates in Airtable and proper filtering.
  • Inspect AI-generated JSON for correctness and completeness before posting.
  • Preview Telegram notification messages for accuracy.
  • Check the wait node timing for appropriate review delay.

Deployment Guide

Activate the workflow by turning it ON in n8n after all configurations and testing.

Monitor logs for any errors during first few runs.

Adjust scheduling or nodes based on performance feedback.

Ensure automated status updates in Airtable are happening to track posts.

Optionally, deploy on a self-hosted n8n environment for enhanced control.

FAQs

  • Q: Can I add other social networks?

    A: Yes, by adding their API nodes and updating the workflow steps for posting.

  • Q: Does this use many OpenAI credits?

    A: The workflow calls OpenAI only once per new GitHub post, so credit use is proportional to volume.

  • Q: Is my data secure?

    A: Using Airtable and Telegram with OAuth tokens keeps your data secure, and you can self-host n8n for added privacy.

  • Q: What if Hacker News changes HTML?

    A: You’ll need to update the scraping Python code to reflect site changes.

Conclusion

By following this tutorial, you’ve built a powerful automation that crawls Hacker News for trending GitHub projects, generates tailored social media posts using AI, and orchestrates posting on Twitter and LinkedIn with a review step via Telegram.

Sarah can now save 5+ hours weekly and eliminate manual errors, keeping her audience engaged with fresh, relevant content effortlessly.

Consider expanding this workflow with additional sources, social channels, or AI enhancements for rich multimedia posts next.

Happy automating and sharing insightful tech stories with ease!

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 in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered 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