---
title: "OpenAI file search answers with cited file names inline"
kind: "Kit"
category: "Research"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/2140b415-eef5-4ab0-81a0-38f2721bc44d"
updated: "2026-11-12"
---

# OpenAI file search answers with cited file names inline

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

An n8n workflow that answers a chat question from your own OpenAI vector store and writes the name of each source file into the answer, right after the passage it supports.

OpenAI file search answers with cited file names inline is an n8n workflow in the Research 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 answers a chat question from the files in your own OpenAI vector store and names the file behind each passage. It sends the question to OpenAI’s Responses API with the file search tool. A Code node then writes each file name into the answer at the spot where its citation belongs. Mindket’s copy swaps OpenAI’s retired Assistants API for that single call. Four nodes run it, beside four sticky notes.

### Who it suits

Teams that keep their knowledge in documents and want chat answers that show where each statement came from. Skip it if you need a chat that remembers earlier messages, or if you cannot keep your files in an OpenAI vector store.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Legal | Paralegals | Ask questions of a set of policy or contract files | A paralegal asks about a notice period and sees the contract file named in the answer. |
| Support | Support teams | Answer customers from help documents | A support lead asks about refunds and sees the policy file named beside each point. |
| Research | Analysts | Query a folder of reports | An analyst asks what a report says on churn and sees which report each line came from. |
| Education | Course teams | Answer student questions from course notes | A student asks about an exam rule and sees the handbook named. |

You need a little n8n: import a file, add one credential and paste one vector store ID.

### Where to use it

Any n8n that can reach OpenAI will run it. The answers appear in n8n’s own chat window.

- n8n Cloud: import the file there and open its chat
- Your own n8n server: the same file and steps
- OpenAI: the vector store that holds your files
- Another app: swap the Chat Trigger for another trigger

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Setup takes one credential and one vector store ID.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| OpenAI | An API key, and a vector store that holds your files |
| Vector store ID | The ID of that store, from OpenAI |

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 `Ask OpenAI with File Search`.
3. In the JSON body of that node, replace `<YOUR_VECTOR_STORE_ID>` with your vector store’s ID.
4. Open the chat from `Chat Trigger` and ask a question that your files can answer.

### How to use it

Open the chat and ask about your files. The answer arrives with a file name in italics after each cited passage. Turn on the Markdown node if you want HTML instead.

What to change for a different result

| To change | Where |
| --- | --- |
| The model | \`model\` in the body of \`Ask OpenAI with File Search\` |
| How many passages OpenAI uses | \`max\_num\_results\` on the tool in that body |
| The look of each note | The text in \`Insert File Names\` |
| HTML output | \`Optional Markdown to HTML\` |

### Example

A support lead adds a refund policy and a delivery guide to a vector store and pastes its ID into the request body. A customer asks how long a refund takes.

OpenAI searches both files and writes a short answer. The Code node adds the policy’s file name in italics after the sentence that came from it, and the delivery guide’s name after the line about shipping.

### 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. Here one box asks OpenAI and one tidies the answer. A vector store is a set of your files that OpenAI has made searchable. Start with two short files.

**For experts.** The workflow is a Chat Trigger, one HTTP Request to the Responses API and a Code node. The file names come from the citations in the reply, so no second call is needed.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Ask OpenAI with File Search\` | Posts the question with the \`file\_search\` tool and the vector store | It uses the OpenAI credential type, so n8n adds the key |
| \`Insert File Names\` | Reads the \`output\_text\` part and inserts each file name at its citation index | It inserts from the end of the text, so earlier positions stay right |
| \`Optional Markdown to HTML\` | Turns the Markdown into HTML | It is switched off |

### Good to know

OpenAI’s Assistants API shut down on 26 August 2026, so this copy calls the Responses API and keeps no memory of earlier messages.

- The repair: OpenAI’s deprecations page, read on 12 November 2026, names the Responses API and the Conversations API as the replacement. One request replaces the original’s assistant, thread and file lookups
- The model: the original assistant took its model from OpenAI’s dashboard. This copy names \`gpt-5.6-terra\`, which OpenAI lists as supporting file search
- Memory: the original wired a memory node to the assistant, and each question here is answered on its own
- Citations: OpenAI’s reference gives each citation’s \`index\` as the spot in the text where it belongs, and the Code node trusts it
- Errors: the Code node expects a message in the reply, so an error from OpenAI stops the run there
- Your data: the question and the matching passages of your files go to OpenAI
- Credentials: the JSON holds none

## README

```markdown
# OpenAI file search answers with cited file names inline

