Hacker News Top Stories AI Curator

An automated AI-powered workflow to fetch, summarize, and present the top Hacker News stories, including story details, URLs, and top comments. Users can interact via chat or buttons, and the AI agent retrieves and organizes trending tech, startup, and AI discussions in a user-friendly format.

How the AI Flow works - Hacker News Top Stories AI Curator

Flows

How the AI Flow works

User Initiates Request.
The workflow begins when a user opens the chat or clicks a button to request top or best Hacker News stories.
Fetch Story IDs.
API requests retrieve the list of top or best story IDs from the Hacker News API.
Get Story Details.
For each selected story ID, details such as title, URL, and comment IDs are fetched using additional API requests.
Retrieve Full Story Content and Comments.
The AI agent uses a URL retriever to get the full content of stories and fetches the top comments for each story.
AI Summarizes and Displays Results.
The AI agent summarizes story content and comments, then presents a structured list of stories and insights to the user in chat.

Prompts used in this flow

Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.

AI Agent

The main backstory and goal prompt for the Hacker News AI agent

                **Core Functionality**:

**For general story requests:**

1. Always begin by calling either the `get_beststories` or the `get_topstories` tool depending on user query to retrieve the current top/best stories
2. Extract the IDs of the first 10 stories from the results
3. Use the `story_detail` tool to fetch information for each of these 10 story IDs individually
4. Present the user with a formatted list containing the title, a brief summary, and ID for all 10 top stories (always show exactly 10 stories)

**For specific story requests:**

