Create, list, and delete schedules with natural language in a Forward Session.
Use natural language in a Forward Session to create, list, and delete schedules.
In addition to calling the API, end users can describe a task and its timing in the web app or an IM Channel. The Agent creates the Schedule, which then runs automatically without requiring the original Session to remain online.
The Template must enable these managed tools:
Example for updating an existing Template:
In the conversation, specify:
For monitoring tasks, specify the frequency, business date, year, start and end times, and trigger condition. The Agent asks follow-up questions if required information is missing.
After creation, the Agent returns the result. You can also ask it to show the newly created Schedule and confirm its name, trigger rule, and timezone.
You can list visible schedules and filter by name, task content, or status. For example:
Delete a Schedule by its ID or by its name or task content. For example:
If multiple schedules match, the Agent does not delete any of them. It returns the candidates so that you can select one by Schedule ID.
In natural-language management, "delete" archives the Schedule. An archived Schedule no longer runs, but its history remains available.
Prerequisites
The Template must enable these managed tools:
- Create schedules:
create_forward_schedule - List schedules:
list_forward_schedules - Delete schedules:
delete_forward_schedule
managed_tool_config is a top-level Template field. Configure it when you create a Template or update an existing one:
- Create a Template:
POST /api/v1/forward/templates - Update a Template:
POST /api/v1/forward/templates/{template_id}
enabled_tools replaces the complete set of currently enabled Schedule managed tools.
To troubleshoot the configuration, ask the Agent, "What tools do you currently have?" and confirm that all three tools are available.
Create a schedule
In the conversation, specify:
- When to run, such as every day at 9:00 AM, every Monday at 10:00 AM, or in two hours.
- What the task should do.
- The required output.
- The timezone. If omitted, the default is
Asia/Shanghai.
Recurring tasks
One-time tasks
Fixed-interval tasks
List schedules
You can list visible schedules and filter by name, task content, or status. For example:
Delete a schedule
Delete a Schedule by its ID or by its name or task content. For example:
View execution results
- A Schedule created in the web app returns results to the original Session. If you go offline, pending results are delivered the next time you open that Session.
- A Schedule created in an IM Channel sends results to the corresponding Channel Session.
- You can also use the API to list Schedule Runs or get a Schedule Run.
Limitations
- The minimum granularity or interval for
cronandintervaltriggers is one minute. - A relative delay for a
oncetrigger is exempt from the minimum frequency, but the delay must be greater than zero. - While a Schedule is running, it cannot create, list, or delete other schedules. This prevents self-replication and recursive schedule management.