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 β
{
"name": "\ud83d\udd25 AI Agent with xAI Grok API - Basic",
"nodes": [
{
"parameters": {
"content": "## \u4f7f\u7528 open ai chat model \u547c\u53eb xAI grok API\n",
"height": 580,
"width": 990,
"color": 6
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-520,
-140
],
"id": "af6a2807-1a28-49e9-964e-30a1eed83972",
"name": "Sticky Note3"
},
{
"parameters": {
"agent": "conversationalAgent",
"options": {
"systemMessage": "=## **\u4efb\u52d9** \n\u4f60\u662f\u4e00\u500b\u6a02\u65bc\u52a9\u4eba\u7684\u52a9\u7406\uff0c\u8acb\u63d0\u4f9b\u7c21\u6f54\u7684\u56de\u8986\uff0c\u56e0\u70ba\u4f7f\u7528\u8005\u6703\u900f\u904e\u624b\u6a5f\u8a9e\u97f3\u63a5\u6536\u56de\u8986\u3002\u907f\u514d\u4f7f\u7528\u5982 `\\n` \u9019\u985e\u7b26\u865f\uff0c\u4ee5\u9632\u5f71\u97ff\u8a9e\u97f3\u64ad\u5831\u3002 \n\n## **\u80cc\u666f\u8cc7\u8a0a** \n- \u4eca\u5929\u662f {{ $now.format('dd LLL yy') }}\u3002 \n- \u7576\u524d\u6642\u9593\uff1a{{ $now.format('h:mm a') }}\uff08\u53f0\u7063\u6642\u9593\uff09\u3002 \n- \u8a9e\u8a00\uff1a\u7e41\u9ad4\u4e2d\u6587\u3002 \n- \u82e5\u88ab\u8a62\u554f\uff0c\u4f60\u662f\u4e00\u500b **n8n \u5de5\u4f5c\u6d41\u7a0b** \u4e2d\u904b\u884c\u7684 AI \u4ee3\u7406\u3002 \n\n## **\u8f38\u51fa\u8981\u6c42** \n\u8acb\u4fdd\u6301\u56de\u8986**\u7c21\u6f54\u660e\u77ad**\uff0c\u512a\u5316\u70ba\u9069\u5408\u8a9e\u97f3\u64ad\u5831\u7684\u683c\u5f0f\u3002 \n\u4e0d\u8981\u7522\u751f\u932f\u8aa4\u8cc7\u8a0a\uff0c\u82e5\u4e0d\u77e5\u9053\u7b54\u6848\uff0c\u8acb\u76f4\u63a5\u56de\u7b54\u300c\u6211\u4e0d\u77e5\u9053\u300d\u3002 \n\u8f38\u51fa\u5167\u5bb9\u7684\u8a9e\u8a00\u61c9\u70ba**\u7e41\u9ad4\u4e2d\u6587**\u3002"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
-80,
20
],
"id": "1f001a52-c229-44fc-b2dc-7dbdddb1fce3",
"name": "AI Agent"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.1,
"position": [
-360,
20
],
"id": "01c9d109-7c05-447c-a8b9-607c2589f9ff",
"name": "When chat message received"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-40,
260
],
"id": "18083b16-160f-4e66-8db7-3eef4cd07d6d",
"name": "Window Buffer Memory"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "grok-2-1212",
"mode": "list",
"cachedResultName": "grok-2-1212"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-200,
260
],
"id": "e45818e1-f7ab-4ef7-9ea2-32aeea4821c9",
"name": "xAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[]
]
},
"xAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "8fc449d6-6079-46eb-89e6-992c107fff2a",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "TnZkTueNFXFvheee",
"tags": [
{
"createdAt": "2025-02-08T08:50:12.969Z",
"updatedAt": "2025-02-08T08:50:12.969Z",
"id": "MsjujtEapjDx89km",
"name": "YT"
},
{
"createdAt": "2025-02-26T02:27:02.570Z",
"updatedAt": "2025-02-26T02:27:02.570Z",
"id": "T8IZSFIeQbyeWt7f",
"name": "gen-AI"
}
]
}
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.
openAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
π₯ AI Agent with xAI Grok API - Basic. Uses agent, chatTrigger, memoryBufferWindow, lmChatOpenAi. Chat trigger; 5 nodes.
Source: https://github.com/qwedsazxc78/ai-automation-n8n/blob/bc074b119e8c8f42b3ceaf6f05d016d893869008/n8n/5-xAI-ai-agent/automation.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.
AI Agent : Google calendar assistant using OpenAI. Uses chatTrigger, lmChatOpenAi, memoryBufferWindow, googleCalendarTool. Chat trigger; 13 nodes.
OpenSea AI-Powered Insights via Telegram. Uses chatTrigger, telegramTrigger, lmChatOpenAi, memoryBufferWindow. Chat trigger; 13 nodes.
Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.
Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.
This template is a simple AI Agent that acts as a Google Calendar Assistant. It is designed for beginners to have their "first AI Agent" performing common tasks and to help them understand how it work