Automate Hacker News Insights with n8n AI Agent Workflow

This n8n workflow automates retrieving and analyzing the top Hacker News posts using an AI agent to answer your queries quickly. It saves time and manual effort by fetching data, cleaning it, and generating insights on demand.
chatTrigger
agent
toolWorkflow
+6
Workflow Identifier: 1482
NODES in Use: chatTrigger, agent, toolWorkflow, hackerNews, set, code, lmChatOpenAi, executeWorkflowTrigger, stickyNote
Automate Hacker News with n8n and AI agent

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

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow answers questions about Hacker News posts fast. It solves the problem of spending too much time copying and cleaning data from Hacker News. You send a chat question, and the workflow gives a clear answer using live data from Hacker News.Top 50 posts are fetched, cleaned, and shown in the chat automatically.

It reads your question, grabs post info, cleans it, turns it into JSON, sends it to an AI model, and then shares a short, clear reply. This saves hours spent on manual work and makes faster, smarter decisions possible.


Who Should Use This Workflow

Anyone who wants quick insights from Hacker News without coding. Good for people tracking tech trends, content creators, or data analysts who need fast answers.

Also helpful for those wanting to automate data fetching and AI answers inside n8n, especially if tired of manual scraping and slow reports.


Tools and Services Used

  • LangChain chat trigger node: Listens for chat messages.
  • Custom tool workflow node: Calls a sub-workflow to get Hacker News data.
  • Hacker News node (n8n built-in): Fetches top 50 posts.
  • Set node: Cleans and reforms data fields.
  • Code node: Turns cleaned data into JSON string.
  • OpenAI Chat Model node: Uses GPT-4o-mini to understand queries.
  • AI Agent node: Runs the AI conversation and calls tools.

How This Workflow Works (Inputs → Process → Output)

Inputs

The main input is a chat message. You type a question like, “What is the 5th most popular post ever on Hacker News?” The When chat message received node gets this.

Processing Steps

  1. The AI Agent node reads the question and knows a tool to fetch post data.
  2. The Custom tool workflow calls the sub-workflow named “hn_tool”.
  3. Inside “hn_tool”: the Hacker News node gets top 50 posts.
  4. The Set node cleans each post, keeping title, points, URL, author, and date.
  5. The Code node converts the cleaned list into one JSON string.
  6. The JSON string returns to the AI Agent, which uses the OpenAI Chat Model with GPT-4o-mini to answer the question.

Output

The workflow sends back a clear answer in your chat. It combines the fresh Hacker News data with AI analysis to give you quick, accurate info.


Beginner Step-by-Step: How to Use This Workflow in Production

Download and Import

  1. Click the Download button on this page to get the workflow file.
  2. Go to your n8n editor where workflows are created.
  3. Use the “Import from File” option to load the downloaded workflow.

Configure Credentials

  1. Add your OpenAI API Key in the credential manager.
  2. Make sure the Hacker News node is ready (usually no key needed).
  3. Check the Custom tool workflow node has the correct workflow ID for the sub-workflow.

Update IDs and Settings

  1. If the workflow uses any IDs like emails, channels, or folders, update them to match your environment.

Test

  1. Send a test chat message to the webhook URL from the When chat message received node.
  2. Watch the workflow run and check for errors.

Activate for Production

  1. Turn on the active switch for the workflow.
  2. Make sure your chat client accesses the webhook URL properly.

If hosting or running n8n on own server, check self-host n8n for hosting tips.


Inputs and Outputs

Input: One chat question about Hacker News posts.

Output: One AI-generated answer showing the info from Hacker News data.


Edge Cases and Failures

  • If the webhook URL is wrong, the workflow won’t start.
  • If Hacker News API is down or slow, the data fetch step fails.
  • If JSON paths in the clean data step are wrong, AI won’t get correct info.
  • If OpenAI API key is missing or limited, AI responses won’t work.
  • Add error nodes after key steps to handle problems nicely.

Customization Ideas

  • Change the number of Hacker News posts fetched by updating the “limit” field.
  • Add new data fields, like comments count, to the cleaning node.
  • Switch the AI model inside the OpenAI Chat Model to GPT-4 for richer answers.
  • Modify the sub-workflow to filter posts by date or tags.
  • Add error handling nodes to manage API limits or connection problems.

Summary of Benefits and Results

✓ Saves hours by automating data fetch and cleanup.

✓ Answers Hacker News post questions instantly with AI insight.

✓ Easy integration into chat interfaces using n8n.

✓ Minimizes manual errors and delays.

→ Provides reliable and updated data combined with GPT-4o-mini AI.

→ Frees user time for strategy instead of data work.


Automate Hacker News with n8n and AI agent

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, you can change the model in the OpenAI Chat Model node to use models like GPT-4 or GPT-3.5 by updating the model name.
Yes, each chat message processed calls the OpenAI API and consumes credits according to the API plan.
Check the webhook URL in the When chat message received node. Test it with a tool or chat client to confirm it works.
Accuracy depends on correct JSON path settings in the clean data node and successful data fetch from Hacker News API.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.