An n8n workflow that answers a chat question from the files in your own OpenAI vector store, then writes the name of each
file it used into the answer. The answer comes from OpenAI's Responses API and its file search tool.

## What is inside

- `workflow.json`: the workflow as n8n exports it, eight nodes: four that do the work and four sticky notes. It holds no
  credential.
- `README.md`: these notes.

## What we changed from the original copy

- The original ran on OpenAI's Assistants API. It called an assistant, read that assistant's thread with one request and
  looked up each cited file's name with another. OpenAI's deprecations page, read on 12 November 2026, says the Assistants
  API shut down on 26 August 2026 and names the Responses API and the Conversations API as its replacement. Those nodes
  cannot run now.
- Mindket's copy asks the Responses API directly. `Chat Trigger` feeds `Ask OpenAI with File Search`, an HTTP Request node
  that posts to `https://api.openai.com/v1/responses` with the file search tool and your vector store. `Insert File Names`
  then writes the names into the answer.
- The two lookups are gone, with the three Split Out nodes, the Set node and the Aggregate node that served them. OpenAI's
  file search guide shows each file citation carrying the file's name, so no second request is
  needed.
- The assistant's ID is gone. The vector store's ID is `<YOUR_VECTOR_STORE_ID>` in the request body.
- The original assistant took its model from OpenAI's dashboard, which the file does not show. The request now names
  `gpt-5.6-terra`, which OpenAI's model page lists as supporting file search in the Responses API.
- The old Code node swapped odd marker text in the answer for the file name. A Responses API citation says where in the text
  it belongs, so the new Code node inserts the name at that spot instead.
- `Window Buffer Memory` is gone, because it fed the assistant node. Each question is answered on its own.
- The notes are rewritten as short notes about each step.
- Nothing else.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An OpenAI API key.
- An OpenAI vector store that holds your files, and its ID. OpenAI's file search guide explains how to make one.

## 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 `Ask OpenAI with File Search`.
3. In the JSON body of that node, replace `<YOUR_VECTOR_STORE_ID>` with your vector store's ID. Remove the angle brackets too.
4. Open the chat from `Chat Trigger` and ask a question that your files can answer.

## How a run goes

1. `Chat Trigger` takes the question as `chatInput`.
2. `Ask OpenAI with File Search` posts the question with the `file_search` tool and your vector store. OpenAI searches the
   files and writes the answer.
3. `Insert File Names` reads the answer's text and its file citations. At each citation's position it adds the file's name
   in Markdown italics, and two files at one spot are joined by a comma.
4. `Optional Markdown to HTML` is switched off. Turn it on to change the Markdown into HTML.

## Change the look

- The model: `model` in the JSON body of `Ask OpenAI with File Search`.
- How many passages OpenAI may use: add `max_num_results` to the tool in the body. OpenAI's guide lists it.
- The look of the note: the text in `Insert File Names`.
- HTML instead of Markdown: switch on `Optional Markdown to HTML`.

## Good to know

- Each question starts fresh, because the request carries no earlier messages.
- OpenAI's API reference, read on 12 November 2026, defines a citation's `index` as the position in the output text where the
  citation belongs. The Code node trusts it.
- The Code node expects a message in the reply. An error body from OpenAI has none, so the run stops there.
- The question and the matching passages of your files go to OpenAI.
- The JSON holds no credential.
```

## What is in it

3 files, 10 KB, downloaded as a zip.

```text
NOTICE.md  634 B
README.md  4 KB
workflow.json  5 KB
```

## Workflow check

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

- Steps: 4 steps, starting on a chat message
- AI: No step calls an AI model
- Sign-ins: Signs in to: OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 4 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/2140b415-eef5-4ab0-81a0-38f2721bc44d)
- [Its page on Mindket](https://mindket.com/p/2140b415-eef5-4ab0-81a0-38f2721bc44d)
