---
title: "Chat agent with a Hacker News lookup run as a workflow tool"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/11836007-6b7e-4642-a969-0815a089f056"
updated: "2026-11-12"
---

# Chat agent with a Hacker News lookup run as a workflow tool

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow with a chat window. An OpenAI agent answers your questions and calls a tool that runs a second flow on the same canvas, which fetches 50 items from Hacker News’s search and hands them back as text.

Chat agent with a Hacker News lookup run as a workflow tool is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow is a chat agent that answers from a live data source through a workflow tool. You open n8n’s Chat window and ask a question. An AI Agent backed by an OpenAI chat model decides when to call a tool named `hn_tool`. The tool runs a second flow on the same canvas. That flow asks Hacker News’s search for 50 items, keeps five fields of each and returns them as one block of JSON text. The agent reads it and answers. Eight nodes do the work, beside four sticky notes.

### Who it suits

Developers and automation builders who want to learn how to give an agent a custom tool, then swap in their own data. Skip it if you need a chatbot for the public. It runs from n8n’s own Chat window, and it has no memory node, so each question is answered alone.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Software development | Automation builders | Learn the pattern of a sub-workflow as a tool, then replace Hacker News with their own source | A builder swaps the \`Hacker News\` node for a call to their own orders API. |
| Research and media | Analysts and writers | Ask questions of a list of posts instead of reading it | An analyst asks which of the fifty items has the most points. |
| Community and support | Community managers | Prototype a chat helper over an internal list | A manager points the tool at a list of open tickets and asks which are oldest. |
| Training | Instructors | Show a class what an agent, a tool and a sub-workflow are | A trainer sends one question live and opens each node’s output in turn. |

You need a little n8n: import a file, add an OpenAI credential and save the workflow before the first chat. Nothing in the file states a setup time.

### Where to use it

Any n8n that can reach OpenAI and Hacker News’s search address will run it.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps
- Another data source: replace the \`Hacker News\` node and keep the rest, so the same chat answers from your own list
- A tool for other agents: build the second flow in its own workflow and point the tool at that one

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. One OpenAI key covers the whole workflow.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| OpenAI | An API key for the chat model |
| Hacker News | Nothing: its search is public |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add an OpenAI credential and select it in `OpenAI Chat Model`.
3. Open `OpenAI Chat Model` and choose a current model. The file names none, so n8n fills in `gpt-5-mini`. OpenAI’s deprecations page, read on 12 November 2026, gives 11 December 2026 as its shutdown date and names `gpt-5.6-terra` as the replacement.
4. Save the workflow. The tool calls the workflow by its own ID, so save it before the first chat.
5. Press Chat on the canvas and ask a question about the posts.

### How to use it

Press Chat, type a question and send it. The agent calls `hn_tool` when it needs the list, then answers in the window. Every question starts fresh, since nothing keeps the earlier ones.

What to change for a different result

| To change | Where |
| --- | --- |
| Which posts | The \`Hacker News\` node: its keyword, tags and limit of 50 |
| The fields the agent sees | The five assignments in \`Clean up data\` |
| What the agent knows about the tool | The name and description in \`Custom tool to call the wf below\` |
| How many rounds the agent may take | \`maxIterations\` in \`AI Agent\`, 10 in the file |
| The model | \`OpenAI Chat Model\` |

### Example

You ask who wrote the third item on the list and how many points it has.

The agent calls `hn_tool`. It gets back fifty items, each with a `title`, `points`, `url`, `created_at` and `author`, packed into one text. It reads the third and answers in the chat with the author and the points. Check the order first, since the search sets none of its own.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. The upper group is the chat agent. The lower group is a small flow that starts at `Execute Workflow Trigger`. The tool node points at the workflow it sits in, so the agent can run the lower flow whenever it needs data. Save first, then chat.

**For experts.** The agent and its tool meet only through text, so the tool’s flow can be anything that ends in one item.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`AI Agent\` | Version 1.1, a Conversational agent, with \`maxIterations\` of 10 | Mindket’s copy sets its Text to \`{{ $json.chatInput }}\`, which is what the chat window sends |
| \`Custom tool to call the wf below\` | The Call n8n Workflow Tool, version 1, with its workflow ID set to \`{{ $workflow.id }}\` | It runs the workflow it sits in, so the workflow must be saved |
| \`Stringify\` | A Code node that returns every item as JSON text in \`response\` | The tool hands the agent that item as text |

### Good to know

The order of the posts is not set, and the agent answers from fifty items only.

- Order: the node takes the first 50 hits of a search with no keyword and no tag. A note on the canvas calls them the most popular posts ever, but the node sets no sort. Check it before you rely on a question about rank
- Memory: the file has no memory node, so every question is answered alone
- Billing: a question that needs the list costs at least two model calls, one to decide on the tool and one to answer from it
- Models: the file names none, and n8n fills in \`gpt-5-mini\`, which OpenAI shuts down on 11 December 2026. Step 3 names the replacement
- Your data: the question and the fifty items go to OpenAI. The search goes to Hacker News’s search address, \`hn.algolia.com\`
- Where it runs: from n8n’s Chat window in the editor. Nothing in the file opens a public chat
- A repair: the original copy left the agent’s Text at its default, which reads a field the chat window does not send. Mindket’s copy reads \`chatInput\`
- Credentials: the JSON holds none

## README

```markdown
# Chat agent with a Hacker News lookup run as a workflow tool

