IM Scheduled Reminder
Cross-platform scheduled reminder skill that ensures accurate time triggering and message delivery. Configured via cron job to ensure messages are sent to the original channel where the user requested the reminder, avoiding the NO_REPLY issue.
Application Scenarios
- User requests scheduled reminders (e.g., "Remind me to attend the meeting in 5 minutes")
- User requests recurring tasks (e.g., "Remind me to drink water every hour")
- Need to trigger the Agent to perform operations and reply to users at a specified time
Fixed Fields
The following fields have fixed values in all tasks and cannot be modified:
| Field | Fixed Value | Description |
|---|
| | Must be true, otherwise the task will not execute |
| | Create an independent session for each trigger |
| | Trigger type is Agent turn |
| | Ensure messages are sent to external channels |
Dynamic Fields
The following fields need to be automatically populated based on the current session context:
| Field | Description |
|---|
| Current channel type, obtained from runtime context (e.g., ) |
| Required, target user ID of the current channel, obtained from session context; missing this will cause message delivery failure |
Scheduling Methods
One-time Schedule (at)
Trigger once at the specified time, suitable for scenarios like "Remind me after X minutes".
json
"schedule": {
"kind": "at",
"atMs": 1770449700000
}
is the Unix timestamp (in milliseconds) of the target trigger time.
Recurring Schedule (every)
Trigger repeatedly at fixed intervals, suitable for scenarios like "Remind me every X minutes".
json
"schedule": {
"kind": "every",
"everyMs": 60000
}
is the interval in milliseconds (e.g., 60000 = 1 minute).
Cron Expression Schedule (cron)
Schedule using standard cron expressions, suitable for calendar-based regular scenarios like "Remind me at 7 AM every day".
json
"schedule": {
"kind": "cron",
"expr": "0 7 * * *"
}
is a standard 5-field cron expression with the following format:
┌───────────── Minute (0-59)
│ ┌───────────── Hour (0-23)
│ │ ┌───────────── Day (1-31)
│ │ │ ┌───────────── Month (1-12)
│ │ │ │ ┌───────────── Week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *
Common expressions:
| Scenario | Expression |
|---|
| 7 AM every day | |
| 12 PM every day | |
| 9 AM on workdays | |
| 10 AM every Monday | |
| 9 AM on the 1st of every month | |
Complete Examples
Example 1: One-time Reminder
Trigger at the specified time and end after execution.
json
{
"version": 1,
"jobs": [
{
"id": "0dd466ae-d52a-448f-ad01-2fc719f1f48c",
"name": "test2",
"description": "test2",
"enabled": true,
"schedule": {
"kind": "at",
"atMs": 1770449700000
},
"sessionTarget": "isolated",
"wakeMode": "next-heartbeat",
"payload": {
"kind": "agentTurn",
"message": "The reply content is test2",
"deliver": true,
"channel": "feishu",
"to": "ou_XXXXXXXXXXX"
}
}
]
}
Example 2: Recurring Reminder
Trigger at fixed intervals and continue execution.
json
{
"version": 1,
"jobs": [
{
"id": "50f53ed1-4ad6-4ed2-9984-fdd4eba1fdab",
"name": "Test 1",
"description": "Test 1",
"enabled": true,
"schedule": {
"kind": "every",
"everyMs": 60000
},
"sessionTarget": "isolated",
"wakeMode": "next-heartbeat",
"payload": {
"kind": "agentTurn",
"message": "This is Test 1 reply",
"deliver": true,
"channel": "feishu",
"to": "ou_XXXXXXXXXXX"
}
}
]
}
Example 3: Cron Expression Scheduled Reminder
Scheduled via cron expression, suitable for calendar-based recurring tasks.
json
{
"version": 1,
"jobs": [
{
"id": "0ec68ffa-07b2-4ca6-93ee-75edd26b4b74",
"name": "cron",
"description": "cron",
"enabled": true,
"schedule": {
"kind": "cron",
"expr": "0 7 * * *"
},
"sessionTarget": "isolated",
"wakeMode": "next-heartbeat",
"payload": {
"kind": "agentTurn",
"message": "cron",
"deliver": true,
"channel": "feishu",
"to": "ou_XXXXXXXXXXX"
}
}
]
}
Channel Detection
- Get channel type: Obtain from the runtime property (e.g., )
- Get user ID: Obtain from the current session or message context (e.g., )
- Always auto-detect: Use the original channel where the request was initiated; do not hardcode
Message Content Guidelines
- Avoid plain text messages; include instructions for the Agent to generate responses
- Use complete instruction sentences to ensure the Agent produces visible replies after processing
Implementation Steps
- Detect the current channel type and user ID
- Convert the user's time request into a timestamp (milliseconds) or interval milliseconds
- Build the complete job configuration (fixed fields + dynamic fields)
- Call the API to create the scheduled task
- Confirm successful creation and notify the user
Common Pitfalls
| Wrong Practice | Correct Practice |
|---|
| Hardcoding channel and to | Auto-detect from current context |
| Setting to | Must set to |
| Missing or setting to | Must set to |
| Missing or setting to | Must explicitly set to |
| Missing or empty | Must fill in, otherwise messages cannot be delivered |