{
  "name": "🔐🦙🤖 Private & local Ollama self-hosted AI assistant",
  "nodes": [
    {
      "id": "9560e89b-ea08-49dc-924e-ec8b83477340",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        280,
        60
      ]
    },
    {
      "id": "c7919677-233f-4c48-ba01-ae923aef511e",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        640,
        60
      ]
    },
    {
      "id": "b9676a8b-f790-4661-b8b9-3056c969bdf5",
      "name": "Ollama Model",
      "type": "@n8n/n8n-nodes-langchain.lmOllama",
      "position": [
        740,
        340
      ]
    },
    {
      "id": "61dfcda5-083c-43ff-8451-b2417f1e4be4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -380
      ],
      "parameters": {
        "width": 520,
        "height": 860,
        "content": "# 🦙 Ollama Chat Workflow\n\nA simple N8N workflow that integrates Ollama LLM for chat message processing and returns a structured JSON object.\n\n## Overview\nThis workflow creates a chat interface that pr"
      }
    },
    {
      "id": "64f60ee1-7870-461e-8fac-994c9c08b3f9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        340,
        280
      ],
      "parameters": {
        "width": 560,
        "height": 200,
        "content": "## Model Node\n- Name: Ollama Model\n- Type: LangChain Ollama Integration\n- Model: llama3.2:latest\n- Purpose: Provides the language model capabilities"
      }
    },
    {
      "id": "bb46210d-450c-405b-a451-42458b3af4ae",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -160
      ],
      "parameters": {
        "width": 280,
        "height": 400,
        "content": "## Trigger Node\n- Name: When chat message received\n- Type: Chat Trigger\n- Purpose: Initiates the workflow when a new chat message arrives"
      }
    },
    {
      "id": "7f21b9e6-6831-4117-a2e2-9c9fb6edc492",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        -380
      ],
      "parameters": {
        "width": 500,
        "height": 620,
        "content": "## Processing Node\n- Name: Basic LLM Chain\n- Type: LangChain LLM Chain\n- Purpose: Handles the processing of messages through the language model and returns a structured JSON object.\n\n"
      }
    },
    {
      "id": "871bac4e-002f-4a1d-b3f9-0b7d309db709",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -200
      ],
      "parameters": {
        "width": 420,
        "height": 200,
        "content": "### Prompt (Change this for your use case)\nProvide the users prompt and response as a JSON object with two fields:\n- Prompt\n- Response\n\n\nAvoid any preample or further explanation.\nThis is the question"
      }
    },
    {
      "id": "c9e1b2af-059b-4330-a194-45ae0161aa1c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        -280
      ],
      "parameters": {
        "width": 420,
        "height": 520,
        "content": "## JSON to Object Node\n- Type: Set Node\n- Purpose: A node designed to transform and structure response data in a specific format before sending it through the workflow. It operates in manual mapping m"
      }
    },
    {
      "id": "3fb912b8-86ac-42f7-a19c-45e59898a62e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        -180
      ],
      "parameters": {
        "width": 460,
        "height": 420,
        "content": "## Structured Response Node\n- Type: Set Node\n- Purpose: Controls how the workflow responds to users chat prompt.\n\n**Response Mode**\n- Manual Mapping: Allows custom formatting of response data\n- Fields"
      }
    },
    {
      "id": "fdfd1a5c-e1a6-4390-9807-ce665b96b9ae",
      "name": "Structured Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1700,
        60
      ]
    },
    {
      "id": "76baa6fc-72dd-41f9-aef9-4fd718b526df",
      "name": "Error Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1460,
        660
      ]
    },
    {
      "id": "bde3b9df-af55-451b-b287-1b5038f9936c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        280
      ],
      "parameters": {
        "width": 540,
        "height": 560,
        "content": "## Error Response Node\n- Type: Set Node\n- Purpose: Handles error cases when the Basic LLM Chain fails to process the chat message properly. It provides a fallback response mechanism to ensure the work"
      }
    },
    {
      "id": "b9b2ab8d-9bea-457a-b7bf-51c8ef0de69f",
      "name": "JSON to Object",
      "type": "n8n-nodes-base.set",
      "position": [
        1220,
        60
      ]
    }
  ],
  "connections": {
    "Ollama Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "JSON to Object": {
      "main": [
        [
          {
            "node": "Structured Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "JSON to Object",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}