AutomationFlowsAI & RAG › Piata AI Chat Completion

Piata AI Chat Completion

Piata AI Chat Completion. Uses httpRequest, openAi. Webhook trigger; 5 nodes.

Webhook trigger★★☆☆☆ complexityAI-powered5 nodesHTTP RequestOpenAI
AI & RAG Trigger: Webhook Nodes: 5 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the HTTP Request → OpenAI 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": "Piata AI Chat Completion",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "chat",
        "responseMode": "responseNode"
      },
      "name": "Webhook - Chat Request",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.model }}",
              "operation": "contains",
              "value2": "granite"
            }
          ]
        }
      },
      "name": "Route by Model",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:11434/api/chat",
        "method": "POST",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"model\": \"granite4:3b\",\n  \"messages\": {{ $json.messages }},\n  \"stream\": false\n}"
      },
      "name": "Ollama granite4:3b",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        650,
        200
      ]
    },
    {
      "parameters": {
        "model": "={{ $json.model }}",
        "baseURL": "https://openrouter.ai/api/v1",
        "authentication": "generic",
        "genericAuthType": "httpHeaderAuth",
        "httpHeaderAuth": {
          "name": "Authorization",
          "value": "Bearer sk-or-v1-free"
        },
        "messages": "={{ $json.messages }}"
      },
      "name": "OpenRouter Free Models",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        650,
        400
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}"
      },
      "name": "Chat Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    }
  ],
  "connections": {
    "Webhook - Chat Request": {
      "main": [
        [
          {
            "node": "Route by Model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Model": {
      "main": [
        [
          {
            "node": "Ollama granite4:3b",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OpenRouter Free Models",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama granite4:3b": {
      "main": [
        [
          {
            "node": "Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Free Models": {
      "main": [
        [
          {
            "node": "Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "tags": []
}
Pro

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

About this workflow

Piata AI Chat Completion. Uses httpRequest, openAi. Webhook trigger; 5 nodes.

Source: https://github.com/valentinuuiuiu/piata-ai-new/blob/4d9d8e231c9f1e1ac332acd6dd6e58e852a34f0b/n8n-workflows/piata-chat-completion.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

EvolutionAPI Live. Uses httpRequest, openAi. Webhook trigger; 12 nodes.

HTTP Request, OpenAI
AI & RAG

Sistema Vendas Estética - Fluxo Principal. Uses sqlite, openAi, httpRequest. Webhook trigger; 10 nodes.

Sqlite, OpenAI, HTTP Request
AI & RAG

Main-Workflow. Uses openAi, slack, httpRequestTool, httpRequest. Webhook trigger; 6 nodes.

OpenAI, Slack, HTTP Request Tool +1
AI & RAG

This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy

OpenAI, HTTP Request, Airtable
AI & RAG

Propulsar — Content Engine v3. Uses openAi, httpRequest, googleSheets. Webhook trigger; 73 nodes.

OpenAI, HTTP Request, Google Sheets