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 →
{
"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": []
}
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 →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
EvolutionAPI Live. Uses httpRequest, openAi. Webhook trigger; 12 nodes.
Sistema Vendas Estética - Fluxo Principal. Uses sqlite, openAi, httpRequest. Webhook trigger; 10 nodes.
Main-Workflow. Uses openAi, slack, httpRequestTool, httpRequest. Webhook trigger; 6 nodes.
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
Propulsar — Content Engine v3. Uses openAi, httpRequest, googleSheets. Webhook trigger; 73 nodes.