SuperAPI AI Directory

lark-workflow-onboarding

Office & productivity

View repository

Updated 10-16 08:52

About this skill

New Hire Onboarding Automation Workflow

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

  • "New colleague XX has joined" / "Help me prepare the new hire onboarding process"
  • "XX joins next Monday, help me arrange it in advance" / "Start the onboarding process"
  • "New hire onboarding" / "Prepare onboarding materials"
  • "Add the new colleague to the project group" / "Create onboarding tasks for the new employee"

Orchestrates 5 business domains(Contacts + Instant Messaging + Tasks + Knowledge Base + Calendar), enabling one-click automation of the onboarding process, an ultimate demonstration of cross-domain orchestration capability.

新人信息 ──► 自动化流程
              │
    ┌─────────┼─────────┬─────────┬─────────┐
    ▼         ▼         ▼         ▼         ▼
  Contact    IM       Task      Wiki     Calendar
  确认身份  拉入群聊  创建任务  发送必读  安排培训

Prerequisites

Supports user identity. Before execution, ensure authorization has been granted:

lark-cli auth login --domain contact,im,task,wiki,calendar

Workflow

用户提供新人信息 ──► contact +search(确认身份)
                         │
                         ▼
                   确认执行计划
                         │
          ┌──────────────┼──────────────┐──────────────┐
          ▼              ▼              ▼              ▼
    im(拉入群聊     task(创建      wiki(发送     calendar
     + 发欢迎消息)  入职任务清单)  知识库必读)  (安排培训日程)
          │              │              │              │
          └──────────────┼──────────────┘──────────────┘
                         ▼
                    执行报告

Step 1: Confirm the new hire's identity

Reference lark-contact/SKILL.md。

# 搜索新人信息
lark-cli contact +search --query "<新人姓名>" --format json

From the returned results, obtain:

  • user_id: used for all subsequent operations
  • name: confirm whether this is the target new hire
  • department: department information (used to determine which groups to add them to)
  • email: email (backup contact method)

When there are multiple matches: list them for the user to choose. When not found: the new hire's account may not have been created yet; prompt the user to retry later or manually provide the user_id.

Step 2: Collect onboarding configuration

Confirm the following information with the user (some can be automatically inferred by department):

## 入职配置确认

- **新人**:{姓名}({部门})
- **入职日期**:{日期}

请确认以下操作(输入序号取消不需要的步骤):
1. ✅ 拉入团队群聊:{推断的群名列表,或请用户指定}
2. ✅ 创建入职任务清单(默认 7 项)
3. ✅ 发送知识库必读文档
4. ✅ 安排 1v1 入职引导会议
5. ✅ 发送欢迎消息

如需修改,请告诉我。确认后输入"执行"。

⚠️ Security rule: Before all write operations, the plan must be displayed and user confirmation obtained.

Step 3: Add to group chat + send welcome message

Reference lark-im/SKILL.md。

Method A: Join an existing group chat (default)

# 搜索目标群聊
lark-cli im +chats-search --query "<群名关键词>" --format json

# 拉入群聊
lark-cli im chats members create --params '{"chat_id":"<chat_id>"}' \
  --data '{"id_list":["<user_id>"]}' --format json

Note: Adding people to a group may require bot identity or group admin permissions. If it fails, prompt the user to invite manually.

Method B: Create a dedicated onboarding group (when requested by the user)

v1.0.4+ supports --as user creating group chats, where the group owner is the current user rather than the bot, which is more suitable for team management.

# 创建入职专属群(user 身份,群主为当前用户)
lark-cli im +chat-create --as user \
  --name "{新人姓名} 入职引导群" \
  --user-ids "<新人user_id>,<leader_user_id>" \
  --format json

Send welcome message:

# 在群里发送欢迎消息
lark-cli im +messages-send \
  --receive-id "<chat_id>" \
  --receive-id-type "chat_id" \
  --msg-type "text" \
  --content '{"text":"🎉 欢迎 @{新人姓名} 加入团队!\n\n{新人姓名}将加入{部门},负责{岗位方向}。\n\n大家多多支持 🙌"}'

Step 4: Create onboarding task checklist

Reference lark-task/SKILL.md。

Default onboarding tasks (customizable):

# 逐个创建任务(串行执行)
lark-cli task +create --summary "完成飞书账号基础设置(头像、签名、部门)" \
  --due "<入职日+1天>" --assignee "<user_id>"

lark-cli task +create --summary "阅读团队知识库必读文档" \
  --due "<入职日+3天>" --assignee "<user_id>"

lark-cli task +create --summary "完成 IT 设备领取和权限申请" \
  --due "<入职日+1天>" --assignee "<user_id>"

lark-cli task +create --summary "与直属 Leader 完成 1v1 沟通" \
  --due "<入职日+3天>" --assignee "<user_id>"

lark-cli task +create --summary "了解团队当前项目和 OKR" \
  --due "<入职日+5天>" --assignee "<user_id>"

lark-cli task +create --summary "与核心协作方完成 Meet & Greet" \
  --due "<入职日+7天>" --assignee "<user_id>"

lark-cli task +create --summary "完成入职培训课程" \
  --due "<入职日+14天>" --assignee "<user_id>"

Customization: If the user specifies particular tasks (such as "add completing the code repository permission application"), add them to the default list.

