This workflow follows the Agent → Datatable 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": "MAIN 2",
"nodes": [
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4o",
"mode": "list",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
280,
400
],
"id": "282e1615-4d1a-4d2f-b46d-10dbc4acab7d",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"name": "emailAgent",
"description": "Call this tool for any email actions.",
"workflowId": {
"__rl": true,
"value": "HZTRjHtpqwBeGIcW",
"mode": "list",
"cachedResultName": "EMAIL 2"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2,
"position": [
760,
520
],
"id": "b7fa5466-a15a-48d5-bbc7-e112fa16f689",
"name": "Email Agent"
},
{
"parameters": {
"name": "contactAgent",
"description": "Use this tool to search the internet.",
"workflowId": {
"__rl": true,
"value": "ALjwaKH3mVbgUcZL",
"mode": "list",
"cachedResultName": "CONTACT 2"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2,
"position": [
760,
660
],
"id": "78007de4-a3d6-48fd-8b67-d84e7a2d6dbd",
"name": "Contact Agent"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
440,
400
],
"id": "59b923d4-b423-4ec6-9ee4-62f3964e823b",
"name": "Window Buffer Memory"
},
{
"parameters": {
"toolDescription": "Use this tool to search the internet.",
"method": "POST",
"url": "https://api.tavily.com/search",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "{\n \"api_key\": \"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\",\n \"query\": \"{searchTerm}\",\n \"search_depth\": \"basic\",\n \"include_answer\": true,\n \"topic\": \"news\",\n \"include_raw_content\": true,\n \"max_results\": 3\n} ",
"placeholderDefinitions": {
"values": [
{
"name": "searchTerm",
"description": "What the user has requested to search the internet for",
"type": "string"
}
]
}
},
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"typeVersion": 1.1,
"position": [
900,
520
],
"id": "e2cbd554-0882-4376-affc-464d9998cf3b",
"name": "Tavily"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"typeVersion": 1,
"position": [
620,
660
],
"id": "f3869cd6-30e9-4d84-9800-98e9f0817ead",
"name": "Calculator"
},
{
"parameters": {
"name": "calendarAgent",
"description": "Call this tool for any calendar action.",
"workflowId": {
"__rl": true,
"value": "nHFLnMz7CdNgUWdk",
"mode": "list",
"cachedResultName": "CALENDAR 2"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2,
"position": [
620,
520
],
"id": "164dc97f-4042-40b1-a0eb-8bd51841e642",
"name": "Calendar Agent"
},
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"id": "baf0efd2-ef46-4212-84f9-28f6ce3900af",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.1,
"position": [
-380,
180
],
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "fe7ecc99-e1e8-4a5e-bdd6-6fce9757b234",
"name": "text",
"value": "={{ $json.message.text }}",
"type": "string"
}
]
},
"options": {}
},
"id": "fd30967a-3f47-4541-b6ba-d76bcf701e82",
"name": "Set 'Text'",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
0,
180
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.message.voice.file_id }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Voice"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "8c844924-b2ed-48b0-935c-c66a8fd0c778",
"leftValue": "={{ $json.message.text }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Text"
}
]
},
"options": {}
},
"id": "6047139e-69df-48f4-99c3-44c5ff8a0fc9",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-180,
180
]
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{ $json.output }}",
"additionalFields": {
"appendAttribution": false
}
},
"id": "b37c024a-9e73-47cf-9795-7656910dce56",
"name": "Response",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1040,
200
],
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "file",
"fileId": "={{ $json.message.voice.file_id }}"
},
"id": "472b91de-bc21-416c-849e-5bc8be66a062",
"name": "Download File",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
0,
0
],
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {}
},
"id": "392c765e-8794-4250-a5f7-0520e7e3abe0",
"name": "Transcribe",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.6,
"position": [
140,
0
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=# Overview\nYou are the ultimate personal assistant. Your job is to send the user's query to the correct tool. You should never be writing emails, or creating even summaries, you just need to call the correct tool. \n\n## Tools\n- emailAgent: Use this tool to take action in email\n- calendarAgent: Use this tool to take action in calendar\n- contactAgent: Use this tool to get, update, or add contacts\n- Tavily: Use this tool to search the web\n\n## Rules\n- Some actions require you to look up contact information first. For the following actions, you must get contact information and send that to the agent who needs it:\n - sending emails\n - drafting emails\n - creating calendar event with attendee\n\n## Examples\n1) \n- Input: send an email to tom crocodile asking him what time he wants to leave\n - Action: Use contactAgent to get tom crocodile's email\n - Action: Use emailAgent to send the email. You will pass the tool a query like \"send tom crocodile an email to ask what time he wants to leave. here is his email: [email address]\n- Output: The email has been sent to Tom Crocodile. Anything else I can help you with?\n\n\n## Final Reminders\n- Here is the current date/time: {{ $now }}"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
320,
200
],
"id": "6803a23e-1184-424a-9a92-5e19d2820ad9",
"name": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422"
}
],
"connections": {
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Email Agent": {
"ai_tool": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_tool",
"index": 0
}
]
]
},
"Contact Agent": {
"ai_tool": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_tool",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_memory",
"index": 0
}
]
]
},
"Tavily": {
"ai_tool": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calendar Agent": {
"ai_tool": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "ai_tool",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Download File",
"type": "main",
"index": 0
}
],
[
{
"node": "Set 'Text'",
"type": "main",
"index": 0
}
]
]
},
"Set 'Text'": {
"main": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "main",
"index": 0
}
]
]
},
"Download File": {
"main": [
[
{
"node": "Transcribe",
"type": "main",
"index": 0
}
]
]
},
"Transcribe": {
"main": [
[
{
"node": "\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422",
"type": "main",
"index": 0
}
]
]
},
"\u0411\u0418\u0417\u041d\u0415\u0421 \u0410\u0421\u0421\u0418\u0421\u0422\u0415\u041d\u0422": {
"main": [
[
{
"node": "Response",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "35c1364c-1f87-4fd8-acac-46451b3e39e3",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "C6hX4NgkjTkx3vm9",
"tags": []
}
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.
googlePalmApihttpBasicAuthhttpHeaderAuthhttpQueryAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
How this works
This workflow empowers sales teams and customer support agents to handle incoming queries via Telegram instantly, delivering personalised responses that boost efficiency and satisfaction without manual intervention. It processes messages using AI-driven agents for tasks like emailing contacts, checking calendars, or performing calculations, all orchestrated through Google Gemini's language model for accurate, context-aware replies. The key step involves the event-driven Telegram trigger capturing messages, followed by a chain of specialised agents that parse and act on the content, ensuring seamless integration with tools like Tavily for real-time searches.
Use this workflow for high-volume Telegram interactions in sales or support scenarios where quick, intelligent automation saves hours daily, such as lead qualification or appointment scheduling. Avoid it for low-traffic channels or when strict data privacy requires on-premises processing, as it relies on cloud-based AI. Common variations include swapping Telegram for WhatsApp triggers or adding CRM integrations like HubSpot for deeper lead tracking.
About this workflow
Main. Uses httpRequest, agent, lmChatGoogleGemini, outputParserStructured. Event-driven trigger; 57 nodes.
Source: https://github.com/anas-farooq8/verpakkingenxl/blob/main/workflows/Main.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.
Who is this for? Agencies, consultants, and service providers who conduct discovery calls and need to quickly turn conversations into professional proposals.
This is an automated blog post generation system that: Researches topics using AI agents and web search tools Writes complete blog posts with proper SEO structure Generates custom images for each post
This n8n template automates the collection, storage, and safety analysis of Facebook posts while simultaneously providing an interactive AI assistant on Telegram.
AI-Enriched Cold Outreach: Research → Draft → QA → Write-back
The AI-Powered Shopify SEO Content Automation is an enterprise-grade workflow that transforms product content creation for e-commerce stores. This sophisticated multi-agent system integrates GPT-4o, C