Skip to main content
Create a new schedule in the scheduler blob revision. The schedule is registered with the underlying scheduling service immediately and begins firing according to its configuration once it becomes active.

POST /revisions/:id/data/command (Command: create_schedule)

Request Body

The schedule’s own alias names the schedule itself. It is unrelated to invocation_target.workflow.definition, which names the separate workflow definition the schedule invokes when it fires — the two keys sit side by side below but identify different objects. See Alias Grammar for the character rules, length limits, and the id-shape restriction — an alias may not be shaped like a UUID.

Response

The schedule records the user_id of the user who created it. Scheduled executions this schedule triggers run as that user — which is what lets those executions, and any writes they make, be attributed back to a real identity.

Errors

Example (Recurring Cron)

This request’s target.session is an alias, because a default-following target must name its session that way — no session id survives a revision boundary, so the schema refuses a uuid-shaped target.session here. A target naming its blob by alias needs target.org alongside it:

Example (Thread Item)

A thread_item target posts to a thread in the session on every fire:
The response is the created schedule, as above, with invocation_target_type thread_item and the target as sent. A missing thread is created on the first fire; an alias that names an object that is not a thread makes every fire an invocation_error run.

Example (Object)

An object target writes a session object on every fire, which makes the schedule a clock:
Each fire replaces the object at ops/clock and raises an object.written on the session’s stream. See A clock.

Example (One-Time)

This request pins its target: target.revision is a concrete uuid, so target.session is resolved once, at save time, and stored as the id it resolved to — the response carries that id, not the alias the request sent.