Step 5: Send knowledge base required reading

Reference lark-wiki/SKILL.md。

# 列出知识空间
lark-cli wiki spaces list --format json

# 搜索新人必读文档
lark-cli wiki spaces nodes search --data '{"space_id":"<space_id>","query":"入职 新人 指南","page_size":10}' --format json

Compile the searched documents into a required reading list and send it to the new hire via direct message:

lark-cli im +messages-send \
  --receive-id "<user_id>" \
  --receive-id-type "user_id" \
  --msg-type "text" \
  --content '{"text":"Hi {新人姓名},欢迎加入!🎉\n\n以下是你的入职必读文档:\n\n📚 必读清单:\n1. {文档1标题} - {链接}\n2. {文档2标题} - {链接}\n3. {文档3标题} - {链接}\n\n建议在入职前 3 天内阅读完毕。有问题随时找我!"}'

Fallback handling: If the wiki domain is not authorized or no onboarding documents are found, skip this step and note it in the report.

Create onboarding Wiki page (v1.0.7+, optional):

When the user wants to create a dedicated knowledge base page for the new hire:

# 在知识库中创建新人专属页面(v1.0.7+ shortcut)
lark-cli wiki +node-create --space-id "<space_id>" \
  --parent-node-token "<parent_token>" \
  --title "{新人姓名} 入职指南"

Tip:wiki +node-create replaces the previous native API call, making it more concise.

Move documents to the onboarding directory (v1.0.10+, optional):

# 将已有文档移动到新人入职目录下(v1.0.10+ shortcut)
lark-cli wiki +move --space-id "<space_id>" \
  --node-token "<doc_node_token>" \
  --target-parent-token "<onboarding_folder_token>"

Tip:wiki +move Supports asynchronous task polling, suitable for moving large documents or directories.

Add a new hire as a Wiki space member (v1.0.10+, optional):

When the knowledge base has member permissions configured, you can directly add the new hire as a space member:

# 查看 wiki members API 参数结构
lark-cli schema wiki.spaces.members.create

# 添加新人为 wiki 空间成员
lark-cli wiki spaces members create --params '{"space_id":"<space_id>"}' \
  --data '{"member_type":"userid","member_id":"<user_id>","member_role":"member"}' --format json

Tip: The lark-wiki skill in v1.0.10 adds documentation for wiki member operations, ensuring new hires can directly access the team knowledge base after onboarding.

Step 6: Schedule onboarding training

Reference lark-calendar/SKILL.md。

# 安排 1v1 入职引导会议(默认带视频会议链接,v1.0.8+)
lark-cli calendar +create \
  --summary "入职引导 - {新人姓名} & {Leader姓名}" \
  --start "<入职日>T10:00:00+08:00" \
  --end "<入职日>T11:00:00+08:00" \
  --attendees "<新人use_id>,<leader_user_id>"

Note:v1.0.8+ +create A video conference link is included by default, so new hires can participate even if they are not in the office. Note: The Leader's user_id needs to be provided by the user or confirmed via contact search.

Step 7: Output execution report

## ✅ 入职流程执行报告

### 新人信息
- **姓名**:{姓名}
- **部门**:{部门}
- **入职日期**:{日期}

### 执行结果

| # | 操作 | 状态 | 详情 |
|---|------|------|------|
| 1 | 拉入群聊 | ✅ 已完成 | 已加入"XX团队群"、"XX项目群" |
| 2 | 欢迎消息 | ✅ 已发送 | 已在团队群发送欢迎消息 |
| 3 | 入职任务 | ✅ 已创建 | 7 项任务,截止日期从 {D+1} 到 {D+14} |
| 4 | 必读文档 | ✅ 已发送 | 3 篇文档链接已私聊发送 |
| 5 | 培训日程 | ✅ 已创建 | {入职日} 10:00-11:00 入职引导 |

### 后续建议
- Day 1:关注新人是否完成账号设置
- Day 3:检查必读文档阅读情况
- Day 7:确认 Meet & Greet 完成情况
- Day 14:入职培训完成确认

Fault tolerance mechanism

Exception scenario Handling method
New hire account not created Prompt to retry later, or manually provide user_id
Insufficient permission to create group Mark as "manual invitation required", do not block other steps
No "onboarding/new hire" related documents in the knowledge base Skip sending required reading, prompt user to specify manually
Schedule creation failed Mark the failure reason, recommend creating manually
A certain step failed Record the error, continue executing subsequent steps

Permission table

Step Command Required scope Required
Search user contact +search contact:user.base:readonly ✅ Required
Search group chat im +chats-search im:chat:readonly ✅ Required
Add to group chat im chats members create im:chat:member:write ✅ Required
Create group chat im +chat-create --as user im:chat:create_by_user Optional (Method B)
Send message im +messages-send im:message ✅ Required
Create task task +create task:task:write ✅ Required
Search knowledge base wiki spaces nodes search wiki:wiki:readonly Optional
Create Wiki page wiki +node-create wiki:wiki Optional (create a dedicated page for the new hire)
Move Wiki node wiki +move wiki:wiki Optional (v1.0.10+)
Add Wiki member wiki spaces members create wiki:wiki:member:create Optional (v1.0.10+)
Create schedule calendar +create calendar:calendar.event:write Optional

Reference