---
title: "Chat on a local Ollama model that answers as JSON"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/0e7148e4-dfb9-484d-a020-28b1a626dd9b"
updated: "2026-11-12"
---

# Chat on a local Ollama model that answers as JSON

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

An n8n chat that sends each message to Llama 3.2 on your own Ollama server. The model answers as a JSON object, and the chat shows your prompt, the response and the JSON it came from.

Chat on a local Ollama model that answers as JSON 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 that runs on a model you host yourself. Each message goes to Llama 3.2 on an Ollama server, with an instruction to answer as a JSON object that has a Prompt and a Response. The workflow reads that object, and the chat shows your prompt, the response and the raw JSON. If the model step fails, the chat answers with one plain line. The file holds nine nodes, three of them sticky notes.

### Who it suits

Developers and teams who want to try a local model from an n8n chat before they wire it into something larger. Skip it if you need a chat that remembers earlier messages. This one answers each message alone.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| IT services | Small IT teams | Try a model that never sends text to a cloud service | A team asks a local model to reword a short policy and checks the answer on their own server. |
| Software | Developers | Check that a small model returns JSON a workflow can read | A developer asks for a product name and a tagline and checks that both fill their fields. |
| Education | Teachers of AI courses | Show a class a model that runs on a laptop | A lecturer asks one question live and shows the JSON that comes back. |
| Research | Analysts | Compare how local models word the same prompt | An analyst swaps the model name and asks the same question twice. |

You need a little n8n and a running Ollama server: import a file, add one credential and pull one model.

### Where to use it

Any n8n that can reach your Ollama server will run it.

- n8n Cloud: only with an Ollama server that is reachable from the internet
- Your own n8n server: Ollama on the same machine, or on the same Docker network
- n8n’s chat: the canvas chat while you test. The public chat page stays off until you turn it on in the trigger

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Pull the model before you run the chat.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| Ollama | A server n8n can reach, with the model pulled by \`ollama pull llama3.2\` |
| Credential | One Ollama credential that holds the server’s address |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add an Ollama credential. The address is `http://localhost:11434` unless you changed `OLLAMA_HOST`.
3. If n8n runs in Docker, use the Ollama container’s name in that address, such as `http://ollama:11434`, with both on one Docker network.
4. Select the credential in `Ollama Model`, and check that `llama3.2:latest` shows in `ollama list`.
5. Save, open the chat on the canvas and ask a question.

### How to use it

Type a question in the chat. The model is asked to reply with a JSON object, and the workflow turns it into three parts. They are your prompt, the model’s response and the raw JSON.

What to change for a different result

| To change | Where |
| --- | --- |
| The shape of the answer | The prompt in \`Basic LLM Chain\`, and the same fields in \`Structured Response\` |
| The model | \`Ollama Model\`, with any model you have pulled |
| What the chat shows | The text in \`Structured Response\` |
| The failure line | \`Error Response\` |

### Example

You type this in the chat.

```text
Name three uses for a compost bin
```

The model answers as a JSON object. The chat then shows the line “Your prompt was”, your question, the line “My response is”, the model’s answer, and below them the JSON as the model wrote it.

### 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 the chat box feeds one chain, and a model node sits under the chain as its brain. Test with a short question first, then open the run under Executions to see the raw text the model returned.

**For experts.** The chain has an error output, and its second branch is the only path to `Error Response`.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Basic LLM Chain\` | Basic LLM Chain 1.5 with a fixed prompt, set to continue on its error output | A failed model call reaches \`Error Response\` |
| \`Ollama Model\` | Ollama model node, \`llama3.2:latest\` | It needs an Ollama credential |
| \`JSON to Object\` | Set 3.4, one field named \`response\` of type object | It stops the run when the text is not JSON |
| \`Structured Response\` | Set 3.4, one field named \`text\` | It also pastes in the chain’s raw text |

### Good to know

A small model does not always keep to a format, and the node that reads the JSON has no error path.

- Model: \`llama3.2:latest\` is the 3B model, a 2.0 GB download (Ollama’s library page, read on 12 November 2026)
- Bad JSON: when the answer is not valid JSON, for example when it comes wrapped in a code fence, the run stops at \`JSON to Object\` and \`Error Response\` does not answer
- Memory: none. Each message is answered alone
- Public page: the chat trigger’s public page is off until you turn it on. Leave it off unless you want strangers on your Ollama server
- Your data: your messages go only to the Ollama server named in the credential
- Credentials: the JSON holds none

## README

```markdown
# Chat on a local Ollama model that answers as JSON

An n8n chat that runs on a model of your own. Each message goes to Llama 3.2 on an Ollama server, and the model is asked
to answer as a JSON object with a Prompt and a Response. The chat shows your prompt, the response and the raw JSON.

## What is inside

- `workflow.json`: the workflow as n8n exports it, nine nodes. Three are sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The link to an Ollama credential in its author's n8n is gone, so select your own.
- Its eight long sticky notes, which described each node, became three short ones.
- Nothing else. The prompt, the nodes and the connections are as the original copy had them.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An Ollama server that n8n can reach, with the model pulled: `ollama pull llama3.2`. n8n Cloud can only use an Ollama
  server that is reachable from the internet.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add an Ollama credential. Its Base URL is `http://localhost:11434` unless you changed `OLLAMA_HOST`. If n8n runs in
   Docker, `localhost` is the container itself: put n8n and Ollama on one Docker network and use the Ollama container's
   name, such as `http://ollama:11434`.
3. Select the credential in `Ollama Model`. Its model is `llama3.2:latest`, so run `ollama list` and check that the
   name matches.
4. Save, open the chat on the canvas and ask a question.

## How a request runs

1. `When chat message received` passes your message on as `chatInput`.
2. `Basic LLM Chain` builds its prompt: give the question and answer as a JSON object with the fields Prompt and
   Response, with no preamble. `Ollama Model` writes the answer.
3. `JSON to Object` reads the answer text as an object and stores it in a field named `response`.
4. `Structured Response` writes the chat's reply in a field named `text`: your prompt, the response, and the chain's raw
   text under the line "This is the JSON object".
5. If the chain fails, its second output goes to `Error Response`, which replies "There was an error."

## Change the result

- The shape of the answer: the prompt in `Basic LLM Chain`. If you add fields to it, read them in `Structured Response`.
- The model: `Ollama Model`, with any model you have pulled.
- The failure line: `Error Response`.

## Good to know

- `llama3.2:latest` is the 3B model, a 2.0 GB download (Ollama's library page, read on 12 November 2026). A small model
  does not always keep to a format.
- `JSON to Object` has no error path of its own. When the answer is not valid JSON, for example when it comes wrapped in a
  code fence, the run stops at that node and `Error Response` does not answer.
- The chat has no memory. Each message is answered alone.
- The chat trigger's public page is off until you turn it on in the trigger. Leave it off unless you want strangers to
  use your Ollama server.
- Your messages go only to the Ollama server named in the credential.
```

## What is in it

3 files, 9 KB, downloaded as a zip.

```text
NOTICE.md  636 B
README.md  3 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: 5 steps, starting on a chat message
- AI: 1 step calls an AI model: Basic LLM Chain
- Sign-ins: Signs in to: Ollama
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 3 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/0e7148e4-dfb9-484d-a020-28b1a626dd9b)
- [Its page on Mindket](https://mindket.com/p/0e7148e4-dfb9-484d-a020-28b1a626dd9b)
