follow-up-engine
Automated customer follow-up scheduling and execution engine for B2B sales. Generates personalized follow-up email drafts based on customer stage, last contact date, and follow-up strategy. Integrates with CRM systems (configurable) to sync follow-up records. Use when you need to automate outbound sales follow-ups, schedule reminders, or generate follow-up email content for dormant leads.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cjboy007/follow-up-engineFollow-up Engine - OpenClaw Skill 定义
技能描述
自动化客户询盘跟进规则引擎,基于配置的时间触发器和条件判断,智能生成跟进邮件草稿并同步到 OKKI CRM。
触发条件
定时触发(Cron)
# 每 30 分钟执行一次检测
*/30 * * * * cd $WORKSPACE/skills/follow-up-engine && node scripts/follow-up-scheduler.js --mode auto >> /tmp/follow-up-scheduler.log 2>&1
# 每小时执行一次 OKKI 同步
0 * * * * cd $WORKSPACE/skills/follow-up-engine && node scripts/okki-integration.js --sync >> /tmp/okki-integration.log 2>&1
事件触发
- 新询盘邮件到达 → 触发 new_inquiry 阶段跟进流程
- 报价单发送完成 → 触发 quoted 阶段跟进序列
- 样品寄送确认 → 触发 sample_sent 阶段跟进
- OKKI 跟进记录创建 → 触发阶段流转检测
执行逻辑
1. Follow-up Scheduler 流程
1. 加载配置
↓
2. 扫描 OKKI 客户列表
↓
3. 识别每个客户当前阶段
↓
4. 计算下次跟进时间
↓
5. 匹配到期需要跟进的客户
↓
6. 生成跟进邮件草稿
↓
7. 保存到 drafts/ 目录
↓
8. 记录执行日志
2. OKKI Integration 流程
1. 读取 drafts/ 目录草稿
↓
2. 过滤已同步草稿(status != synced)
↓
3. 匹配 OKKI 客户(域名搜索 + 名称搜索)
↓
4. 调用 OKKI API 创建跟进记录
↓
5. 更新草稿状态为 synced
↓
6. 记录同步日志
输入输出
输入
| 来源 | 数据类型 | 说明 |
|---|---|---|
| OKKI API | 客户列表 | 客户邮箱、公司名称、阶段 |
| follow-up-strategies.json | 配置 | 跟进序列、模板、升级规则 |
| task-001 email-smart-reply | 模板系统 | 邮件模板内容 |
输出
| 目标 | 数据类型 | 说明 |
|---|---|---|
| drafts/ | JSON 文件 | 跟进邮件草稿 |
| OKKI API | 跟进记录 | trail_type=105 |
| logs/ | 日志文件 | 执行记录、错误信息 |
| Discord | 通知消息 | 待审阅草稿提醒 |
配置项
环境变量
# OKKI CLI 路径
export OKKI_CLI_PATH="$WORKSPACE/xiaoman-okki/api/okki.py"
# Discord Bot Token(通知用)
export DISCORD_BOT_TOKEN="your-discord-bot-token-here"
# 通知频道 ID
export DISCORD_CHANNEL_ID="<your-discord-channel-id>"
配置文件
| 文件 | 用途 | 必填 |
|---|---|---|
| config/follow-up-rules.json | 跟进规则定义 | ✅ |
| config/stage-transitions.json | 阶段流转模型 | ✅ |
| config/follow-up-strategies.json | 跟进策略模板 | ✅ |
CLI 命令
follow-up-scheduler.js
# Dry-run 模式(预览)
node scripts/follow-up-scheduler.js --dry-run
# 自动模式(定时触发)
node scripts/follow-up-scheduler.js --mode auto
# 手动模式(立即执行)
node scripts/follow-up-scheduler.js --mode manual
# 调试模式(详细日志)
node scripts/follow-up-scheduler.js --debug
# 强制更新阶段
node scripts/follow-up-scheduler.js --force-stage-update
okki-integration.js
# Dry-run 模式(预览)
node scripts/okki-integration.js --dry-run
# 同步模式(实际创建 OKKI 记录)
node scripts/okki-integration.js --sync
# 批量同步(指定草稿文件)
node scripts/okki-integration.js --batch drafts/*.json
# 查看同步日志
node scripts/okki-integration.js --logs
依赖关系
上游依赖
| Skill | 用途 | 必须 |
|---|---|---|
| email-smart-reply (task-001) | 邮件模板系统 | ✅ |
| okki-email-sync (task-002) | OKKI API 封装 | ✅ |
下游集成
| 目标 | 用途 | 必须 |
|---|---|---|
| OKKI CRM | 客户数据 + 跟进记录 | ✅ |
| Discord | 审阅通知 | ✅ |
| Obsidian | 日志归档 | ❌ |
错误处理
常见错误码
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cjboy007-follow-up-engine": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
logistics
物流管理技能,提供提单生成、报关单据生成、物流跟踪等功能。支持 OKKI 客户数据同步和自动化文档处理。
okki-email-sync
Synchronize email activities and quotation events with OKKI CRM as follow-up trail records. Automatically matches emails to CRM customers via domain lookup and vector search, creates trail records (email type=102, quotation type=101), and deduplicates entries. Requires OKKI CRM API access and optional vector search setup. Use when you need to automatically log email communications and quotation events in your CRM.
报价单工作流
自动化生成报价单(Excel/Word/HTML/PDF),集成数据验证防止示例数据,支持 OKKI CRM
approval-engine
审批流程引擎 + 异常处理系统 — 规则驱动的多级审批、异常检测、自动恢复策略和 Discord 通知集成
auto-evolution
Multi-agent auto-evolution system — orchestrate review-execute-audit loops with 4 roles (Coordinator, Reviewer, Executor, Auditor). A single coordinator agent drives the loop by spawning sub-agents for review, execution, and audit. Break goals into subtasks, auto-iterate with dual quality gates, and auto-package results. Use when: user wants autonomous task execution with built-in quality assurance.