8
n8n 中文网amn8n.com

基于 JotForm、GPT-4o 和 Perplexity AI 的个性化 B2B/B2C 欢迎邮件

中级

这是一个自动化工作流,包含 11 个节点。主要使用 If, Set, Gmail, Merge, Perplexity 等节点。 通过 Gmail 使用 JotForm、GPT-4o 和 Perplexity AI 的个性化 B2B/B2C 欢迎邮件

前置要求
  • Google 账号和 Gmail API 凭证
  • OpenAI API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "689fa22e68cd4198e4ae37f3cc44f498087edd235a867e22515be823bab694c7",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b5a08019-8bf0-4413-b25f-e731aa71b627",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "cvoaGpSHxIHlkPx2",
          "name": "said"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "af8f0e58-297f-482e-ac9b-32dc2ff19eff",
      "name": "发送欢迎邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1472,
        304
      ],
      "webhookId": "c0990a65-14ba-476c-8c9d-6029e45c15a1",
      "parameters": {
        "sendTo": "={{ $('On New JotForm Submission').item.json.email }}",
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "=Welcome to Our Platform, {{ $('On New JotForm Submission').item.json.name.split(' ')[0] }}!"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "elmXkjoc2rihm2L8",
          "name": "yemsy-test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "dced7d8d-7511-48a9-9739-3591ed4ccbc6",
      "name": "当有新 JotForm 提交时",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        0,
        304
      ],
      "webhookId": "14e24b7a-6b4a-403c-b7d6-76593aa9627f",
      "parameters": {
        "form": "="
      },
      "credentials": {
        "jotFormApi": {
          "id": "dpLsZVpbiRjHdeDM",
          "name": "JotForm account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "685bbdaa-c187-4a92-b2b9-4319352b1043",
      "name": "通过 Perplexity AI 研究公司",
      "type": "n8n-nodes-base.perplexity",
      "position": [
        672,
        112
      ],
      "parameters": {
        "model": "sonar-pro",
        "options": {},
        "messages": {
          "message": [
            {
              "content": "=Research the company with domain {{ $json.domain_name }}. Provide a comprehensive overview including:\n\n1. Company name and overview\n2. Industry and market position\n3. Key products or services\n4. Recent news or developments\n5. Company culture and values\n6. Any notable achievements or recognition\n\nProvide detailed, accurate information that would help personalize a welcome email."
            }
          ]
        },
        "requestOptions": {}
      },
      "credentials": {
        "perplexityApi": {
          "id": "JChY8irnggxVhE2E",
          "name": "Perplexity account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fd7d1e5f-8a21-42f4-84d8-7aba61854782",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -880
      ],
      "parameters": {
        "width": 1024,
        "height": 1040,
        "content": "## 向任何 JotForm 线索发送智能、个性化的欢迎邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "ab0b495c-e41c-4cc8-8ee7-0f8b796d83a6",
      "name": "从电子邮件中提取域名",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "domain-extract-field",
              "name": "domain_name",
              "type": "string",
              "value": "={{ $json.email.split('@')[1] }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "62e2921d-1a46-40e6-be0e-e553af3fbd95",
      "name": "如果是工作邮箱",
      "type": "n8n-nodes-base.if",
      "position": [
        448,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e3e98824-2a5a-4517-8f5b-5250e84c2839",
              "operator": {
                "type": "array",
                "operation": "notContains",
                "rightType": "any"
              },
              "leftValue": "={{ [\"gmail.com\",\"yahoo.com\", \"outlook.com\", \"yopmail.com\"] }}",
              "rightValue": "={{$json.domain_name}}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ab0b4fc3-a515-4d0f-abe3-cabd7bf50840",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1248,
        304
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "8286a881-99c6-42a2-9765-b40dfd9a7d6a",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "cvoaGpSHxIHlkPx2",
          "name": "said"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "da8c05f2-dece-4320-821c-d486a19b39d8",
      "name": "AI 公司邮件撰写器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        0
      ],
      "parameters": {
        "text": "=Create a highly personalized welcome onboarding email for:\n\n**Lead Information:**\n- Name: {{ $('On New JotForm Submission').item.json.name }}\n- Email: {{ $('On New JotForm Submission').item.json.email }}\n- Company Domain: {{ $('Extract Domain from Email').item.json.domain_name }}\n\n**Company Research:**\n{{ $('Research Company via Perplexity AI').item.json.message.content }}\n\n**Additional Form Data:**\n{{ JSON.stringify($('On New JotForm Submission').item.json, null, 2) }}\n\n---\n\nCreate a warm, professional welcome email that:\n1. Addresses them by name\n2. Shows we've researched their company\n3. Demonstrates understanding of their industry/challenges\n4. Provides clear next steps\n5. Makes them excited to get started\n6. Includes a compelling subject line\n\nFormat the output as HTML email content with a subject line at the top.",
        "options": {
          "systemMessage": "=You are an expert email copywriter specializing in personalized B2B onboarding communications. Your emails are:\n\n- Warm yet professional\n- Highly personalized based on company research\n- Engaging and conversational\n- Clear about next steps\n- Focused on value and relevance to their business\n\nCreate emails that make recipients feel valued and understood. Use the company research to demonstrate genuine interest in their business. Keep the tone friendly but professional, and always include actionable next steps.\n\nOnly output the response in HTML and nothing else."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "5cf08a12-c83f-43f9-858a-2e830eabf11d",
      "name": "AI 个人邮件撰写器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        512
      ],
      "parameters": {
        "text": "=Create a highly personalized welcome onboarding email for:\n\n**Lead Information:**\n- Name: {{ $('On New JotForm Submission').item.json.name }}\n- Email: {{ $('On New JotForm Submission').item.json.email }}\n\n**Additional Form Data:**\n{{ JSON.stringify($('On New JotForm Submission').item.json, null, 2) }}\n\n---\n\nCreate a warm, professional personal welcome email that:\n1. Addresses them by name\n2. Demonstrates understanding of their challenges\n3. Provides clear next steps\n4. Makes them excited to get started\n5. Includes a compelling subject line\n\nFormat the output as HTML email content with a subject line at the top.",
        "options": {
          "systemMessage": "=You are an expert email copywriter specializing in personalized B2B onboarding communications. Your emails are:\n\n- Warm yet professional\n- Highly personalized based on company research\n- Engaging and conversational\n- Clear about next steps\n- Focused on value and relevance to their business\n\nCreate emails that make recipients feel valued and understood. Use the company research to demonstrate genuine interest in their business. Keep the tone friendly but professional, and always include actionable next steps.\n\nOnly output the response in HTML and nothing else."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Work Email": {
      "main": [
        [
          {
            "node": "Research Company via Perplexity AI",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Personal Email Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Company Email Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Personal Email Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Company Email Writer": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Personal Email Writer": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Domain from Email": {
      "main": [
        [
          {
            "node": "If Work Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On New JotForm Submission": {
      "main": [
        [
          {
            "node": "Extract Domain from Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Company via Perplexity AI": {
      "main": [
        [
          {
            "node": "AI Company Email Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级

需要付费吗?

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

工作流信息
难度等级
中级
节点数量11
分类-
节点类型9
难度说明

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

作者
Fahmi Fahreza

Fahmi Fahreza

@fahmiiireza

AI Automation Developer

外部链接
在 n8n.io 查看

分享此工作流