Create schedule

http
POST /projects/{project_reference}/schedules

Create a recurring schedule that starts a task, a workflow or an agent on a cron expression, or, on REST and GraphQL only, activate a schedule declared in source (the MCP tool creates manual schedules only); returns the schedule: a new schedule is active, and a source schedule that was activated before keeps its current status. Requires project.runs.write.

Parameters

NameInRequiredDescription
project_referencepathYes

Request body

FieldTypeRequiredDescription
namestringYesHuman-readable schedule name.
targetobjectYesTyped schedule target.
schedulestringYesSchedule expression, for example a cron expression.
timezonestringIANA timezone used to evaluate the schedule. Defaults to UTC.
runtime_target_kindstringRuntime target kind for scheduled runs.
runtime_target_environment_idstring,nullEnvironment ID when runtime_target_kind is environment.
runtime_target_branch_idstring,nullBranch ID when runtime_target_kind is preview_branch.
configobjectRun configuration. For agent schedules, put the run prompt in config.prompt.
timeout_secondsintegerPer-run timeout in seconds.
backoff_limitintegerRetry backoff limit for failed scheduled runs.
concurrency_policystringHow overlapping scheduled runs are handled.
max_runsinteger,nullOptional maximum number of scheduled runs.
definition_sourcestringmanual (the default), or source to activate a schedule declared in source, which requires source_trigger_id, source_path and source_hash.
source_trigger_idstringTrigger id from the source definition. When a schedule with this id already exists, creating it from source can return that schedule with its current status; a paused schedule remains paused.
source_pathstringSource file path of the source schedule.
source_hashstringSource definition hash of the source schedule.

Responses

StatusDescription
201Created an active recurring project schedule for a task, workflow, or agent target.
400invalid_input: invalid body or parameters
401unauthenticated
403forbidden: a project member without project.runs.write
404not_found: project or target not found or not visible
500internal
503internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.