8
n8n 中文网amn8n.com

向取消的Stripe订阅发送反馈调查

高级

这是一个Market Research领域的自动化工作流,包含 17 个节点。主要使用 Stripe, Switch, Webhook, EmailSend, GoogleSheets 等节点。 使用Stripe和Google Sheets自动化取消反馈收集

前置要求
  • Stripe API Key
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "uqNyk0asIuKnQMXk",
  "meta": {
    "instanceId": "062f0e1ec3617ffb26cbc1b3c3518f28f3e57f08ddc210c471f532bb0bd6cf07",
    "templateCredsSetupCompleted": true
  },
  "name": "向取消的Stripe订阅发送反馈调查",
  "tags": [],
  "nodes": [
    {
      "id": "52bde91d-175a-49dd-8a41-7d35b8fcbc58",
      "name": "工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        0
      ],
      "parameters": {
        "width": 640,
        "height": 1340,
        "content": "## 📋 Stripe取消时的自动化反馈调查"
      },
      "typeVersion": 1
    },
    {
      "id": "fd82e2f9-248f-409f-a790-ec00ca02ca1c",
      "name": "步骤1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 280,
        "content": "## 步骤1:检测取消"
      },
      "typeVersion": 1
    },
    {
      "id": "c4b72f4a-32e3-4736-9a8b-896b775ffbc7",
      "name": "步骤2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 340,
        "height": 240,
        "content": "## 步骤2:获取客户信息"
      },
      "typeVersion": 1
    },
    {
      "id": "4e99664a-7ba0-43d2-8f70-d6d4be8ac7fe",
      "name": "步骤3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 560,
        "content": "## 步骤3:发送调查邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "0862a1bf-a237-4516-bccc-7eecdda7cf0f",
      "name": "步骤4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 400,
        "content": "## 步骤4:记录取消"
      },
      "typeVersion": 1
    },
    {
      "id": "4ed549f9-81e1-4f84-978e-2aba193ca509",
      "name": "步骤5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 460,
        "content": "## 步骤5:接收调查回复"
      },
      "typeVersion": 1
    },
    {
      "id": "adbd2373-0271-4f10-bb73-a343510ab646",
      "name": "步骤6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 460,
        "content": "## 步骤6:按原因路由"
      },
      "typeVersion": 1
    },
    {
      "id": "2f712d4a-b1fb-403a-9818-cdedbfce2500",
      "name": "步骤7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 500,
        "content": "## 步骤7:记录到类别工作表"
      },
      "typeVersion": 1
    },
    {
      "id": "24749ad3-95c9-4d7d-a8a5-1e39c5257909",
      "name": "Stripe订阅取消",
      "type": "n8n-nodes-base.stripeTrigger",
      "position": [
        -240,
        320
      ],
      "webhookId": "stripe-cancellation-webhook",
      "parameters": {
        "events": [
          "customer.subscription.deleted"
        ]
      },
      "typeVersion": 1
    },
    {
      "id": "c553c09e-5f4c-44d0-979b-344191c6c3b4",
      "name": "获取客户详情",
      "type": "n8n-nodes-base.stripe",
      "position": [
        112,
        320
      ],
      "parameters": {
        "resource": "customer",
        "customerId": "={{ $json.data.object.customer }}"
      },
      "typeVersion": 1
    },
    {
      "id": "a4f93441-e29b-494d-a69c-d3bfd5695448",
      "name": "发送反馈调查邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        480,
        320
      ],
      "webhookId": "email-send-webhook",
      "parameters": {
        "html": "=<p>Hi {{ $json.name || \"there\" }},</p>\n\n<p>Thank you for being a customer. We're sorry to see you go.</p>\n\n<p>To help us improve our service, would you mind sharing why you decided to cancel? It only takes 1 minute:</p>\n\n<p><a href=\"[SURVEY_URL]?email={{ $json.email }}&customer_id={{ $json.id }}&name={{ $json.name || 'Customer' }}&plan={{ $('Stripe Subscription Canceled').item.json.data.object.items.data[0].plan.nickname || $('Stripe Subscription Canceled').item.json.data.object.items.data[0].plan.id }}\" style=\"background-color: #4CAF50; color: white; padding: 12px 24px; text-decoration: none; border-radius: 4px; display: inline-block; margin: 16px 0;\">Share Your Feedback</a></p>\n\n<p><small>You were subscribed to: {{ $('Stripe Subscription Canceled').item.json.data.object.items.data[0].plan.nickname || 'Your Plan' }}</small></p>\n\n<p>Your feedback means the world to us and will help us serve our customers better.</p>\n\n<p>Thank you,<br>[Your Company Name]</p>\n\n<p><small>If you have any questions, feel free to reply to this email.</small></p>",
        "options": {},
        "subject": "We're sorry to see you go — Quick 1-min survey",
        "toEmail": "={{ $json.email }}",
        "fromEmail": "your-email@example.com"
      },
      "typeVersion": 2.1
    },
    {
      "id": "cc898a60-e1af-4a6c-b26a-fbd53a88cba3",
      "name": "记录到取消工作表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        832,
        320
      ],
      "parameters": {
        "columns": {
          "value": {
            "Plan Name": "={{ $('Stripe Subscription Canceled').item.json.data.object.items.data[0].plan.nickname || $('Stripe Subscription Canceled').item.json.data.object.items.data[0].plan.id }}",
            "Email Sent": "={{ $('Send Feedback Survey Email').item.json.accepted ? 'Success' : 'Failed' }}",
            "Customer ID": "={{ $('Stripe Subscription Canceled').item.json.data.object.customer }}",
            "Customer Name": "={{ $('Get Customer Details').item.json.name || 'N/A' }}",
            "Customer Email": "={{ $('Get Customer Details').item.json.email }}",
            "Cancellation Date": "={{ new Date().toISOString() }}"
          },
          "schema": [
            {
              "id": "Cancellation Date",
              "required": false,
              "displayName": "Cancellation Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer ID",
              "required": false,
              "displayName": "Customer ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Email",
              "required": false,
              "displayName": "Customer Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Plan Name",
              "required": false,
              "displayName": "Plan Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Sent",
              "required": false,
              "displayName": "Email Sent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d4ad096a-addf-48c7-a693-fc07e30f1ed6",
      "name": "调查回复Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -240,
        640
      ],
      "webhookId": "survey-response-webhook",
      "parameters": {
        "path": "survey-response",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "3077ceaa-38d5-4b20-b3f3-96c9c9587121",
      "name": "按反馈类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        112,
        624
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Price Concerns",
              "conditions": {
                "options": {
                  "caseSensitive": false
                },
                "combinator": "or",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.reason }}",
                    "rightValue": "expensive"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Feature Requests",
              "conditions": {
                "options": {
                  "caseSensitive": false
                },
                "combinator": "or",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.reason }}",
                    "rightValue": "feature"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "5d3befc8-8831-42a2-9d83-0a81df2ab1f9",
      "name": "记录价格问题",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        480,
        512
      ],
      "parameters": {
        "columns": {
          "value": {
            "Plan Name": "={{ $json.plan }}",
            "Customer Name": "={{ $json.name }}",
            "Response Date": "={{ new Date().toISOString() }}",
            "Customer Email": "={{ $json.email }}",
            "Additional Comments": "={{ $json.comments || 'N/A' }}",
            "Cancellation Reason": "={{ $json.reason }}"
          },
          "schema": [
            {
              "id": "Response Date",
              "required": false,
              "displayName": "Response Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Email",
              "required": false,
              "displayName": "Customer Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Plan Name",
              "required": false,
              "displayName": "Plan Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cancellation Reason",
              "required": false,
              "displayName": "Cancellation Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Additional Comments",
              "required": false,
              "displayName": "Additional Comments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Price Concerns"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "3c180c3d-c5e1-4a34-894b-973ac7cfe246",
      "name": "记录功能请求",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        480,
        640
      ],
      "parameters": {
        "columns": {
          "value": {
            "Plan Name": "={{ $json.plan }}",
            "Customer Name": "={{ $json.name }}",
            "Response Date": "={{ new Date().toISOString() }}",
            "Customer Email": "={{ $json.email }}",
            "Additional Comments": "={{ $json.comments || 'N/A' }}",
            "Cancellation Reason": "={{ $json.reason }}"
          },
          "schema": [
            {
              "id": "Response Date",
              "required": false,
              "displayName": "Response Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Email",
              "required": false,
              "displayName": "Customer Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Plan Name",
              "required": false,
              "displayName": "Plan Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cancellation Reason",
              "required": false,
              "displayName": "Cancellation Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Additional Comments",
              "required": false,
              "displayName": "Additional Comments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Feature Requests"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b09a3969-8253-4bac-94e7-b053a8fd48f1",
      "name": "记录其他反馈",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        480,
        784
      ],
      "parameters": {
        "columns": {
          "value": {
            "Plan Name": "={{ $json.plan }}",
            "Customer Name": "={{ $json.name }}",
            "Response Date": "={{ new Date().toISOString() }}",
            "Customer Email": "={{ $json.email }}",
            "Additional Comments": "={{ $json.comments || 'N/A' }}",
            "Cancellation Reason": "={{ $json.reason }}"
          },
          "schema": [
            {
              "id": "Response Date",
              "required": false,
              "displayName": "Response Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Email",
              "required": false,
              "displayName": "Customer Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Plan Name",
              "required": false,
              "displayName": "Plan Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cancellation Reason",
              "required": false,
              "displayName": "Cancellation Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Additional Comments",
              "required": false,
              "displayName": "Additional Comments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Other Feedback"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.7
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "36c00a3a-e28b-4d7b-9d2b-b1ae647da3ce",
  "connections": {
    "Get Customer Details": {
      "main": [
        [
          {
            "node": "Send Feedback Survey Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Feedback Type": {
      "main": [
        [
          {
            "node": "Log Price Concerns",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Feature Requests",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Other Feedback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Survey Response Webhook": {
      "main": [
        [
          {
            "node": "Route by Feedback Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Feedback Survey Email": {
      "main": [
        [
          {
            "node": "Log to Cancellations Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stripe Subscription Canceled": {
      "main": [
        [
          {
            "node": "Get Customer Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研

需要付费吗?

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

工作流信息
难度等级
高级
节点数量17
分类1
节点类型7
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流