This workflow follows the Chat 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 →
{
"name": "Agent Marketing - TinyLlama (pret a importer)",
"nodes": [
{
"parameters": {
"options": {
"responseMode": "whenLastNodeFinishes"
}
},
"id": "trigger-001",
"name": "Chat Trigger",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
220,
380
],
"typeVersion": 1
},
{
"parameters": {
"jsCode": "const chatInput = $input.first().json.chatInput || '';\nconst urlMatch = chatInput.match(/https?:\\/\\/[^\\s]+/);\nconst url = urlMatch ? urlMatch[0].trim() : 'https://example.com';\nreturn [{ json: { chatInput, url } }];"
},
"id": "code-extract",
"name": "Extract URL",
"type": "n8n-nodes-base.code",
"position": [
440,
380
],
"typeVersion": 2
},
{
"parameters": {
"url": "={{ $json.url }}",
"options": {
"allowUnauthorizedCerts": true,
"response": {
"response": {
"responseFormat": "text"
}
}
}
},
"id": "http-fetch",
"name": "Fetch Page",
"type": "n8n-nodes-base.httpRequest",
"position": [
660,
380
],
"typeVersion": 4.2
},
{
"parameters": {
"jsCode": "const chatInput = $('Extract URL').first().json.chatInput;\nconst raw = $input.first().json;\nlet pageContent = raw.body ?? raw.data ?? raw.text ?? JSON.stringify(raw);\nif (typeof pageContent === 'string') {\n pageContent = pageContent.replace(/<script[^>]*>[\\s\\S]*?<\\/script>/gi, '').replace(/<style[^>]*>[\\s\\S]*?<\\/style>/gi, '').replace(/<[^>]+>/g, ' ').replace(/\\s+/g, ' ').trim();\n if (pageContent.length > 900) pageContent = pageContent.slice(0, 900) + '...';\n}\nreturn [{ json: { chatInput, pageContent } }];"
},
"id": "code-prepare",
"name": "Prepare for LLM",
"type": "n8n-nodes-base.code",
"position": [
880,
380
],
"typeVersion": 2
},
{
"parameters": {
"jsCode": "const { chatInput, pageContent } = $input.first().json;\nconst trimmedInput = (chatInput || '').trim();\nconst userMessage = `Question utilisateur : ${trimmedInput}\\n\\nContenu du site : ${pageContent}\\n\\nR\u00e9ponds en fran\u00e7ais avec des puces courtes.`;\nconst body = {\n model: 'tinyllama',\n stream: false,\n messages: [\n { role: 'system', content: 'Tu es un consultant marketing. R\u00e9ponds bri\u00e8vement, sans r\u00e9p\u00e9ter la question.' },\n { role: 'user', content: userMessage }\n ]\n};\nconst response = await this.helpers.httpRequest({\n method: 'POST',\n url: 'http://host.docker.internal:11434/api/chat',\n body,\n json: true,\n skipSslCertificateValidation: true\n});\nconst content = response.message?.content ?? response.body?.message?.content ?? response.content;\nconst text = (typeof content === 'string' ? content : (response.message || response.body?.message || 'Pas de r\u00e9ponse.'));\nlet out = typeof text === 'string' ? text : (text?.content ?? JSON.stringify(text));\nif (typeof out === 'string') {\n out = out.replace(/^Question utilisateur\\s*:\\s*/i, '').trim();\n if (/^Tu es un consultant/i.test(out)) out = out.replace(/^Tu es un consultant[^\\n]*\\.?\\s*\\n?/gi, '').trim();\n}\nif (typeof out === 'string' && out.length < 30) out = 'TinyLlama n\\'a pas g\u00e9n\u00e9r\u00e9 de r\u00e9ponse exploitable. R\u00e9essaie avec une demande plus courte.';\nreturn [{ json: { text: out, output: out } }];"
},
"id": "code-ollama",
"name": "Call Ollama",
"type": "n8n-nodes-base.code",
"position": [
1100,
380
],
"typeVersion": 2
},
{
"parameters": {
"content": "## Apr\u00e8s import :\n\n1. Aucune credential \u00e0 configurer (Ollama est appel\u00e9 en direct dans le n\u0153ud Call Ollama).\n\n2. Save workflow (Ctrl+S) > Activer (interrupteur en haut) > Chat en bas pour tester.\n\n3. Exemple : \u00ab Analyse le site https://example.com et propose une strat\u00e9gie de contenu marketing \u00bb\n\nOllama doit tourner sur ta machine avec : ollama pull tinyllama",
"height": 240,
"width": 320,
"color": 4
},
"id": "note-001",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
180,
120
],
"typeVersion": 1
}
],
"connections": {
"Chat Trigger": {
"main": [
[
{
"node": "Extract URL",
"type": "main",
"index": 0
}
]
]
},
"Extract URL": {
"main": [
[
{
"node": "Fetch Page",
"type": "main",
"index": 0
}
]
]
},
"Fetch Page": {
"main": [
[
{
"node": "Prepare for LLM",
"type": "main",
"index": 0
}
]
]
},
"Prepare for LLM": {
"main": [
[
{
"node": "Call Ollama",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Agent Marketing - TinyLlama (pret a importer). Uses chatTrigger, httpRequest. Chat trigger; 6 nodes.
Source: https://github.com/CHANG-Toma/Agent-IA/blob/0a54ca4159d4650126d2d21252909f02377aa7a3/03-Workflows/agent-marketing-tinyllama-import.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.
💰 Beginner Investor – Learn the market faster with AI-powered insights guiding your decisions. 📈 Retail Trader – Optimize your trading strategy with in-depth analysis typically reserved for profession
This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system a
This template attempts to create an AI-powered content assistant for WordPress sites using Mistral AI, enabling article recommendations, content summarization, and contextual Q&A capabilities.
by Varritech Technologies
Who’s it for Creators who want to create faceless videos automatically, while keeping human oversight and quality control.