This workflow corresponds to n8n.io template #PT1i+zU92Ii5O2XCObkhfHJR5h9rNJTpiCIkYJk9jHU= — 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 →
{
"name": "Demo: My first AI Agent in n8n",
"nodes": [
{
"parameters": {
"multipleMethods": true,
"path": "cdio2",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-1152,
-224
],
"id": "893ae45d-a165-4d4a-8972-93cc9e71e044",
"name": "Webhook"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "d58c9aa0-8132-47f3-bc4a-c10456df8f5c",
"name": "id kh\u00e1ch",
"value": "={{ $json.body.entry[0].messaging[0].sender.id }}",
"type": "string"
},
{
"id": "dc31c679-2ffc-4ca6-a3f5-2f9eb58012bb",
"name": "id page",
"value": "={{ $json.body.entry[0].messaging[0].recipient.id }}",
"type": "string"
},
{
"id": "aa190287-c7bd-43cc-93c6-58c70c3eed53",
"name": "nd tin nh\u1eafn",
"value": "={{ $json.body.entry[0].messaging[0].message.text }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-848,
-128
],
"id": "ed739e02-6141-456c-8242-f0c46ac87bdf",
"name": "Edit Fields"
},
{
"parameters": {
"respondWith": "text",
"responseBody": "={{ $json.query['hub.challenge'] }}",
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.3,
"position": [
-816,
-304
],
"id": "c0e60573-2623-4dd1-81e8-49b3d4d69536",
"name": "Respond to Webhook"
},
{
"parameters": {
"jsCode": "const fullText = $input.first().json.output; \nconst recipientId = $('Edit Fields').first().json['id kh\u00e1ch']; \nconst chunks = []; \nfor (let i = 0; i < fullText.length; i += 1890) { \n chunks.push({ json: { recipient: { id: recipientId }, \n messaging_type: \"RESPONSE\", \n message: { text: fullText.slice(i, i + 1890) } \n } \n }); \n} \nreturn chunks;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-256,
-128
],
"id": "c8e292a1-6c80-4e23-bdd7-cdd19a69231e",
"name": "Code",
"executeOnce": false
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json['nd tin nh\u1eafn'] }}",
"options": {
"systemMessage": "=SYSTEM:\nB\u1ea1n \u0111ang \u0111\u00f3ng vai chatbot t\u01b0 v\u1ea5n tuy\u1ec3n sinh c\u1ee7a \u0110\u1ea1i h\u1ecdc Duy T\u00e2n. \nD\u1eef li\u1ec7u m\u00e0 b\u1ea1n \u0111\u01b0\u1ee3c cung c\u1ea5p \u0111\u00e3 \u0111\u01b0\u1ee3c load tr\u1ef1c ti\u1ebfp t\u1eeb GitHub repository th\u00f4ng qua n8n. \nD\u1eef li\u1ec7u bao g\u1ed3m nhi\u1ec1u file JSON ch\u1ee9a th\u00f4ng tin quan tr\u1ecdng nh\u01b0: \n- Th\u00f4ng tin h\u1ecdc ph\u00ed, ch\u00ednh s\u00e1ch h\u1ecdc b\u1ed5ng, \u0111\u1ed1i t\u01b0\u1ee3ng \u01b0u ti\u00ean\n- Chi ti\u1ebft ng\u00e0nh/chuy\u00ean ng\u00e0nh \u0111\u00e0o t\u1ea1o\n- \u0110i\u1ec3m tr\u00fang tuy\u1ec3n theo c\u00e1c ph\u01b0\u01a1ng th\u1ee9c x\u00e9t tuy\u1ec3n\n- Th\u00f4ng tin v\u1ec1 tr\u01b0\u1eddng, khoa, ch\u01b0\u01a1ng tr\u00ecnh \u0111\u00e0o t\u1ea1o (trong n\u01b0\u1edbc v\u00e0 qu\u1ed1c t\u1ebf)\n- Xu h\u01b0\u1edbng vi\u1ec7c l\u00e0m v\u00e0 g\u1ee3i \u00fd ng\u00e0nh h\u1ecdc theo n\u0103ng l\u1ef1c, s\u1edf th\u00edch\n\nB\u1ea1n c\u1ea7n hi\u1ec3u m\u1ed9t s\u1ed1 t\u1eeb kh\u00f3a vi\u1ebft t\u1eaft \u0111\u1ec3 gi\u1ea3i th\u00edch \u0111\u00fang m\u00e3 ng\u00e0nh v\u00e0 ch\u01b0\u01a1ng tr\u00ecnh:\nCMU: Carnegie Mellon University\nPSU: Pennsylvania State University\nCSU: California State University\nPNU: Purdue Northwest University\nHP: Ch\u01b0\u01a1ng tr\u00ecnh T\u00e0i n\u0103ng\nVJJ: Ch\u01b0\u01a1ng tr\u00ecnh Vi\u1ec7t Nh\u1eadt\nTROY: Ch\u01b0\u01a1ng tr\u00ecnh Du h\u1ecdc t\u1ea1i ch\u1ed7 l\u1ea5y b\u1eb1ng \u0110\u1ea1i h\u1ecdc Troy (M\u1ef9)\n\nH\u01af\u1edaNG D\u1eaaN TR\u1ea2 L\u1edcI:\n- N\u1ebfu ng\u01b0\u1eddi d\u00f9ng h\u1ecfi v\u1ec1 t\u1ed5ng s\u1ed1 nh\u00f3m ng\u00e0nh ho\u1eb7c c\u00e1c nh\u00f3m ng\u00e0nh \u0111\u00e0o t\u1ea1o th\u00ec ch\u1ec9 tr\u1ea3 l\u1eddi c\u00f3 bao nhi\u00eau nh\u00f3m ng\u00e0nh, sau \u0111\u00f3 li\u1ec7t k\u00ea t\u00ean c\u00e1c nh\u00f3m ng\u00e0nh l\u1edbn (v\u00ed d\u1ee5: C\u00f4ng ngh\u1ec7 th\u00f4ng tin, Khoa h\u1ecdc m\u00e1y t\u00ednh, C\u01a1 kh\u00ed, X\u00e2y d\u1ef1ng, Y t\u1ebf...).\n- Ch\u1ec9 khi n\u00e0o ng\u01b0\u1eddi d\u00f9ng y\u00eau c\u1ea7u li\u1ec7t k\u00ea chi ti\u1ebft ng\u00e0nh trong m\u1ed9t nh\u00f3m ng\u00e0nh th\u00ec m\u1edbi \u0111\u01b0a ra danh s\u00e1ch c\u1ee5 th\u1ec3.\n- N\u1ebfu ng\u01b0\u1eddi d\u00f9ng h\u1ecfi d\u1ea1ng yes/no (c\u00f3 hay kh\u00f4ng) th\u00ec tr\u1ea3 l\u1eddi \u201cc\u00f3\u201d ho\u1eb7c \u201ckh\u00f4ng\u201d, sau \u0111\u00f3 h\u1ecfi th\u00eam \u201cB\u1ea1n c\u00f3 mu\u1ed1n m\u00ecnh t\u01b0 v\u1ea5n chi ti\u1ebft h\u01a1n kh\u00f4ng?\u201d.\n- Khi c\u1ea7n gi\u1ea3i th\u00edch th\u00f4ng tin v\u1ec1 m\u00e3 ng\u00e0nh hay ch\u01b0\u01a1ng tr\u00ecnh, ch\u1ec9 s\u1eed d\u1ee5ng v\u0103n b\u1ea3n thu\u1ea7n (plain text).\n\nQUY \u0110\u1ecaNH \u0110\u1ecaNH D\u1ea0NG:\n- Tuy\u1ec7t \u0111\u1ed1i KH\u00d4NG s\u1eed d\u1ee5ng \u0111\u1ecbnh d\u1ea1ng Markdown (bao g\u1ed3m *, -, +, #, _).\n- Tuy\u1ec7t \u0111\u1ed1i KH\u00d4NG t\u1ea1o bullet list ho\u1eb7c numbering t\u1ef1 \u0111\u1ed9ng.\n- N\u1ebfu c\u1ea7n xu\u1ed1ng d\u00f2ng, ch\u1ec9 s\u1eed d\u1ee5ng k\u00fd t\u1ef1 xu\u1ed1ng d\u00f2ng (\\n).\n- Tr\u1ea3 l\u1eddi ng\u1eafn g\u1ecdn, \u0111\u00fang tr\u1ecdng t\u00e2m.\n\nUSER PROMPT:\n{{ $json[\"user_input\"] }}\n"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 2.1,
"position": [
-592,
-128
],
"id": "2c67f1ae-ecd8-4b01-817a-c12778a24e18",
"name": "AI Agent"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $json['id kh\u00e1ch'] }}",
"contextWindowLength": 100000000000000
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-544,
80
],
"id": "dc66ccd4-81bf-40d9-88f5-c3a176cd0aef",
"name": "Simple Memory"
},
{
"parameters": {
"resource": "file",
"operation": "get",
"owner": {
"__rl": true,
"value": "nguyendangthinhit",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "=SIC__BD_03",
"mode": "name"
},
"filePath": "SIC_BD_03/data/clean_data_2.json",
"asBinaryProperty": false,
"additionalParameters": {
"reference": ""
}
},
"type": "n8n-nodes-base.githubTool",
"typeVersion": 1.1,
"position": [
-16,
304
],
"id": "ed20a0d3-3e1c-41f3-8b8a-fd5605d415f1",
"name": "Get a file in GitHub",
"disabled": true
},
{
"parameters": {
"resource": "file",
"operation": "get",
"owner": {
"__rl": true,
"value": "nguyendangthinhit",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "CDIO_2",
"mode": "name"
},
"filePath": "data.json",
"asBinaryProperty": false,
"additionalParameters": {}
},
"type": "n8n-nodes-base.githubTool",
"typeVersion": 1.1,
"position": [
-352,
96
],
"id": "20e0a8a4-19a3-4f4e-9fac-681d98eaad95",
"name": "Get a file in GitHub1",
"credentials": {
"githubApi": {
"name": "<your credential>"
}
},
"disabled": true
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
-688,
80
],
"id": "88f7d30d-df76-40eb-a521-4bcee7c49f86",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "=D\u1eef li\u1ec7u chi ti\u1ebft v\u1ec1 c\u00e1c chuy\u00ean ng\u00e0nh trong k\u1ef3 tuy\u1ec3n sinh \u0111\u1ea1i h\u1ecdc Duy T\u00e2n 2025(c\u1ed9t M\u00e3 CN l\u00e0 M\u00e3 chuy\u00ean ng\u00e0nh)",
"documentId": {
"__rl": true,
"value": "1xxiiY9QxWfQpZHdfueUThpLk7jgnasxT3EZMJ9Xwlnk",
"mode": "list",
"cachedResultName": "chi_tiet_nganh_dtu_2025",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xxiiY9QxWfQpZHdfueUThpLk7jgnasxT3EZMJ9Xwlnk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 1777738509,
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xxiiY9QxWfQpZHdfueUThpLk7jgnasxT3EZMJ9Xwlnk/edit#gid=1777738509"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.7,
"position": [
-560,
384
],
"id": "1ffba475-7862-475e-9e8e-58ca7f205eec",
"name": "Chi_tiet_chuyen_nganh_2025",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "=C\u00e1c m\u00f4n h\u1ecdc trong c\u00e1c t\u1ed5 h\u1ee3p x\u00e9t tuy\u1ec3n",
"documentId": {
"__rl": true,
"value": "1Zu6GmTJB8lsbN2Xy1tjbFe4uR5GGahmAPevjs3wLTCk",
"mode": "list",
"cachedResultName": "to_hop_xet_tuyen",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Zu6GmTJB8lsbN2Xy1tjbFe4uR5GGahmAPevjs3wLTCk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": 79809833,
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Zu6GmTJB8lsbN2Xy1tjbFe4uR5GGahmAPevjs3wLTCk/edit#gid=79809833"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.7,
"position": [
-240,
400
],
"id": "7fe5cdb2-f961-4490-a8b0-f62c311e09cd",
"name": "To_hop_xet_tuyen",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "=\u0110\u00e2y l\u00e0 th\u00f4ng tin li\u00ean l\u1ea1c c\u1ee7a c\u00e1c chuy\u00ean vi\u00ean t\u01b0 v\u1ea5n c\u1ee7a trang tuy\u1ec3n sinh",
"documentId": {
"__rl": true,
"value": "13MCB8oUgomK-p5ZEEShMzZNGFnGQufiXexpewLuVJ_8",
"mode": "list",
"cachedResultName": "chuyen_vien_tu_van",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/13MCB8oUgomK-p5ZEEShMzZNGFnGQufiXexpewLuVJ_8/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Trang t\u00ednh1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/13MCB8oUgomK-p5ZEEShMzZNGFnGQufiXexpewLuVJ_8/edit#gid=0"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.7,
"position": [
-368,
384
],
"id": "d61ac658-795c-4225-a877-d9c7df1c350f",
"name": "chuyen_vien_tu_van",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "=\u0110\u00e2y l\u00e0 th\u00f4ng tin v\u1ec1 \u0111\u1ed1i t\u01b0\u1ee3ng \u01b0u ti\u00ean \u0111\u1ec3 x\u00e9t \u0111i\u1ec3m c\u1ed9ng. C\u00f3 c\u00e1c Nh\u00f3m \u01b0u ti\u00ean theo \u0111\u1ed1i t\u01b0\u1ee3ng: UT1(g\u1ed3m c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng 1-4), UT2(g\u1ed3m c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng 5-7); c\u00e1c nh\u00f3m \u01b0u ti\u00ean theo khu v\u1ef1c: KV1, KV2, KV2-NT, KV3; c\u00f2n l\u1ea1i l\u00e0 c\u00e1c tr\u01b0\u1eddng h\u1ee3p \u0111\u1eb7c bi\u1ec7t t\u00f9y thu\u1ed9c v\u00e0o th\u00f4ng tin \u0111\u01b0\u1ee3c sender cung c\u1ea5p s\u1ebd k\u1ebft lu\u1eadn ng\u01b0\u1eddi \u0111\u00f3 thu\u1ed9c nh\u00f3m n\u00e0o",
"documentId": {
"__rl": true,
"value": "1YMhFi0xn0TImzKEWUAhQP4CzP69cKpzQfr5XwGhjcgk",
"mode": "list",
"cachedResultName": "doi_tuong_uu_tien",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YMhFi0xn0TImzKEWUAhQP4CzP69cKpzQfr5XwGhjcgk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Trang t\u00ednh1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YMhFi0xn0TImzKEWUAhQP4CzP69cKpzQfr5XwGhjcgk/edit#gid=0"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.7,
"position": [
-816,
368
],
"id": "086be02c-eaf9-4f45-ab3b-d27eca80c863",
"name": "doi_tuong_uu_tien",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "=https://graph.facebook.com/v23.0/{{ $('Webhook').item.json.body.entry[0].messaging[0].recipient.id }}/messages?access_token=EAAKiLjdsBY0BPWWU1p2EWnCoc78MVK78AUxywcZBt7E475Cxgxk3iLyxbXvZC5WJnK4jzYvT2LuLIdPBFxyfXOHZCdJZCYuLPlHMpI1sw3xkZBBctRDSGxZB7jQ1kUpwpgtVDgoxNVOwf5aPPI9fEX9wUedKYuJEFUvAhgN6HWQ5dQBkcgZCdr2deWKyAzXVlZBgRWKBhwZDZD",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { \"recipient\": { \"id\": $(\"Edit Fields\").item.json[\"id kh\u00e1ch\"] }, \"messaging_type\": \"RESPONSE\", \"message\": { \"text\": $json.message.text } } }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-32,
-128
],
"id": "d579b6e1-3600-444c-900f-31b4a8788405",
"name": "HTTP Request"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Get a file in GitHub": {
"ai_tool": [
[]
]
},
"Get a file in GitHub1": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Chi_tiet_chuyen_nganh_2025": {
"ai_tool": [
[]
]
},
"To_hop_xet_tuyen": {
"ai_tool": [
[]
]
},
"chuyen_vien_tu_van": {
"ai_tool": [
[]
]
},
"doi_tuong_uu_tien": {
"ai_tool": [
[]
]
},
"HTTP Request": {
"main": [
[]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "3d91d9cb-d66e-424e-8b0e-8b4cecc511ae",
"meta": {
"templateId": "self-building-ai-agent"
},
"id": "ApcekepqEKpK3piu",
"tags": []
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Demo: My first AI Agent in n8n. Uses googleCalendarTool, chatTrigger, agent, lmChatOpenAi. Chat trigger; 5 nodes.
Source: https://github.com/splx-ai/agentic-radar/blob/65a7e4bd01e2034c7cb52e9620eeed287688cc53/examples/n8n/simple_google_calendar_agent/Demo__My_first_AI_Agent_in_n8n.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.
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
AI Agent : Google calendar assistant using OpenAI. Uses chatTrigger, lmChatOpenAi, memoryBufferWindow, googleCalendarTool. Chat trigger; 13 nodes.
35-ai-agent-google-calendar-assistant-using-openai. Uses chatTrigger, lmChatOpenAi, memoryBufferWindow, googleCalendarTool. Chat trigger; 13 nodes.
Reservation Medcin. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 12 nodes.