8
n8n 中文网amn8n.com

语音预约自动提醒

中级

这是一个AI领域的自动化工作流,包含 12 个节点。主要使用 Code, Gmail, HttpRequest, ManualTrigger, GoogleCalendar 等节点,结合人工智能技术实现智能自动化。 使用Google Calendar、GPT-4o、ElevenLabs和Gmail自动发送语音预约提醒

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "4a11afdb3c52fd098e3eae9fad4b39fdf1bbcde142f596adda46c795e366b326"
  },
  "nodes": [
    {
      "id": "17ca0437-6101-4277-9ed2-e37e6b92df02",
      "name": "点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -160,
        280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d3dd600a-2ab5-4d52-92ef-ab3f29dd1790",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        260,
        400
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "c29d58a2-243b-41ab-99c6-f8a8c92219cf",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        460,
        400
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"mail_object\": {\n      \"type\": \"string\"\n    }\n  }\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "3cb31448-5bc3-47c2-a119-d9e33a464d1f",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -160,
        80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "18b243a5-db1f-4a27-a8a1-3a7c74135d6d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        20
      ],
      "parameters": {
        "width": 260,
        "height": 120,
        "content": "## Elevenlabs API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "62a9bd08-27f8-45a8-9eb4-30950500a36f",
      "name": "更改文件名",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        180
      ],
      "parameters": {
        "jsCode": "/*\n * Filename: addFileName.js\n * Purpose: Add a file name to binary data in an n8n workflow using mail_object from input\n */\n\nconst mailObject = $input.first().json.output.mail_object;\nconst fileName = `${mailObject}.mp3`;\n\nreturn items.map(item => {\n  if (item.binary && item.binary.data) {\n    item.binary.data.fileName = fileName;\n  }\n  return item;\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "41043058-ca06-4c3a-8b7d-597e2941d92b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        20
      ],
      "parameters": {
        "width": 300,
        "height": 120,
        "content": "## Gmail API 凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "3475e3ae-439d-4245-8994-4444266a67e3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 300,
        "height": 140,
        "content": "## Calendar API 凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "7784fc2d-3e64-40f0-990f-965fba4ad67c",
      "name": "生成语音提醒",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        180
      ],
      "parameters": {
        "url": "https://api.elevenlabs.io/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $json.output.message }}"
            },
            {
              "name": "model_id",
              "value": "eleven_multilingual_v2"
            }
          ]
        },
        "genericAuthType": "httpCustomAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "output_format",
              "value": "mp3_22050_32"
            }
          ]
        }
      },
      "notesInFlow": true,
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "a2081f29-493b-43c0-bad5-1b273d5db527",
      "name": "发送语音提醒",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1100,
        180
      ],
      "webhookId": "5ba2c8cb-84f1-4363-8410-b8d138286c3a",
      "parameters": {
        "sendTo": "={{ $('Get Appointments').item.json.attendees[0].email }}",
        "message": "=👇 Information for tomorrow 🗣️",
        "options": {
          "senderName": "John Carpenter",
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          },
          "appendAttribution": false
        },
        "subject": "={{ $('create message').item.json.output.mail_object }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "dd3bf7b2-f951-452a-8912-47ceace50cc0",
      "name": "创建消息",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        280,
        180
      ],
      "parameters": {
        "text": "=name: {{ $json.summary }}\ntime: {{ $json.start.dateTime }}\naddress: {{ $json.location }}\nToday's date: {{ $now }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are an assistant. You will create a structured message in JSON.\n\n**\nmessage:\nGenerate a voice script reminder for a real estate appointment. The message should be clear, professional, and engaging.\n\nIt must include:\n1. The recipient's name.\n2. The date and time of the appointment, expressed naturally (e.g., at noon, quarter past noon, half past three, quarter to five).\n3. The complete address of the property, expressed naturally (e.g., 12 Baker Street in London, Madison Avenue in New York, 5 Oakwood Drive in Los Angeles).\n4. A mention of the sender: Mr. John Carpenter from Super Agency.\n5. A confirmation sentence or an invitation to contact if needed.\n\nInput variables:\n• Recipient's name (prefixed with Mr. or Ms.)\n• Time: Appointment time\n• Address: Complete property address (only the street, number, and city; not the postal code)\n\nThe tone should be cordial and professional, suitable for an automated voice message.\n\nExample expected output: \"Hello Mrs. Richard, this is Mr. John Carpenter from Super Immo Agency.\nI am reminding you of your appointment scheduled for tomorrow at 8:15, at 63 Taverniers Road in Talence. If you have any questions or need to reschedule, please do not hesitate to contact me. See you tomorrow and have a great day!\"\n\n**\nmail_object: a very short email subject\nExample: Your appointment reminder for tomorrow"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "63806db8-6814-4fe4-ba2e-80511273ee51",
      "name": "获取预约",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        60,
        180
      ],
      "parameters": {
        "limit": 2,
        "options": {},
        "timeMax": "={{ $now.plus({ day: 2 }) }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "mymail@gmail.com",
          "cachedResultName": "mymail@gmail.com"
        },
        "operation": "getAll"
      },
      "typeVersion": 1.3
    }
  ],
  "pinData": {},
  "connections": {
    "create message": {
      "main": [
        [
          {
            "node": "Generate Voice Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change filename": {
      "main": [
        [
          {
            "node": "Send Voice Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Appointments": {
      "main": [
        [
          {
            "node": "create message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Appointments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "create message",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Voice Reminder": {
      "main": [
        [
          {
            "node": "Change filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "create message",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Get Appointments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量12
分类1
节点类型10
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
phil

phil

@phil

Accélérateur de Chiffre d'Affaires : Automatisez votre entreprise pour la rendre plus visible sur Google, pour trouver de nouveaux Clients, pour gagner du temps

外部链接
在 n8n.io 查看

分享此工作流