Enable scheduled tasks
Prepare an existing TOS bucket, then run from the project containingharness.yaml
harness.yaml
cloud.provider: byteplus, the matching runtime region and TOS bucket, or global --provider byteplus when deploying. Supply the bucket name rather than its URL. This version supports service-authenticated Harnesses, such as API-key deployments; shared OAuth Harnesses do not support background tasks
After deployment, run
agentkit harness cronjob status my-harness to confirm scheduling and storage are available before creating a task. The response describes the responding replica, not aggregate health across all replicas
Commands
harness cronjob create
Create a recurring or one-time taskcronjob_id. The same idempotency key and input return the same task; changed input is rejected. For one-time work, replace --cron with a future timestamp such as --at "2026-10-01T09:00:00+08:00". --config uses the message, harness, and model call limit from Harness invocation configuration; omitted fields inherit the deployment
Save the actual cronjob_id returned by creation for the detail, pause, and history commands below
harness cronjob list
List task definitions and current statusnext_cursor to --cursor for the next page
harness cronjob status
Show scheduler health for the responding replicaharness cronjob get
Get a scheduled taskharness cronjob pause
Pause future scheduling and queued executions without stopping an active executionharness cronjob resume
Resume a paused taskharness cronjob runs
List execution history, newest firstnext_cursor to --cursor for the next page
Select a run_id from the history returned by runs, then read that execution’s result. A task ID and execution ID are not interchangeable
harness cronjob result
Read an execution resultharness cronjob cancel
Request execution cancellationScheduling, recovery, and results
- Each execution gets its own session, and final results remain in TOS across restarts
- An occurrence is recorded as
skippedif the previous execution of that task is still active latestruns the most recent missed occurrence once.skipruns it only within--grace; older missed occurrences are not replayed individually- Failures and timeouts are not retried automatically; later scheduled occurrences can still run
- A stopped worker or lost lease marks the execution
interruptedand pauses the task. Inspect external effects before resuming recurring work or creating a replacement one-time task - Pausing does not terminate active work. Cancellation is checked during lease renewal, normally within about 20 seconds with the default lease
statusdescribes only the responding replica. History is newest first; during the brief history-save interval, results can appear ingetorresultbeforeruns
run_id and does not change the recurring schedule. Recheck execution status after requesting cancellation; completed external actions are not rolled back. This CLI has no subcommand to delete a task definition; use pause to stop future runs