🍎 生鲜采购助手工作流
高级
这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 Set, Switch, Telegram, AsanaTool, Agent 等节点。 通过Telegram语音和文本使用GPT-4o mini更新Asana采购清单
前置要求
- •Telegram Bot Token
- •OpenAI API Key
使用的节点 (16)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "vGvH6zfx9LuwHfoC",
"meta": {
"instanceId": "78a1670eff69dde15237f8eb0f091c143c10cc5aee229aa0485d9ac17fc48ce6",
"templateCredsSetupCompleted": true
},
"name": "🍎 生鲜采购助手工作流",
"tags": [],
"nodes": [
{
"id": "2fb8eb78-7430-4d93-b4e2-bc8ef7937887",
"name": "Telegram触发器",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-928,
-480
],
"webhookId": "0b400435-c749-49bf-834f-d35b50cf96e1",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "GroO0akGb3u44nyE",
"name": "Telegram: PA"
}
},
"typeVersion": 1.2
},
{
"id": "5c7d4876-0440-48c4-8c83-b7ef81983d5d",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
-784
],
"parameters": {
"width": 528,
"height": 944,
"content": "## 通过自然语言 AI 在 Telegram 中更新 Asana 生鲜采购清单"
},
"typeVersion": 1
},
{
"id": "d3e3cd4d-e68b-4182-841d-b78ba7b9fd9e",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-992,
-672
],
"parameters": {
"color": 4,
"width": 432,
"height": 464,
"content": "## 1. 触发器"
},
"typeVersion": 1
},
{
"id": "20899615-f262-4916-b11e-025c088b470e",
"name": "下载语音文件",
"type": "n8n-nodes-base.telegram",
"position": [
-480,
-384
],
"webhookId": "69f34549-fd79-4081-b656-2ff293f16b34",
"parameters": {
"fileId": "={{ $json.message.voice.file_id }}",
"resource": "file",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "GroO0akGb3u44nyE",
"name": "Telegram: PA"
}
},
"typeVersion": 1.2
},
{
"id": "f9d25bdc-96b8-420a-956a-2c48d79967e1",
"name": "获取文本字段",
"type": "n8n-nodes-base.set",
"position": [
-384,
-544
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "288d85a5-a000-4ecd-8efd-8249018b9846",
"name": "text",
"type": "string",
"value": "={{ $json.message.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c1777520-3ccf-431a-9fa4-698bda89fcfc",
"name": "录音转文字",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-288,
-384
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"id": "bNSgNFwMYVwTQBvV",
"name": "n8n free OpenAI API credits"
}
},
"typeVersion": 1.8
},
{
"id": "71b06cdc-3ef6-4fbd-ba55-ccfc17fb03e1",
"name": "生鲜采购助手",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
144,
-544
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=# Overview\nYou are a grocery agent who is excited about updating grocery lists according to requests.\n\n## Tools\n- Use \"Search for Grocery Item\" to search for the specific item(s) in the grocery list\n- Use \"Check or Uncheck Grocery Item\" to check or uncheck the grocery list depending on request\n- Use \"Update Expiry Date & Quantity\" to update the expiry date and quantity of the specific item\n\n\n## Rules\n- Do not assume anything. If unsure, check with user.\n\n## Instructions\n- You must first use \"Search for Grocery Item\" to get the details of the item.\n- If user says \"need\", \"out of\", \"need to top up\", \"add\" or anything that suggests that this item is needed, if item is already in the list, update the task to be unchecked. Alternatively, if item is not in the list, add it into the list.\n- if user says \"just got\", \"bought\", \"have\" or anything that suggests that item has been purchased, use \"Check or Uncheck Grocery Item\" to update the task to be checked or completed. If item is not already in the existing list, add to the list. If item is in the list, then update the task to be completed.\n- As long as user mentions a quantity or an expiry date to the item, use \"Update Expiry Date & Quantity\" tool.\n- At the end of the message, add a hyperlink to the asana grocery page for user. eg. \"Here's the [link](insert link here) for updates made.\"\n\n## Example\n- The query is \"we need eggs\". You would use \"Search for Item in Grocery List\" to check if \"eggs\" are in there. If \"eggs\" are in there AND checked, uncheck the item because the user needs eggs. If \"eggs\" are in there AND unchecked, leave it as is, and notify user accordingly. If \"eggs\" are not in there, add it in and notify user accordingly. In final message to user, add a link to the Asana Grocery page for user to access directly if needed. \n- The query is \"we just bought 6 cartons of oat milk that expires 1 june 2026\". You would use \"Search for Item in Grocery List\" to check if \"oat milk\" are in there. If \"oat milk\" is in there AND checked, leave it as is and notify user accordingly. If \"oat milk\" is in there AND unchecked, check the item. If \"oat milk\" is not in there, add it in and notify user accordingly. Since there is a quantity and expiry date, use \"Update Expiry Date & Quantity\" to update the expiry date to 1 June 2026 and quantity to 6 accordingly. In final message to user, add a link to the Asana Grocery page for user to access directly if needed. \n\n## Notes\nFor reference, today's date is {{ $now }}\n"
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "b7fa365d-0877-43d0-9cd6-0c5d5023f0c4",
"name": "便签 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-672
],
"parameters": {
"color": 5,
"width": 432,
"height": 464,
"content": "## 2. 语音/文本"
},
"typeVersion": 1
},
{
"id": "183e4683-17b4-4c04-b8ad-fb4d15fb8dbe",
"name": "GPT 4o mini",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-48,
-368
],
"parameters": {
"model": "openai/gpt-4o-mini",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "8YhGo1rl7F0epmIo",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "60dc16fe-3bf1-4967-bef8-75fcb8931651",
"name": "搜索生鲜采购项目",
"type": "n8n-nodes-base.asanaTool",
"position": [
128,
-368
],
"parameters": {
"operation": "search",
"workspace": "1208616855003281",
"authentication": "oAuth2",
"searchTaskProperties": {
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}"
}
},
"credentials": {
"asanaOAuth2Api": {
"id": "XNxBVunK2x0PeTsm",
"name": "Asana account"
}
},
"typeVersion": 1
},
{
"id": "d46489de-29b9-4ade-a867-d0272b34dada",
"name": "勾选或取消勾选生鲜采购项目",
"type": "n8n-nodes-base.asanaTool",
"position": [
304,
-368
],
"parameters": {
"id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Task_ID', ``, 'string') }}",
"operation": "update",
"authentication": "oAuth2",
"otherProperties": {
"completed": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Completed', ``, 'boolean') }}"
}
},
"credentials": {
"asanaOAuth2Api": {
"id": "XNxBVunK2x0PeTsm",
"name": "Asana account"
}
},
"typeVersion": 1
},
{
"id": "3d6dd43b-7d8f-4377-85ac-ac1649372d82",
"name": "便签 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-672
],
"parameters": {
"color": 3,
"width": 720,
"height": 464,
"content": "## 3. 生鲜采购更新"
},
"typeVersion": 1
},
{
"id": "ac1b8783-7997-4dd0-b73b-75b0dc51651b",
"name": "便签 4",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
-672
],
"parameters": {
"color": 4,
"width": 320,
"height": 464,
"content": "## 4. 响应"
},
"typeVersion": 1
},
{
"id": "1e6e953d-753c-43a7-b8ed-32d3f4b55c44",
"name": "在聊天中回复",
"type": "n8n-nodes-base.telegram",
"position": [
752,
-464
],
"webhookId": "72c93971-2254-4f0e-a3d2-f44d8f90df54",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "GroO0akGb3u44nyE",
"name": "Telegram: PA"
}
},
"typeVersion": 1.2
},
{
"id": "c13c8083-7339-47ef-9d0a-bda7ba44fb70",
"name": "更新保质期和数量",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
480,
-368
],
"parameters": {
"workflowId": {
"__rl": true,
"mode": "list",
"value": "6xj0T4s40s9NgWjC",
"cachedResultName": "🍎 Update Expiry & Quantity"
},
"description": "调用此工具来更新项目的保质期或数量",
"workflowInputs": {
"value": {
"TaskID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('TaskID', `this is the item whose expiry date and quantity needs to be updated`, 'number') }}",
"QuantityValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('QuantityValue', `this is the quantity to be updated`, 'number') }}",
"ExpiryDateValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('ExpiryDateValue', `this is the expiry date (without the time) to be updated`, 'string') }}"
},
"schema": [
{
"id": "TaskID",
"type": "number",
"display": true,
"required": false,
"displayName": "TaskID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ExpiryDateValue",
"display": true,
"required": false,
"displayName": "ExpiryDateValue",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "QuantityValue",
"type": "number",
"display": true,
"required": false,
"displayName": "QuantityValue",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2.2
},
{
"id": "5e54818e-0699-4790-b867-0f8d150c75e5",
"name": "路由文本或语音",
"type": "n8n-nodes-base.switch",
"position": [
-736,
-480
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e73aaadf-ae52-4fef-b4d7-bb51a2f35c39",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.message.text }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Voice",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "3ba5e049-2039-4001-adb6-09c654bb9b38",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.message.voice.file_id }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "ac31830f-0085-4a52-8a97-9648b1ba48dc",
"connections": {
"GPT 4o mini": {
"ai_languageModel": [
[
{
"node": "Grocery Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Grocery Agent": {
"main": [
[
{
"node": "Reply in Chat",
"type": "main",
"index": 0
}
]
]
},
"Get Text Field": {
"main": [
[
{
"node": "Grocery Agent",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Route Text or Voice",
"type": "main",
"index": 0
}
]
]
},
"Download Voice File": {
"main": [
[
{
"node": "Transcribe a recording",
"type": "main",
"index": 0
}
]
]
},
"Route Text or Voice": {
"main": [
[
{
"node": "Get Text Field",
"type": "main",
"index": 0
}
],
[
{
"node": "Download Voice File",
"type": "main",
"index": 0
}
]
]
},
"Transcribe a recording": {
"main": [
[
{
"node": "Grocery Agent",
"type": "main",
"index": 0
}
]
]
},
"Search for Grocery Item": {
"ai_tool": [
[
{
"node": "Grocery Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Update Expiry Date & Qty": {
"ai_tool": [
[
{
"node": "Grocery Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Check or Uncheck Grocery Items": {
"ai_tool": [
[
{
"node": "Grocery Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - AI 聊天机器人, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
基于Google Gemini、Notion和Telegram的统一业务编排器(CEO专用)
基于Google Gemini、Notion和Telegram的统一业务编排器(CEO专用)
Set
Notion
Switch
+18
93 节点YungCEO
AI 聊天机器人
商业AI指挥中心:Google Workspace模块化代理、向量搜索与多渠道报告
商业AI指挥中心:Google Workspace模块化代理、向量搜索与多渠道报告
Set
Gmail
Slack
+35
80 节点Paul
文档提取
AI营销团队
在Telegram中使用GPT-4和AI工具通过语音指令创建营销内容
Set
Switch
Telegram
+8
25 节点Muhammad Ashar
内容创作
宠物美容发布与预约自动化
使用AI、Facebook和Telegram机器人自动化宠物美容发布与预约
If
Set
Switch
+17
36 节点Christian Moises
AI 聊天机器人
我的工作流2
使用多个GPT-4o AI代理管理个人数据:Telegram上的Gmail、任务和财务
Set
Code
Gmail
+14
62 节点Mahmoud Shrouf
AI 聊天机器人
营养追踪与饮食记录(Telegram、Gemini AI和Google Sheets)
营养追踪与饮食记录(Telegram、Gemini AI和Google Sheets)
If
Set
Code
+13
55 节点John Alejandro SIlva
AI 聊天机器人