1. When a user mentions a specific story title in the top 10 list, locate the corresponding story ID (if the user gave the number as "id=XYZ use the tool to find that id number detail, but if they give a number from 1 to 10 they mean one of the items in the list you provided them.)
2. Use the `story_detail` tool to retrieve the story's URL and details
3. Use the `URL_retriever` tool to fetch the full content from the story's URL
4. you will get a list of IDs in the previous step these are comment IDs use the ```comments_fetch``` tool to get the top 10 comments and give to the user as well. BUT MAKE SURE TO SEND THE IDS TO THE TOOL ONE BY ONE!
5. Provide the user with:
   * A comprehensive summary of the page content
   * The direct URL to the story
   * top 10 comment

**Important**: Always maintain consistency in showing the top 10 stories for general requests, and provide thorough summaries with URLs for specific story inquiries.

            

Components used in this flow

Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.

Custom Trigger

Unlock custom workflows with the Custom Trigger component in FlowHunt. This component allows users to define specific trigger points within their flow, enabling tailored actions based on custom events or inputs. Essential for building interactive and flexible automation workflows.

Prompt Component in FlowHunt

Learn how FlowHunt's Prompt component lets you define your AI bot’s role and behavior, ensuring relevant, personalized responses. Customize prompts and templates for effective, context-aware chatbot flows.

API Request

Integrate external data and services into your workflow with the API Request component. Effortlessly send HTTP requests, set custom headers, body, and query parameters, and handle multiple methods like GET and POST. Essential for connecting your automations to any web API or service.

Parse Data

The Parse Data component transforms structured data into plain text using customizable templates. It enables flexible formatting and conversion of data inputs for further use in your workflow, helping to standardize or prepare information for downstream components.

Chat Output

Discover the Chat Output component in FlowHunt—finalize chatbot responses with flexible, multi-part outputs. Essential for seamless flow completion and creating advanced, interactive AI chatbots.

Button Widget

The Button Widget component in FlowHunt transforms text or input into interactive, clickable buttons within your workflow. Perfect for creating dynamic user interfaces, collecting user choices, and improving engagement in AI-driven chatbots or automated processes.

Chat Opened Trigger

The Chat Opened Trigger component detects when a chat session starts, enabling workflows to respond instantly as soon as a user opens the chat. It initiates flows with the initial chat message, making it essential for building responsive, interactive chatbots.

ChatInput

The Chat Input component in FlowHunt initiates user interactions by capturing messages from the Playground. It serves as the starting point for flows, enabling the workflow to process both text and file-based inputs.

Run Flow

The Run Flow component in FlowHunt lets you trigger and execute another workflow within your current flow. Pass inputs, variables, and control how flows interact, enabling modular and reusable automation. Ideal for chaining workflows or using flows as tools.

Chat History Component

The Chat History component in FlowHunt enables chatbots to remember previous messages, ensuring coherent conversations and improved customer experience while optimizing memory and token usage.

AI Agent

The AI Agent component in FlowHunt empowers your workflows with autonomous decision-making and tool-using capabilities. It leverages large language models and connects to various tools to solve tasks, follow goals, and provide intelligent responses. Ideal for building advanced automations and interactive AI solutions.

URL Retriever

Unlock web content in your workflows with the URL Retriever component. Effortlessly extract and process the text and metadata from any list of URLs—including web articles, documents, and more. Supports advanced options like OCR for images, selective metadata extraction, and customizable caching, making it ideal for building knowledge-rich AI flows and automations.

Flow description

Purpose and benefits

This workflow automates the process of curating, summarizing, and displaying top stories and comments from Hacker News. It combines API integrations, templating, parsing, user interaction widgets, and an AI agent to provide users with a seamless experience for exploring and summarizing trending discussions in tech, startups, AI, and more.

Overview

The flow is structured to respond to different user triggers—such as button clicks or custom commands—to fetch and present either general lists of top or best stories, or in-depth details for specific stories, including their URLs and top comments. It leverages the Hacker News API, processes and formats the results, and optionally uses an AI agent to further automate and enrich the interaction.

Key Components and Their Roles

ComponentPurpose
Custom TriggersInitiate flows for fetching best stories, top stories, story details, or comments.
Prompt TemplatesGenerate dynamic API URLs by substituting variables (e.g., story IDs) for requests.
API RequestsMake HTTP GET requests to Hacker News endpoints.
Parse DataConvert raw API data into readable text with templates.
Chat OutputDisplay results/messages in the chat interface.
Button WidgetsPresent user-friendly buttons to trigger actions.
Chat Input/OpenedCapture user messages or detect chat session start.
Chat HistoryStore and retrieve conversation context for the AI agent.
AI AgentOrchestrates the flow, decides which tools to use, formats summaries, and maintains consistency.
URL RetrieverFetches and summarizes content from external URLs.
Run FlowAllows flows to be reused as tools by the AI agent.

User Experience Flow

1. Welcoming and User Interaction

When the chat interface is opened, a welcome message and interactive buttons are displayed:

  • “Get Top 10 Stories” and “Get Best 10 Stories” buttons are shown.
  • Clicking these buttons triggers flows to fetch and display the respective list of stories.

2. Fetching Story Lists

Upon user trigger (button or command):

  • The workflow constructs the Hacker News API endpoint (e.g., /v0/topstories.json or /v0/beststories.json) via a template.
  • An API request retrieves a list of story IDs.
  • The first 10 story IDs are selected.
  • For each story ID, another API request fetches detailed information.
  • Data is parsed and formatted into a readable, numbered list with story titles, summaries, and IDs, then displayed to the user.

3. Story Details and Comments

When a user requests more information about a specific story:

  • The workflow identifies the correct story ID (by title or list index).
  • It fetches story details, including the main URL and an array of comment IDs.
  • The URL Retriever tool fetches and summarizes the main article content at the story’s external URL.
  • For each of the top 10 comment IDs, the workflow fetches and formats the comment text individually.
  • The system then presents the user with:
    • A comprehensive summary of the article.
    • The story’s direct URL.
    • The top 10 comments.

4. Automation with AI Agent

At the core, an AI Agent serves as an orchestrator:

  • It is provided with tools to fetch stories, story details, comments, and retrieve URLs.
  • The agent follows a detailed goal specification, ensuring it always:
    • Shows exactly 10 stories for general requests.
    • Provides detailed summaries and comments for specific stories.
  • The agent can use the chat history for context, improving its conversational capabilities.

5. Modular and Reusable Design

The workflow uses “Run Flow” nodes to modularize fetching top stories, story details, and comments as reusable tools that the AI agent can call as needed. This design makes it easy to extend or scale the workflow to handle new trigger types or additional features.

Example User Journeys

  1. User opens chat → clicks “Get Top 10 Stories” → sees a formatted list of the top 10 stories.
  2. User types or clicks to get details for story #4 → receives a summary of the article and its top 10 comments.
  3. User asks, “Show me the best stories today” → receives top 10 best stories, can request more details for any.

Automation and Scalability Benefits

  • Automated Multi-Step Data Gathering: No manual copying of story IDs or URLs—everything is fetched and formatted automatically.
  • Consistent Output: The AI agent enforces a consistent structure, always providing 10 items and comprehensive summaries.
  • Easy to Extend: Adding new features (e.g., fetching by keyword, or including more metadata) is straightforward due to the modular structure.
  • Scalable for High Usage: Modular flows and caching options (for API requests and content retrieval) allow the system to scale for many users without redundant calls.

Useful for…

  • News Aggregators: Automate the process of curating and summarizing trending stories with minimal human intervention.
  • Community Managers: Efficiently surface relevant discussions and community feedback (via top comments).
  • AI Chatbots: Provide an intelligent, interactive news assistant that can answer both broad and detailed queries about current tech news.

Summary Table: Key Triggers and Actions

Trigger TypeActionOutput
Chat OpenedShow welcome message and buttonsInteractive UI
“Get Top/Best Stories”Fetch and show top/best 10 storiesList of stories
Story Detail RequestFetch details, article content, top 10 comments for a storySummary + comments
AI Agent QueryOrchestrate above using tools, maintain consistency, clarify requestsStructured, conversational reply

Through this workflow, you can automate the curation and presentation of Hacker News stories, enabling rich, interactive, and scalable user experiences with minimal manual effort.

Let us build your own AI Team

We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.