8
n8n 中文网amn8n.com

使用Google表格数据填充Retell动态变量以处理呼叫

中级

这是一个Sales, AI领域的自动化工作流,包含 7 个节点。主要使用 Webhook, GoogleSheets, RespondToWebhook 等节点,结合人工智能技术实现智能自动化。 使用Google表格数据填充Retell动态变量以处理呼叫

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "9a8d7d07-a1b3-4bca-8e77-10da3a2abc45",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -160,
        0
      ],
      "webhookId": "7f35a3a8-54c3-49d7-879d-6c3429f0e5da",
      "parameters": {
        "path": "retell-dynamic-variables",
        "options": {
          "ipWhitelist": "100.20.5.228"
        },
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "79e77d72-6e13-428c-ad10-58e6930e2d90",
      "name": "响应Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        440,
        0
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"call_inbound\": {\n    \"dynamic_variables\": {\n        \"first_name\": \"{{ $json['First Name'] }}\",\n        \"last_name\": \"{{ $json['Last name'] }}\",\n        \"email\": \"{{ $json['E-Mail'] }}\",\n        \"variable_1\": \"{{ $json['User Variable 1'] }}\",\n        \"variable_2\": \"{{ $json['User Variable 2']}}\"\n    },\n    \"metadata\": {\n    }\n  }\n}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "10919781-9750-417f-bba6-293bf99dbc3e",
      "name": "通过电话号码获取数据库中的用户",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        140,
        0
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.body.call_inbound.from_number }}",
              "lookupColumn": "Phone Number"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU/edit#gid=0",
          "cachedResultName": "Users"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU/edit?usp=drivesdk",
          "cachedResultName": "Retell sample UserDB"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ufBkeygvc1l17m5N",
          "name": "Baptiste AS - Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "de9a2ff5-690e-4e1e-ab5c-5a8825986871",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -440
      ],
      "parameters": {
        "color": 7,
        "width": 601,
        "height": 1105,
        "content": "## 处理 Retell 的呼入电话 webhook"
      },
      "typeVersion": 1
    },
    {
      "id": "55b087bf-d51f-4660-94c7-3742915ff79b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -120
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 300,
        "content": "如果需要请更改路径"
      },
      "typeVersion": 1
    },
    {
      "id": "bd6a7c81-5125-4f46-a1ba-86029d3a0eda",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -120
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 300,
        "content": "替换为您自己的 Google Sheets,包括您的 Retell 代理的动态变量"
      },
      "typeVersion": 1
    },
    {
      "id": "7105c832-ffbe-4d36-90ec-b8c868388c4e",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -120
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 300,
        "content": "调整响应以匹配您的 Retell 动态变量"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Get user in DB by Phone Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get user in DB by Phone Number": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 销售, 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量7
分类2
节点类型4
难度说明

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

作者
Agent Studio

Agent Studio

@agentstudio

We are a product studio that helps organizations leverage no-code and generative AI to automate internal processes and launch new digital products.

外部链接
在 n8n.io 查看

分享此工作流