LEDGERS - 使用AI提示添加联系人
中级
这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 If, Gmail, SplitInBatches, Agent, GoogleSheetsTrigger 等节点。 从非结构化数据解析创建LEDGERS联系人 - 使用GPT-4o
前置要求
- •Google 账号和 Gmail API 凭证
- •Google Sheets API 凭证
- •OpenAI API Key
使用的节点 (13)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "LIlKipVzEu7mwctU",
"meta": {
"instanceId": "5dba32fdafb8f6d54f482bfcea253ce3ca1ad8384004b236140a30142ce0135f"
},
"name": "LEDGERS - 使用AI提示添加联系人",
"tags": [],
"nodes": [
{
"id": "70f04b98-e2a8-42f3-bd4c-ac9c3ea7c016",
"name": "Google Sheets触发器",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-1984,
128
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1920008147,
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1m4lbSUudsxNI-thsPBZ1sjMU2yWLSQf0MrURDjBwIlg",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"typeVersion": 1
},
{
"id": "4eb10391-8622-49ee-ba8f-27af4fd66a61",
"name": "创建联系人",
"type": "@ledgers/n8n-nodes-ledgers-cloud.ledgers",
"position": [
-1104,
112
],
"parameters": {
"contactName": "={{ $json['output']['name'] }}",
"additionalFields": {
"pan": "={{ $json['output']['pan'] }}",
"email": "={{ $json['output']['email'] }}",
"gstin": "={{ $json['output']['gstin'] }}",
"mobile": "={{ $json['output']['mobile'] }}",
"business_name": "={{ $json['output']['business_name'] }}",
"billing_address": {
"billing_city": "={{ $json['output']['billing_city'] }}",
"billing_email": "={{ $json['output']['billing_addr_email'] }}",
"billing_gstin": "={{ $json['output']['billing_addr_gstin'] }}",
"billing_state": "={{ $json['output']['billing_state'] }}",
"billing_mobile": "={{ $json['output']['billing_addr_mobile'] }}",
"billing_country": "={{ $json['output']['billing_country'] }}",
"billing_pincode": "={{ $json['output']['billing_pincode'] }}",
"billing_address1": "={{ $json['output']['billing_address1'] }}",
"billing_address2": "={{ $json['output']['billing_address2'] }}"
},
"shipping_address": {
"shipping_city": "={{ $json['output']['shipping_city'] }}",
"shipping_email": "={{ $json['output']['shipping_addr_email'] }}",
"shipping_gstin": "={{ $json['output']['shipping_addr_gstin'] }}",
"shipping_state": "={{ $json['output']['shipping_state'] }}",
"shipping_mobile": "={{ $json['output']['shipping_addr_mobile'] }}",
"shipping_country": "={{ $json['output']['shipping_country'] }}",
"shipping_pincode": "={{ $json['output']['shipping_pincode'] }}",
"shipping_address1": "={{ $json['output']['shipping_address1'] }}",
"shipping_address2": "={{ $json['output']['shipping_address2'] }}"
},
"mobile_country_code": "={{$json['output']['mobile_country_code']}}"
}
},
"typeVersion": 1
},
{
"id": "98ed1623-d987-42e2-bcf4-b978d9ec17be",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2016,
-304
],
"parameters": {
"width": 944,
"height": 304,
"content": "### 此n8n工作流基于Google Sheet中的数据更新,使用AI自动在LEDGERS中创建联系人。"
},
"typeVersion": 1
},
{
"id": "12a98d73-d906-47c9-94fd-83253e965a8f",
"name": "结构化输出解析器",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-1520,
336
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"name\": \"\",\n \"mobile_country_code\": \"\",\n \"mobile\": \"\",\n \"email\": \"\",\n \"gstin\": \"\",\n \"business_name\": \"\",\n \"billing_address1\": \"\",\n \"billing_address2\": \"\",\n \"billing_city\": \"\",\n \"billing_state\": \"\",\n \"billing_country\": \"\",\n \"shipping_address1\": \"\",\n \"shipping_address2\": \"\",\n \"shipping_city\": \"\",\n \"shipping_state\": \"\",\n \"shipping_country\": \"\",\n \"billing_addr_email\": \"\",\n \"billing_addr_mobile\": \"\",\n \"billing_addr_gstin\": \"\",\n \"shipping_addr_email\": \"\",\n \"shipping_addr_mobile\": \"\",\n \"shipping_addr_gstin\": \"\"\n}"
},
"typeVersion": 1.3
},
{
"id": "cb8c047e-8216-417e-a869-904e54ef8582",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1856,
336
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "UFKz2T8lytASM50K",
"name": "n8n free OpenAI API credits"
}
},
"typeVersion": 1.2
},
{
"id": "1617af28-52aa-4715-a44c-f32d1922754b",
"name": "联系人创建失败",
"type": "n8n-nodes-base.gmail",
"position": [
-416,
192
],
"webhookId": "c8f559d3-b59e-42b7-8929-5a45bb265eb2",
"parameters": {
"message": "=### Sample EMAIL Template\n\n<h3>Your Contact Creation is Failed.</h3>\n\n<h6>Check the error message:</h6>\n<h2> {{ JSON.stringify($json, null, 2) }} </h2>",
"options": {},
"subject": "Regarding Create Contact via LEDGERS"
},
"typeVersion": 2.1
},
{
"id": "e375dc71-3347-4b1d-bc4a-99f2b0024eb4",
"name": "联系人创建成功",
"type": "n8n-nodes-base.gmail",
"position": [
-416,
0
],
"webhookId": "4cbb634d-9e9c-4909-9268-b3c05bb5b856",
"parameters": {
"message": "=### Sample EMAIL Template\n\n<h3>Your Contact Creation is Success.</h3>\n\n<h6>Check the Response</h6>\n<h2> {{ $json }} </h2>",
"options": {
"appendAttribution": true
},
"subject": "Regarding Create Contact via LEDGERS N8N"
},
"typeVersion": 2.1
},
{
"id": "b4ff0a41-8ef1-4d36-aa97-9592a97b1aa5",
"name": "智能AI创建联系人",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1760,
128
],
"parameters": {
"text": "=The following is a user-submitted JSON form. Your task is to clean and normalize it according to the specified rules and return it as a structured JSON object.\n\n### INPUT JSON:\n{{ JSON.stringify($json, null, 2) }}\n\n---\n\n### RULES:\n1. `name` is **required**. It may appear under keys like `\"Name\"`, `\"Customer Name\"`, `\"Contact Name\"`, `\"Consumer Name\"`, etc.\n2. If `mobile` is present:\n - Extract the country code to `mobile_country_code`\n - Extract the 10-digit number to `mobile`\n - If no country code, default `mobile_country_code` to `+91`\n3. IF `\"email\"` is Present:\n Validate `email` format. If invalid, include it in the `\"errors\"` object under `\"email\"` and don't include the value in `\"email\"`\n4. If GST or Tax Number or GSTIN is present, map it to `\"gstin\"` and if PAN or Permanent Account Number is present, map it to `\"pan\"`.\n5. Address:\n - Normalize from fields like `\"Address Line 1\"`, `\"Address Line 2\"`, `\"City\"`, `\"State\"`, `\"Country\"`,`\"Pincode\"`\n - Move any email, phone, GSTIN inside address fields to `billing_addr_email`, `billing_addr_mobile`, `billing_addr_gstin` and `shipping_addr_email`, `shipping_addr_mobile`, `shipping_addr_gstin`\n - if 2 different address is present then move the address to `billing_address1`, `billing_address2`, `billing_city`, `billing_state`, `billing_country`, `billing_pincode` and `shipping_address1`, `shipping_address2`, `shipping_city`, `shipping_state`, `shipping_country`, `shipping_pincode`\n6. Ensure `\"state\"` and `\"country\"` are valid — if `\"state\"` is given in abbreviations give full form and return `\"state\"` and `\"country\"` in **UPPERCASE**\n7. `business_name` may appear as `\"Business Name\"` or similar — normalize it\n8. Log any invalid or missing required data inside `\"errors\"` as key-value pairs\n9. ❗ **Do NOT generate or assume values. Only use data from the given input. Do NOT output placeholders like 'string', 'John Doe', or '123 Main St'. If data is missing, leave the field blank.**\n10. **Remember to store errors in `\"errors\"` object if any key gives `\"errors\"` then mention that key and value in error**\n\n---\n\n### REQUIRED OUTPUT FORMAT:\n```json\n{\n \"name\": \"\",\n \"mobile_country_code\": \"\",\n \"mobile\": \"\",\n \"email\": \"\",\n \"gstin\": \"\",\n \"pan\": \"\",\n \"business_name\": \"\",\n \"billing_address1\": \"\",\n \"billing_address2\": \"\",\n \"billing_city\": \"\",\n \"billing_state\": \"\",\n \"billing_country\": \"\",\n \"billing_pincode\": \"\",\n \"shipping_address1\": \"\",\n \"shipping_address2\": \"\",\n \"shipping_city\": \"\",\n \"shipping_state\": \"\",\n \"shipping_country\": \"\",\n \"shipping_pincode\": \"\",\n \"billing_addr_email\": \"\",\n \"billing_addr_mobile\": \"\",\n \"billing_addr_gstin\": \"\",\n \"shipping_addr_email\": \"\",\n \"shipping_addr_mobile\": \"\",\n \"shipping_addr_gstin\": \"\",\n \"errors\": {}\n}\n",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "095aceef-30c1-4cf1-b82a-b7723383c85a",
"name": "表单循环",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1344,
128
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "f4936bcb-04c3-4878-899f-b461cccc134f",
"name": "LEDGERS循环",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-864,
112
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "4385d084-c2d1-4ac4-ae83-aacc238acad9",
"name": "表单迭代",
"type": "n8n-nodes-base.noOp",
"position": [
-1328,
352
],
"parameters": {},
"typeVersion": 1
},
{
"id": "44a6f11c-478f-434a-a094-e5785558d9aa",
"name": "LEDGERS迭代",
"type": "n8n-nodes-base.noOp",
"position": [
-848,
336
],
"parameters": {},
"typeVersion": 1
},
{
"id": "565df44d-a75a-4099-8c4f-e8ec4477eee3",
"name": "成功/失败",
"type": "n8n-nodes-base.if",
"position": [
-640,
96
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "64f97f1d-a1d8-4eac-8c43-058ee2c81c35",
"operator": {
"type": "string",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json['errorMessage'] }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c1e545ea-bf2d-4e80-b4a3-1d12ed40c929",
"connections": {
"Form Loop": {
"main": [
[
{
"node": "Create a contact",
"type": "main",
"index": 0
}
],
[
{
"node": "Form Iteration",
"type": "main",
"index": 0
}
]
]
},
"LEDGERS Loop": {
"main": [
[
{
"node": "Success/Failure",
"type": "main",
"index": 0
}
],
[
{
"node": "LEDGERS Iteration",
"type": "main",
"index": 0
}
]
]
},
"Form Iteration": {
"main": [
[
{
"node": "Form Loop",
"type": "main",
"index": 0
}
]
]
},
"Success/Failure": {
"main": [
[
{
"node": "Contact Success",
"type": "main",
"index": 0
}
],
[
{
"node": "Contact Failed",
"type": "main",
"index": 0
}
]
]
},
"Create a contact": {
"main": [
[
{
"node": "LEDGERS Loop",
"type": "main",
"index": 0
}
]
]
},
"LEDGERS Iteration": {
"main": [
[
{
"node": "LEDGERS Loop",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Contact Create Smart AI",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Sheets Trigger": {
"main": [
[
{
"node": "Contact Create Smart AI",
"type": "main",
"index": 0
}
]
]
},
"Contact Create Smart AI": {
"main": [
[
{
"node": "Form Loop",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Contact Create Smart AI",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - AI 摘要总结, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
自动向客户发送发票
通过 OCR.Space、GPT-4 和 Google Drive 到 Gmail 实现发票处理的自动化
If
Set
Code
+12
29 节点Michael Taleb
AI 摘要总结
我的工作流
整理 Gmail:使用 GPT-4 分类归档非活跃邮件
If
Set
Gmail
+7
13 节点Matt Chong | n8n Creator
AI 摘要总结
使用AI Agent检查Instagram个人资料
使用Airtop抓取和GPT-4o智能自动化Instagram个人资料分析
Airtop
Filter
Google Sheets
+8
24 节点Luís Philipe Trindade
AI 摘要总结
使用AI自动化Morning Brew风格Reddit摘要并发布至DEV
使用AI自动化Morning Brew风格Reddit摘要并发布至DEV
If
Set
Wait
+13
26 节点Angel Menendez
AI 摘要总结
赞助交易邮件自动化
使用Gmail和GPT-4自动化赞助交易邮件回复
If
Set
Gmail
+6
16 节点Pramod Kumar Rathoure
AI 摘要总结
完整的 B2B 销售流程:Apollo 潜在客户生成、Mailgun 外展和 AI 回复管理
完整的 B2B 销售流程:Apollo 潜在客户生成、Mailgun 外展和 AI 回复管理
If
Set
Code
+26
116 节点Paul
内容创作
工作流信息
难度等级
中级
节点数量13
分类2
节点类型10
作者
LEDGERS
@ledgersCompletely integrated suite of cloud-based tools to help you with invoicing, payments, accounting, inventory management, payroll, GST compliance and more.
外部链接
在 n8n.io 查看 →
分享此工作流