This workflow corresponds to n8n.io template #6844 — we link there as the canonical source.
This workflow follows the Agent → Chat Trigger 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 →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "053140b0-8397-40b4-877d-e784b7ff42d6",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
-96
],
"parameters": {
"color": 7,
"width": 620,
"height": 240,
"content": "# Requirements\n\nFor storing and processing of data in this flow you will need:\n\n- CloudFlare.com API key/token - for retrieving your data (https://dash.cloudflare.com/?to=/:account/api-tokens)\n- OpenAPI credentials (or any other LLM provider) saved - for agent chat\n\n\n"
},
"typeVersion": 1
},
{
"id": "94a62db1-db0f-41d6-b4ca-33c0afa77a77",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
160
],
"parameters": {
"color": 7,
"width": 620,
"height": 604,
"content": "# Author\n\n### Kresimir Pendic\nSenior professional, specializing in automation, AI and data analysis. \n\n### Video overview\nhttps://youtu.be/bqrxn_41K1Y\n\n## Say hi!\nhttps://www.linkedin.com/in/mkdizajn/\n\n### Check out my other templates\n### \ud83d\udc49 https://n8n.io/creators/kres/\n"
},
"typeVersion": 1
},
{
"id": "ee3394d5-ac45-4561-b4c0-ec68961453b9",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
784
],
"parameters": {
"width": 620,
"height": 140,
"content": "# Need help?\nFor getting help with this workflow, please create a topic on the community forums here:\nhttps://community.n8n.io/c/questions/"
},
"typeVersion": 1
},
{
"id": "415e9c96-1bd0-472c-b92e-3ebc1e667a62",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
-256
],
"parameters": {
"color": 4,
"width": 1480,
"height": 140,
"content": ""
},
"typeVersion": 1
},
{
"id": "d9fc97f1-30a6-4450-b976-8deb32d536e1",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-224,
-224
],
"parameters": {
"color": 4,
"width": 700,
"height": 80,
"content": "# CloudFlare chat \u21aa\ufe0f\ufe0f get / set DNS records"
},
"typeVersion": 1
},
{
"id": "11b2465a-9298-437d-b49d-b036e14479dc",
"name": "Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
-96
],
"parameters": {
"color": 3,
"width": 840,
"height": 640,
"content": "## Chat step\n\n1. Use what ever LLM model you like - I've tested it with Gemini and GPT 4o-mini - and both work flawlessly.\n\n2. Prepared main get|set TLD DNS records ops with easy prompt, also extend it to other settings or other ops for your CloudFlare if you need"
},
"typeVersion": 1
},
{
"id": "50256a12-4a51-486e-a2be-a98e24b6f85f",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
160,
128
],
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "d0e313c9-3df3-4fcc-8dd6-8fa0838b812b",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
224,
352
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "fe26fbe4-bd00-446f-b738-84484b07ade4",
"name": "Chat Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
368,
128
],
"parameters": {
"options": {
"systemMessage": "=You are dns manager for CloudFlare\n\nYou have cf_tool that is your source for getting and setting DNS records.\nOnly return answers based from cf_tool.\n\nWhen calling cf_tool, data args to pass for actions are:\n\nIf you need to get dns record, call cf_tool and pass:\n- action: 'get_dns'\n- domain_id: domain id\n\nif you need to set dns record, call cf_tool and pass:\n- action: 'set_dns'\n- domain_id: domain id\n- record_id: id of a record\n- record_type: type of DNS record\n- new_record_content: new value\n\nIf you need to get domains available in CF, call cf_tool and pass:\n- action 'domain'\n\nBefore calling any user query action, first execute get all domains action."
}
},
"typeVersion": 1.9
},
{
"id": "7489f1c5-68dc-46c9-a80c-f104f661898e",
"name": "Get TLDs",
"type": "n8n-nodes-base.httpRequest",
"position": [
608,
608
],
"parameters": {
"url": "https://api.cloudflare.com/client/v4/zones",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpCustomAuth",
"queryParameters": {
"parameters": [
{
"name": "per_page",
"value": "=100"
}
]
}
},
"credentials": {
"httpCustomAuth": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 4.1
},
{
"id": "2bfd5981-6511-4ce8-944e-f583e577519d",
"name": "Json",
"type": "n8n-nodes-base.code",
"position": [
160,
944
],
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nlet inpt = $input.first().json.query;\nlet out = {};\ntry{\n out = JSON.parse(inpt)\n} catch{}\nif( out.action ){\n return {out};\n} else{\n return {};\n}\n"
},
"typeVersion": 2
},
{
"id": "a6d94bec-619d-4863-833d-479cfcac458b",
"name": "Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
576
],
"parameters": {
"color": 6,
"width": 840,
"height": 544,
"content": "## Cloudflare ops\n\n- this is main operation call for getting, setting DNS records"
},
"typeVersion": 1
},
{
"id": "8c84645c-f5a8-41a2-9bad-c93d29f803fa",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
368,
800
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a542a8cc-a11b-41c7-a288-fc0948d002d3",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.out.action }}",
"rightValue": "domain"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6b5fa3fd-e4c2-4e01-bffd-f2ea364dc6a5",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.out.action }}",
"rightValue": "get_dns"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f3715811-47d8-4cee-b705-ea1ed4ddd0a3",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.out.action }}",
"rightValue": "set_dns"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "5980e4a6-805b-4266-9039-87ae6034dc66",
"name": "Postgres Chat Memory",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
400,
384
],
"parameters": {
"tableName": "langchain_chat_histories",
"contextWindowLength": 6
},
"credentials": {
"postgres": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "24f1a023-b3b3-4c8c-8878-a008a4a05aba",
"name": "CloudFlare tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
608,
384
],
"parameters": {
"workflowId": {
"__rl": true,
"mode": "id",
"value": "={{ $workflow.id }}",
"cachedResultName": "={{ $workflow.id }}"
},
"description": "=Call this tool to make cloudflare oprations. \nPass down only json with needed data",
"workflowInputs": {
"value": {},
"schema": [],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2.2
},
{
"id": "1831596a-e9a6-4d64-a5b6-817c0a1f6c26",
"name": "End",
"type": "n8n-nodes-base.noOp",
"position": [
704,
128
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d1d69661-c963-46aa-9f4e-2b5912a83d21",
"name": "SubCall",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
128,
688
],
"parameters": {},
"typeVersion": 1
},
{
"id": "3645506b-0bae-4868-af6f-ffac27aa42db",
"name": "Host details",
"type": "n8n-nodes-base.splitOut",
"position": [
768,
608
],
"parameters": {
"options": {},
"fieldToSplitOut": "result"
},
"executeOnce": false,
"typeVersion": 1
},
{
"id": "51811193-5d44-4314-b9d7-a5bf317fc535",
"name": "Getter",
"type": "n8n-nodes-base.httpRequest",
"position": [
608,
768
],
"parameters": {
"url": "=https://api.cloudflare.com/client/v4/zones/{{ $json.out.domain_id }}/dns_records",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpCustomAuth",
"queryParameters": {
"parameters": [
{}
]
}
},
"credentials": {
"httpCustomAuth": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 4.1
},
{
"id": "d78642dd-e0bd-470e-9e0a-c602c80e8f5b",
"name": "Setter",
"type": "n8n-nodes-base.httpRequest",
"position": [
608,
928
],
"parameters": {
"url": "=https://api.cloudflare.com/client/v4/zones/{{ $json.out.domain_id }}/dns_records/{{ $json.out.record_id }}",
"method": "PATCH",
"options": {},
"sendBody": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "content",
"value": "={{ $json.out.new_record_content }}"
}
]
},
"genericAuthType": "httpCustomAuth"
},
"credentials": {
"httpCustomAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.1
}
],
"connections": {
"Json": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Get TLDs",
"type": "main",
"index": 0
}
],
[
{
"node": "Getter",
"type": "main",
"index": 0
}
],
[
{
"node": "Setter",
"type": "main",
"index": 0
}
]
]
},
"SubCall": {
"main": [
[
{
"node": "Json",
"type": "main",
"index": 0
}
]
]
},
"Get TLDs": {
"main": [
[
{
"node": "Host details",
"type": "main",
"index": 0
}
]
]
},
"Chat Agent": {
"main": [
[
{
"node": "End",
"type": "main",
"index": 0
}
]
]
},
"Host details": {
"main": [
[]
]
},
"CloudFlare tool": {
"ai_tool": [
[
{
"node": "Chat Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Chat Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "Chat Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Chat Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
httpCustomAuthopenAiApipostgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
AI agent with light and basic prompt functions like and for DNS records.
Source: https://n8n.io/workflows/6844/ — 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.
by Varritech Technologies
Airtable AI Agent. Uses lmChatOpenAi, agent, toolWorkflow, toolCode. Chat trigger; 42 nodes.
Ai Agent To Chat With Airtable And Analyze Data. Uses lmChatOpenAi, agent, stickyNote, memoryBufferWindow. Chat trigger; 41 nodes.
I prepared a detailed guide that shows the entire process of building an AI agent that integrates with Airtable data in n8n. This template covers everything from data preparation to advanced configura
✨📊Multi-AI Agent Chatbot for Postgres/Supabase DB and QuickCharts + Tool Router. Uses chatTrigger, postgresTool, executeWorkflowTrigger, toolWorkflow. Chat trigger; 40 nodes.