Opening Problem Statement
Meet Alex, an independent developer and tech enthusiast who loves exploring innovative projects on Hacker News, especially the ‘Show HN’ posts where makers showcase their latest creations. Every day at 1 PM, Alex manually visits the Hacker News homepage, browses through dozens of entries, filters ‘Show HN’ posts, copies interesting titles and URLs, and compiles this into an email to share with colleagues and friends.
This routine wastes upwards of 20 minutes each day just on data gathering and formatting. With so much manual work, Alex often misses some trending posts or sends incomplete updates. Worse, on busy days, Alex’s inbox and those of friends flood with hundreds of irrelevant notifications.
Clearly, Alex needs an automated, precise way to track and notify only trending Show HN posts without sifting through the entire site manually, saving time and avoiding errors. This is exactly what our n8n workflow solves.
What This Automation Does ⚙️
This tailored n8n workflow runs every day at 1 PM, fetching the Hacker News frontpage, extracting and filtering posts to find those that are trending with the title containing “Show HN:”. Here’s what happens specifically:
- Automatically triggers at 1 PM daily (using the Cron node) to ensure timely updates.
- Fetches the Hacker News homepage HTML (via HTTP Request node) — no APIs needed.
- Parses the HTML to extract all frontpage posts and their associated details (HTML Extract Items node and HTML Extract Data node).
- Filters extracted posts to include only those with titles containing “Show HN:” (using the IF node).
- Formats the filtered list into a clean, readable email body with ranks, titles, and URLs (Function node with custom JavaScript).
- Sends the formatted email alert to designated recipients (Email Send node) — fully automated daily newsletter.
This automation can save Alex 20+ minutes every day, eliminate manual copy-pasting errors, and ensure all trending Show HN posts are consistently shared without delay.
Prerequisites ⚙️
- n8n Account or self-hosted n8n instance 🔑 (to run the workflow)
- Internet access to fetch Hacker News homepage HTML 🔌
- Email sending setup configured in n8n (for Email Send node) 📧
Step-by-Step Guide to Build This Workflow ✏️
- Create Cron Trigger for Daily Schedule
Navigate to Trigger nodes → Cron, drag it to the canvas. Set the trigger time to13:00(1 PM). This ensures the workflow runs automatically every day at this time.
You should see the cron node configured with the daily hour set.
Common mistake: forgetting to adjust timezone in n8n if your server timezone differs. - Fetch Hacker News Homepage HTML
Add anHTTP Requestnode connected to Cron.
Set method to GET (default), URL tohttps://news.ycombinator.com/.
Leave other options as defaults.
Visual confirmation: the node returns raw HTML in response.
Common mistake: accidentally enabling JSON parsing which breaks this HTML extraction. - Extract Top-Level Posts HTML
Insert anHTML Extract Itemsnode linked to HTTP Request.
Under Extraction values, add a new value with keyitemand CSS selectortr.athing. Set it to return HTML array.
This selects each post row on Hacker News frontpage for further parsing.
Expected outcome: an array of HTML snippets representing each story row.
Common mistake: incorrect CSS selector causing empty results. - Parse Individual Posts Data
Add anHTML Extract Datanode connected to the previous node.
Under extraction values, add keys:
–title: selectaelement inside the item
–url: selecta.storylinkattributehref
–rank: select element with CSS class.rank
SetdataPropertyNametoitem.
Result: structured objects with rank, title, and URL.
Common mistake: mismatched selectors leading to missing fields. - Filter for “Show HN:” Titles Using IF Node
Place theIFnode after data extraction.
Set condition: string operation contains.
Expression:{{$node["HTML Extract Data"].data["title"]}}
Value:Show HN:
This filters only posts with ‘Show HN:’ in titles.
Expected behavior: only relevant posts proceed.
Common mistake: case sensitivity – ensure matching exact phrase. - Format Email Content with Function Node
Connect the IF node to aFunctionnode.
Paste this code to format email text:let emailText = 'Currently trending "Show HN":nn'; for (let item of items) { emailText += `${item.json.rank} ${item.json.title}n${item.json.url}nn`; } return [{json: {emailText}}];This aggregates all filtered posts into a neat email body.
Visual check: the output fieldemailTextcontains the list.
Common mistake: forgetting to reference correct property names. - Send the Email Alert
Add theEmail Sendnode connected to the Function node.
Set subject to “Trending Show HN”.
Use the expression editor in the body to add{{$node["Function"].data["emailText"]}}.
Configure recipient emails in node parameters or globally.
Execution result: recipients receive a clean, formatted email daily.
Common mistake: email sending setup not configured properly in n8n.
Customizations ✏️
- Change Trigger Time
In Cron node, alter the hour to your preferred daily time.
This modifies when your email alerts are sent. - Include Additional Filters
Add more conditions in IF node to filter by keywords other than “Show HN” or add minimum rank.
This narrows notifications further. - Send to Multiple Recipients
Modify Email Send node with multiple addresses separated by commas.
Scale alerts to teams or friends. - Format Email with HTML
Change Function node output to include HTML tags for better email styling.
Improve readability with bold titles and clickable links. - Save Data for History
Add Google Sheets or Airtable nodes to log extracted post data for tracking trending topics over time.
Troubleshooting 🔧
- Problem: “No data passed to IF node”
Cause: Data extraction nodes not returning expected results.
Solution: Check CSS selectors in HTML Extract nodes; confirm HTTP Request returns full HTML. - Problem: “Email not sent”
Cause: Email Send node not configured or credentials invalid.
Solution: Verify SMTP/email provider credentials, test email outside workflow. - Problem: Incorrect email formatting
Cause: Function node JavaScript errors or missing template variables.
Solution: Review Function code for syntax and property access.
Pre-Production Checklist ✅
- Test Cron trigger manually in n8n editor to ensure scheduled runs.
- Verify HTTP Request returns the latest Hacker News homepage HTML.
- Ensure HTML Extract selectors retrieve expected data structures.
- Confirm IF node only passes relevant Show HN posts.
- Send test emails to verify email setup and content formatting.
- Backup workflow configuration and email templates.
Deployment Guide
Once tested, activate the Cron node to start daily automation. Monitor initial runs via n8n’s execution logs to catch any errors. Adjust nodes as required based on feedback or site layout changes.
This workflow requires no complex infrastructure and works reliably on both n8n cloud or self-hosted environments.
FAQs
- Can I use an alternative website besides Hacker News?
Yes, but you will need to update the HTTP Request URL and CSS selectors in HTML Extract nodes to match the new site’s structure. - Does this consume lots of API credits?
No API credits are used since the workflow scrapes public HTML pages. - Is my email data secure?
Emails are sent through your configured SMTP provider; ensure you use secure credentials and encrypted connections. - Can I handle more frequent updates?
Yes, adjust the Cron trigger for shorter intervals but be mindful of email fatigue among recipients.
Conclusion
You’ve now built a powerful n8n workflow that automatically fetches and sends daily email alerts for trending Show HN posts on Hacker News. This saves you over 20 minutes daily, reduces errors, and ensures you never miss a hot new project.
Next automation ideas: automate Slack notifications for the same posts, archive daily trends to Google Sheets for analysis, or extend filters to other Hacker News categories.
With this workflow, you’re empowered to keep your community informed with minimal effort — a perfect example of smart automation.