Quick overview
This workflow polls Hacker News search results every two hours for a list of keywords, filters out posts already logged in Google Sheets, generates a one-sentence explanation with Groq, and sends a Slack webhook alert for each new match.
How it works
- Runs every two hours on a schedule.
- Splits your comma-separated keywords into individual Hacker News Algolia search-by-date API queries for the last seven days.
- Fetches results from the Hacker News Algolia API and flattens each hit into a normalized list of posts with the matched keyword.
- Reads previously seen post URLs from a Google Sheets tab and filters out any candidates that have already been logged (capped to 20 new posts per run).
- Sends each new post’s keyword, title, and snippet to Groq Chat Completions to generate a single-sentence explanation of the match.
- Posts a formatted alert to Slack via an incoming webhook and then upserts the post URL and metadata into Google Sheets to prevent repeat alerts.
Setup
- Add Groq API credentials in n8n (used to call Groq Chat Completions).
- Create a Google Sheet with a tab named "SeenPosts" and columns for at least post_url, title, matched_keyword, and seen_at, then connect Google Sheets credentials in n8n.
- Create a Slack incoming webhook for your target channel and paste the webhook URL into the workflow’s configuration values.
- Update the workflow configuration values for your keywords (comma-separated) and your Google Sheet ID before activating the workflow.