SaaS 试用到期提醒
第 6 部分 · 案例 3.3 · 🛒 电商 SaaS
难度 🟢 简单 · 耗时 ~20 分钟 · 核心节点 Schedule × Postgres × Email
SaaS 的命脉:让 trial 用户转付费用户。3 天前来一封”还有 3 天到期”的邮件能挽回不少。这个 workflow 每天上午 9 点扫数据库,给”恰好 3 天后到期且还没通知过”的用户发邮件,发完标记 notified_3d = true 避免重复。
- SaaS 产品 trial→paid 转化优化
- 月卡到期前的续费提醒
- 通用”按日期触发的批量通知”模式
🔍 工作流连线图
Section titled “🔍 工作流连线图” ▦ workflow trial-expiry.workflow.json Lv.1
📋 关键节点
Section titled “📋 关键节点”Daily 9AM Schedule
Section titled “Daily 9AM Schedule” ⚙ schedule.txt
Mode: Custom Cron Expression
Cron: 0 9 * * *
注意时区设置
Find Trials Ending 3d(SQL)
Section titled “Find Trials Ending 3d(SQL)” ⚙ pg-find.txt
Operation: Execute Query
Query:
SELECT id, email, name, trial_ends_at
FROM users
WHERE trial_ends_at::date = (CURRENT_DATE + INTERVAL '3 days')::date
AND notified_3d = false
输出:每行一个 item,下游迭代处理
Send Reminder Email
Section titled “Send Reminder Email” ⚙ send-reminder.txt
To: ={{ $json.email }}
Subject: =Your trial ends in 3 days, {{ $json.name }}
HTML:
<p>Hi {{ $json.name }},</p>
<p>Your free trial expires on
<b>{{ DateTime.fromISO($json.trial_ends_at).toFormat('MMM d, yyyy') }}</b>.
Upgrade now for 20% off:</p>
<p><a href="https://example.com/upgrade?u={{ $json.id }}">Upgrade Now</a></p>
Mark Notified(避免重复)
Section titled “Mark Notified(避免重复)” ⚙ pg-update.txt
Operation: Execute Query
Query: UPDATE users SET notified_3d = true
WHERE id = {{ $('Find Trials Ending 3d').item.json.id }}
⚠ 务必加这一步,否则明天还会发
📥 一键复制 Workflow JSON
Section titled “📥 一键复制 Workflow JSON” 📋 trial-expiry.workflow.json