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
- Download the provided workflow file using the Download button on this page.
- Inside the n8n editor, click on “Import from File.”
- Select the downloaded workflow file to load it.
Configure Credentials And IDs
- Open each node that requires credentials like Airtable, Twitter, LinkedIn, Telegram, and OpenAI.
- Add your API Keys or OAuth tokens where prompted.
- Update any IDs, such as Airtable base or table IDs, Telegram chat ID, or social account info.
- Replace URLs or prompts in code nodes or OpenAI prompts if customization is needed.
Test And Activate
- Run the workflow manually once to confirm it works and debug if needed.
- Look at the Telegram notification to verify the posts generated.
- 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.
