# n8n OpenAI JSON Output: Get Data Back, Not a Paragraph

> Make the n8n OpenAI node return usable JSON: the exact shape in the prompt, Output Format set to JSON Object, the output path and when to use Extractor.

Source: https://learn.ynteractive.com/content/blog/n8n-openai-json-output · Updated 2026-10-20 · Free from Stepthrough (https://learn.ynteractive.com)

Quick answer

To get [JSON](https://learn.ynteractive.com/content/glossary/json) from the n8n [OpenAI](https://learn.ynteractive.com/content/glossary/openai) node, do two things: write the exact shape you want into the [prompt](https://learn.ynteractive.com/content/glossary/prompt) and say "Reply with JSON only", then under **Options** add **Output Format** and choose **JSON Object**. n8n then parses the answer, so the fields arrive as real data at `output[0].content[0].text`. The free [n8n meeting notes to action items](https://learn.ynteractive.com/content/meeting-notes-to-action-items-google-sheets-ai-n8n) lesson uses this to turn notes into a task list.

Last updated October 20, 2026

[Take the free module →](https://learn.ynteractive.com/courses/ai-for-operations/12)Module 12 of the free [AI for Operations Teams](https://learn.ynteractive.com/courses/ai-for-operations) course, about 15 minutes. No account needed.

By [Robert Breen](https://learn.ynteractive.com/content/about) · Published October 20, 2026 · Updated October 20, 2026 · 4 min read

n8n · OpenAI · Structured output

## Why does the AI's answer need to be JSON?

A sheet, an If node or a Gmail field needs separate values, not one block of text. JSON gives each value its own name, so later nodes can map `owner` or `due` directly. That's what [structured output](https://learn.ynteractive.com/content/glossary/structured-output) means.

## What prompt works?

Give the shape in the prompt, word for word, with the rules for each field. The lesson's prompt:

```text
Read these meeting notes and list every action item someone agreed to do.
Reply with JSON only, in this shape: {"tasks":[{"task":"...","owner":"...","due":"..."}]}.
Use the person's first name for owner. Use the day or date said in the notes for due,
or No date if none is given. Meeting: {{ $json.Meeting }}. Notes: {{ $json.Notes }}
```

Three things make it reliable: the exact keys, a rule for missing values ("No date"), and "JSON only", so there's no chatty sentence around it.

## How do I set the Output Format?

In the OpenAI node (**Message a model**):

1. Scroll to **Options**, click **Add option** and choose **Output Format**.
2. Click the **Type** box. It shows a red warning until you pick something.
3. Click **JSON Object**.

The JSON Object type needs the word JSON in the prompt, which "Reply with JSON only" covers. After **Execute step**, open **text** in the OUTPUT and you see the list called **tasks**: 4 tasks for the first meeting and 3 for the second. The model runs again each time, so the wording can differ a little between runs.

## How do I use the fields afterwards?

Point at them with a path.

| Need | Expression or setting |
| --- | --- |
| The whole parsed answer | `{{ $json.output[0].content[0].text }}` |
| One task list, split into items | Split Out: `output[0].content[0].text.tasks` |
| Plain text from a non-JSON answer | `{{ $json.output[0].content[0].text }}` (as in the client status email lesson) |

[n8n Split Out Node Examples](https://learn.ynteractive.com/content/blog/n8n-split-out-node-examples) covers the next step.

## Should I use Information Extractor instead?

Use **Information Extractor** when you want n8n to enforce a schema, such as a lead score or an invoice's fields. You give it a JSON example (**Schema Type: Generate From JSON Example**) and the answer comes back under `output`, like `{{ $json.output.score }}`.

The [speed-to-lead lesson](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n) uses it for score, tier, reason, subject and reply, and the [invoice approval lesson](https://learn.ynteractive.com/content/invoice-inbox-to-google-sheets-approval-n8n) for vendor, invoice number, dates and total. The OpenAI node with JSON Object is simpler when you want a list. [n8n Information Extractor Examples](https://learn.ynteractive.com/content/blog/n8n-information-extractor-examples) compares them.

## Try it free, step by step

**n8n: Turn Meeting Notes into Action Items in a Google Sheet**. Build an n8n workflow that reads your meeting notes from a sheet, has AI pull out who agreed to do what by when, and adds one row per task to an Action Items sheet. You do every step yourself in a practice copy of n8n, it checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, and nothing touches your real accounts.

[Start the free lesson](https://learn.ynteractive.com/modules/n8n-meeting-notes-tasks)

[Or read the full step-by-step guide](https://learn.ynteractive.com/content/meeting-notes-to-action-items-google-sheets-ai-n8n)

## What goes wrong?

- **The braces reach OpenAI as text.** Switch the Prompt field to **Expression** (hover, click Expression) so `{{ $json.Notes }}` is filled in. The Result line under the box shows the real meeting name and notes when it works.
- **No JSON at all.** The Output Format isn't set, or the prompt doesn't say JSON.
- **Extra keys or missing keys.** Tighten the prompt: list every key, say what to put when a value is missing.
- **Invented tasks.** Read the output. In the lesson, a "skip the status meeting" decision was correctly left out because nobody agreed to do anything; check that yours behaves the same.

## Key takeaways

- Put the exact JSON shape in the prompt and say "Reply with JSON only".
- Set Options > Output Format > Type to JSON Object.
- The parsed answer sits at output[0].content[0].text.
- Use Information Extractor when a fixed schema matters more than a list.

## Frequently asked questions

**How do I get JSON from OpenAI in n8n?**

Ask for a specific JSON shape in the prompt and add the Output Format option set to JSON Object in the OpenAI node.

**Where is the OpenAI answer in n8n's output?**

For the Message a model action, the answer text is at output[0].content[0].text. With JSON Object output, that field holds the parsed object.

**Which model should I use?**

The lessons use GPT-4.1-MINI: quick, cheap and good at pulling facts out of text.

**Which course covers this?**

[AI for Operations Teams](https://learn.ynteractive.com/courses/ai-for-operations) and [AI for Meetings](https://learn.ynteractive.com/courses/ai-for-meetings). For the cost side, read [OpenAI API vs ChatGPT Plus](https://learn.ynteractive.com/content/blog/openai-api-vs-chatgpt-plus).

## Free lessons in this post

- [n8n: Turn Meeting Notes into Action Items in a Google Sheet](https://learn.ynteractive.com/content/meeting-notes-to-action-items-google-sheets-ai-n8n): Build an n8n workflow that reads your meeting notes from a sheet, has AI pull out who agreed to do what by when, and adds one row per task to an Action Items sheet.
- [Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n): Build an n8n workflow that scores every website lead with AI, emails a personal first reply within seconds, and pings Slack only when a lead is hot.
- [Invoices from Your Inbox to Google Sheets, with Approval](https://learn.ynteractive.com/content/invoice-inbox-to-google-sheets-approval-n8n): Build an n8n workflow that reads each vendor invoice PDF from Gmail with AI, logs the vendor, invoice number and total in Google Sheets, and emails the owner an Approve…

## Watch it in a free lesson: Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds

### Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds: video walkthrough

Full walkthrough · 3:28 · with captions

Build an n8n workflow that scores every website lead with AI, emails a personal first reply within seconds, and pings Slack only when a lead is hot. The whole lesson narrated step by step, recorded in Stepthrough’s simulated practice environment.

[Watch it with chapters and the full transcript](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n#watch)

From the free lesson [Speed-to-Lead Agent: Answer Every Web Lead in 60 Seconds](https://learn.ynteractive.com/content/speed-to-lead-agent-n8n)

## Related terms

Plain-English definitions, each with an example from a free lesson.

[JSON](https://learn.ynteractive.com/content/glossary/json) · [OpenAI](https://learn.ynteractive.com/content/glossary/openai) · [Prompt](https://learn.ynteractive.com/content/glossary/prompt) · [AI data entry](https://learn.ynteractive.com/content/glossary/ai-data-entry) · [AP aging report](https://learn.ynteractive.com/content/glossary/ap-aging-report) · [Apollo.io](https://learn.ynteractive.com/content/glossary/apollo-io) · [Approval threshold](https://learn.ynteractive.com/content/glossary/approval-threshold) · [Coda](https://learn.ynteractive.com/content/glossary/coda)

[The full AI glossary](https://learn.ynteractive.com/content/glossary)

## Related prompts

- [Invoice approval request email prompt](https://learn.ynteractive.com/content/prompts/invoice-approval-request-email-prompt): A copy-ready prompt that writes a clear approval request for a large invoice, so the owner can say yes or no in one reply with…

[All free prompt templates](https://learn.ynteractive.com/content/prompts)

## Keep reading

- [n8n Workflow Ideas for Finance Teams: 9 to Build](https://learn.ynteractive.com/content/blog/n8n-workflow-ideas-for-finance): Nine n8n workflow ideas for finance teams: invoices from the inbox to a sheet, approval over a limit, receipts, overdue reminders and month-end.
- [n8n Information Extractor Examples: 3 Schemas That Work](https://learn.ynteractive.com/content/blog/n8n-information-extractor-examples): n8n Information Extractor examples for leads, invoices and resumes: the Text prompt, JSON example schemas, the model and mapping the output.
- [n8n Gmail Node Examples: Send, Draft, Wait for Approval](https://learn.ynteractive.com/content/blog/n8n-gmail-node-examples): Five n8n Gmail node setups from real workflows: send a message, create a draft, send and wait for approval, email type and the n8n footer.

[All blog posts](https://learn.ynteractive.com/content/blog) · [All free tutorials](https://learn.ynteractive.com/content)
