CRITICAL — Before starting, you MUST first use the Read tool to read lark-shared/SKILL.md, which contains authentication, permission handling, and security rules.
Applicable Scenarios
- "Where is my approval?" / "How is the approval progress?"
- "Help me urge the approval" / "Why hasn't XX's approval been passed yet?"
- "What approvals are waiting for me to handle?" / "What are the ones pending my approval?"
- "Urge the overdue approvals" / "Remind the approver to handle it"
- "Approval acceleration" / "Approval tracking"
Connect approval query → progress tracking → timeout detection → reminder notification into a complete chain, to avoid approvals getting stuck and affecting business progress.
Prerequisites
Only supports user identity. Before execution, ensure authorization has been granted:
lark-cli auth login --domain approval,im,contact
Important: approval domain command format
⚠️ The approval domain has no Shortcut (
+verb) command, and the native API format must be used.Before use, you must first view the parameter structure:
lark-cli schema approval.<resource>.<method> # 查看参数结构 lark-cli approval <resource> <method> [flags] # 调用 API
Workflow
用户意图 ──► 分流
│
┌─────────┼─────────┐
▼ ▼
"我发起的审批" "待我审批的"
│ │
▼ ▼
approval tasks query approval tasks query
(topic=1, 我发起的) (topic=2, 待我处理的)
│ │
▼ ▼
过滤 PENDING 状态 展示待处理列表
│
▼
AI 分析超时实例
(等待时间 > 阈值)
│
▼
展示给用户确认 ──► im +messages-send(催办消息)
Step 1: Understand the user's intent
Divided into two core functions:
| Intent | Trigger words | Function |
|---|---|---|
| View approvals I initiated | "Where is my approval?", "approval progress", "urge approval" | Tracking + urging |
| View those pending my approval | "those waiting for my approval", "pending approvals" | To-do reminder |
Step 2: View the parameter structure (on first use)
# 先查看 tasks.query 的参数结构
lark-cli schema approval.tasks.query
Key parameters:
topic: 1 = approval tasks I initiated, 2 = approval tasks pending my handlinguser_id: may be omitted; defaults to querying the currently logged-in user
Step 3A: View approvals I initiated (tracking mode)
Refer to lark-approval/SKILL.md。
# 查询我发起的审批任务(topic=1)
lark-cli approval tasks query --data '{"page_size":20,"topic":1}' --format json
From the returned results, extract for each approval task:
task_id: approval task IDinstance_id: approval instance IDstatus: task status (PENDING/APPROVED/REJECTED, etc.)title: approval titlestart_time: task start time (Unix timestamp, seconds)
Note: To view more details, you can call for the specific instance
instances get。
Step 3B: View those pending my approval (to-do mode)
# 查询待我处理的审批任务(topic=2)
lark-cli approval tasks query --data '{"page_size":20,"topic":2}' --format json
Step 4: Get approval instance details
For approval instances that need detailed tracking, get complete information:
# 先查看参数结构
lark-cli schema approval.instances.get
# 获取实例详情
lark-cli approval instances get --params '{"instance_id":"<instance_id>"}' --format json
Extract from the instance details:
approval_name: approval definition namestatus: instance statusstart_time: initiation timetimeline: approval timeline (including handling information for each node)task_list: current approval node list (PENDINGis the node it is currently stuck at)
Step 5: Analyze waiting time
# 获取当前时间用于计算等待时长
date "+%s"
Timeout threshold rules:
| Approval type | Timeout threshold | Description |
|---|---|---|
| General (default) | 24 hours | Unprocessed for more than 1 business day |
| Urgent approval | 4 hours | Title contains "urgent", "expedited" |
| Leave/reimbursement | 48 hours | Non-urgent administrative approval |
Waiting time calculation:当前时间(秒) - start_time (start_time is a Unix timestamp)
Step 6: Display approval status
Tracking mode output:
## 📋 我发起的审批进度(共 N 项进行中)
### ⏰ 超时审批(需催办)
| # | 审批类型 | 标题 | 当前审批人 | 等待时间 | 状态 |
|---|---------|------|-----------|---------|------|
| 1 | 报销审批 | Q1 差旅报销 ¥8,500 | 张三 | ⚠️ 3天2小时 | 催办 |
| 2 | 采购审批 | 采购办公设备 | 李四 | ⚠️ 1天6小时 | 催办 |
### ✅ 正常进行中
| # | 审批类型 | 标题 | 当前审批人 | 等待时间 | 状态 |
|---|---------|------|-----------|---------|------|
| 3 | 请假申请 | 4/10-4/11 年假 | 王五 | 5小时 | 正常 |
### 📊 近期已完成
| # | 审批类型 | 标题 | 结果 | 完成时间 |
|---|---------|------|------|---------|
| 4 | 加班申请 | 3月周末加班 | ✅ 通过 | 昨天 |
| 5 | 出差申请 | 上海出差 3天 | ✅ 通过 | 3天前 |
需要对超时审批发送催办消息吗?(输入"催办"或指定序号)
To-do mode output:
## 📋 待我审批(共 N 项)
### ⏰ 紧急 / 等待较久
| # | 审批类型 | 发起人 | 标题 | 等待时间 | 建议 |
|---|---------|--------|------|---------|------|
| 1 | 报销审批 | 小王 | 客户拜访报销 ¥2,100 | ⚠️ 2天 | 尽快处理 |
### 📝 常规
| # | 审批类型 | 发起人 | 标题 | 等待时间 |
|---|---------|--------|------|---------|
| 2 | 请假申请 | 小李 | 4/15 事假 1 天 | 3小时 |
| 3 | 采购申请 | 小张 | 采购键盘鼠标 ¥800 | 1小时 |
Step 7: Send reminder message (after user confirmation)
⚠️ Security rule: The reminder message must only be sent after the user confirms.
Step 7.1: Get approver information
From Step 4, obtain the timeline or task_list find the approver with status PENDING Approver of the status user_id。
To search for a user by name:
# 获取用户信息用于发送消息
lark-cli contact +search --query "<审批人姓名>" --format json
Step 7.2: Send reminder message
Refer to lark-im/SKILL.md。
# 发送催办消息
lark-cli im +messages-send \
--receive-id "<user_id>" \
--receive-id-type "user_id" \
--msg-type "text" \
--content '{"text":"您好 🙏\n\n有一项审批等待您的处理:\n\n📋 类型:<审批类型>\n📝 标题:<审批标题>\n⏰ 已等待:<等待时间>\n👤 发起人:<我的名字>\n\n请您在方便时尽快处理,感谢!"}'
Note: The reminder message should be polite and professional. Do not repeatedly remind the same approver consecutively (it is recommended to remind at most once every 24 hours).
Step 8: Output execution report
## 催办执行报告
| # | 审批 | 审批人 | 催办状态 |
|---|------|--------|---------|
| 1 | Q1 差旅报销 | 张三 | ✅ 已发送催办消息 |
| 2 | 采购办公设备 | 李四 | ✅ 已发送催办消息 |
💡 建议:如果 24 小时后仍未处理,可以再次催办或通过电话/当面沟通。
Fault tolerance mechanism
| Exception scenario | Handling method |
|---|---|
| approval domain not authorized | Prompt the user to authorize and display the authorization command |
| No pending approvals | Inform "there are currently no approvals in progress" |
| API parameters uncertain | First execute lark-cli schema approval.<resource>.<method> to view the structure |
| Approver user_id cannot be obtained | Display approval information but mark "cannot automatically remind" |
| Message sending failed | Record the failure and suggest the user communicate manually |
| Approval type cannot be identified | Use the general timeout threshold (24 hours) |
Permission table
| Step | Command | Required scope | Required |
|---|---|---|---|
| Query approval tasks | approval tasks query |
approval:task:read |
✅ Required |
| Approval instance details | approval instances get |
approval:instance:read |
✅ Required (when reminding) |
| Search users | contact +search |
contact:user.base:readonly |
Recommended (when reminding) |
| Send reminder | im +messages-send |
im:message:send_as_bot or im:message |
Recommended (when reminding) |
Reference
- lark-shared — Authentication, permissions (required reading)
- lark-approval —
tasks query、instances getand other native API usage - lark-contact —
+searchdetailed usage - lark-im — Detailed usage of message sending