AutomationFlowsAI & RAG › Shared: Ollama Generate

Shared: Ollama Generate

00-shared: Ollama Generate. Uses executeWorkflowTrigger, httpRequest. Event-driven trigger; 3 nodes.

Event trigger★★★★☆ complexity3 nodesExecute Workflow TriggerHTTP Request
AI & RAG Trigger: Event Nodes: 3 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "00-shared: Ollama Generate",
  "nodes": [
    {
      "parameters": {},
      "id": "trg-ollama",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://{{ $env.OLLAMA_HOST || 'ollama' }}:{{ $env.OLLAMA_PORT || '11434' }}/api/generate",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: $json.model || $env.OLLAMA_MODEL_REASONING || 'llama3.1:8b', prompt: $json.prompt, system: $json.system || '', format: $json.format || undefined, stream: false, options: { temperature: $json.temperature ?? 0.2 } }) }}",
        "options": {
          "timeout": 120000
        }
      },
      "id": "http-ollama",
      "name": "Ollama /api/generate",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Normalize Ollama output. If caller asked for json format, parse it.\nconst item = $input.first().json;\nconst raw = item.response ?? '';\nlet parsed = null;\nconst wantsJson = ($('When Executed by Another Workflow').first().json.format === 'json');\nif (wantsJson) {\n  try { parsed = JSON.parse(raw); } catch (e) {\n    // best-effort: pull the first {...} block\n    const m = raw.match(/\\{[\\s\\S]*\\}/);\n    if (m) { try { parsed = JSON.parse(m[0]); } catch (_) {} }\n  }\n}\nreturn [{ json: { response: raw, parsed, model: item.model, done: item.done } }];"
      },
      "id": "code-ollama",
      "name": "Normalize Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    }
  ],
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Ollama /api/generate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama /api/generate": {
      "main": [
        [
          {
            "node": "Normalize Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

00-shared: Ollama Generate. Uses executeWorkflowTrigger, httpRequest. Event-driven trigger; 3 nodes.

Source: https://github.com/AskariJafri/job-search-os/blob/main/n8n/workflows/00-shared/ollama-generate.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

🤖🧑‍💻 AI Agent for Top n8n Creators Leaderboard Reporting. Uses httpRequest, executeWorkflowTrigger, readWriteFile, googleDrive. Event-driven trigger; 49 nodes.

HTTP Request, Execute Workflow Trigger, Read Write File +3
AI & RAG

Memorybufferwindow Workflow. Uses emailSend, httpRequest, executeWorkflowTrigger, formTrigger. Event-driven trigger; 45 nodes.

Email Send, HTTP Request, Execute Workflow Trigger +1
AI & RAG

Memorybufferwindow Workflow. Uses telegramTrigger, telegram, executeWorkflowTrigger, httpRequest. Event-driven trigger; 35 nodes.

Telegram Trigger, Telegram, Execute Workflow Trigger +3
AI & RAG

Agent with custom HTTP Request. Uses httpRequest, executeWorkflowTrigger. Event-driven trigger; 20 nodes.

HTTP Request, Execute Workflow Trigger
AI & RAG

[2/2] KNN classifier (lands dataset). Uses httpRequest, stickyNote, executeWorkflowTrigger. Event-driven trigger; 18 nodes.

HTTP Request, Execute Workflow Trigger