An n8n workflow with a chat window. An AI Agent answers your questions, and when it needs data it calls a tool named
`hn_tool`. The tool is a second flow on the same canvas: it asks Hacker News's search for 50 items, keeps five fields of
each and sends them back as text. Replace the Hacker News node with any source of your own and the same chat answers from
it.

## What is inside

- `workflow.json`: the workflow as n8n exports it, 8 nodes beside 4 sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

The copy Mindket started from had one gap that kept the agent from seeing your question. Mindket fixed it:

- `AI Agent` left its Text field at its default. For this version of the node that default reads
  `{{ $json.chat_input }}`, while n8n's chat window sends the message to `On new manual Chat Message` as `chatInput`. The
  agent got an empty prompt. Its Text now reads `{{ $json.chatInput }}`.

The file also had no name. Mindket gave it one.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An OpenAI API key.
- Hacker News needs no account or key.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add an OpenAI credential and select it in `OpenAI Chat Model`.
3. Open `OpenAI Chat Model` and choose a current model. The file names none, so n8n fills in `gpt-5-mini`. OpenAI's
   deprecations page, read on 12 November 2026, gives 11 December 2026 as that model's shutdown date and names
   `gpt-5.6-terra` as the replacement.
4. Save the workflow. The tool calls the workflow by its own ID, so save it before the first chat.
5. Press Chat on the canvas and ask a question about the posts.

## How a run goes

1. `On new manual Chat Message` starts a run when you send a message in the Chat window.
2. `AI Agent` is an agent of the Conversational type, with `maxIterations` set to 10. It reads your question and decides
   whether it needs the list of posts.
3. `Custom tool to call the wf below` is the tool, named `hn_tool`. Its workflow ID is `{{ $workflow.id }}`, so it runs
   the workflow it sits in, starting at `Execute Workflow Trigger`.
4. `Hacker News` runs its search with no keyword, no tag and a limit of 50.
5. `Clean up data` keeps five fields of each item: `title`, `points`, `url`, `created_at` and `author`.
6. `Stringify` turns all the items into one JSON text and returns it as a field called `response`.
7. The tool hands that item to the agent as text, and the agent answers in the chat.

## Change the look

- Which posts: the `Hacker News` node. Its keyword, tags and limit are where to start. The sticky note beside it says to
  replace it with any other service.
- The fields the agent sees: the five assignments in `Clean up data`.
- What the agent knows about the tool: its name and description in `Custom tool to call the wf below`.
- How many rounds the agent may take: `maxIterations` in `AI Agent`.
- The model: `OpenAI Chat Model`.

## Good to know

- The node sets no order of its own. It takes the first 50 hits of an empty search, and a note on the canvas calls them
  the most popular posts ever. Check the order before you rely on a question about a rank.
- The file has no memory node, so every question is answered alone.
- A question that needs the list costs at least two model calls, one to decide on the tool and one to answer from it.
- Your question and the items go to OpenAI. The search goes to Hacker News's search address, `hn.algolia.com`.
- It runs from n8n's Chat window in the editor. Nothing in the file opens a public chat.
- The JSON holds no credential.
```

## What is in it

3 files, 11 KB, downloaded as a zip.

```text
NOTICE.md  658 B
README.md  4 KB
workflow.json  6 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 6 steps, starting when another workflow calls it or on a Manual Chat event
- AI: 1 step calls an AI model: AI Agent
- Sign-ins: Signs in to: OpenAI and Manual Chat
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 6 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/11836007-6b7e-4642-a969-0815a089f056)
- [Its page on Mindket](https://mindket.com/p/11836007-6b7e-4642-a969-0815a089f056)
