SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

The schedule object

Edit this page
Schedule · Related pages
Posted: 2026-09-16 · Report this thread
brandon Site Admin brandon profile Posts: 96
type Schedule struct {
Id int64 `json:"schedule_id"`
SystemId int64 `json:"system_id"`
StreamId int64 `json:"stream_id"`
Name string `json:"schedule"`
Expression string `json:"expression"`
SchemaVersion int `json:"schema_version"`
Concurrency ConcurrencyPolicy `json:"concurrency"`
Timeout time.Duration `json:"timeout"`
Suspended bool `json:"suspended"`
Payload json.RawMessage `json:"payload"`
Metadata json.RawMessage `json:"metadata"`
NextScheduledAt time.Time `json:"next_scheduled_at"`
LastScheduledAt *time.Time `json:"last_scheduled_at"`
}

A schedule stores a payload to produce repeatedly into one stream.

Fields

Field Type JSON name Description
Id int64 schedule_id Schedule id.
SystemId int64 system_id Owning SQLStreams installation.
StreamId int64 stream_id Target stream for produced messages.
Name string schedule Registration name, also used as each message’s routing key and message key.
Expression string expression Stored cron expression or descriptor.
SchemaVersion int schema_version Version attached to the stored payload when produced.
Concurrency ConcurrencyPolicy concurrency Requested concurrency policy for automatically produced messages.
Timeout time.Duration timeout Requested consumer handler timeout for each message. Consumer group bounds still apply.
Suspended bool suspended Whether automatic production is suspended. An explicit Run can still produce.
Payload json.RawMessage payload JSON payload reused on every run.
Metadata json.RawMessage metadata Registration metadata. Defaults to {}.
NextScheduledAt time.Time next_scheduled_at Scheduled time awaiting automatic production. It remains stored while suspended.
LastScheduledAt *time.Time last_scheduled_at Scheduled time of the last automatic produce, rather than its completion time. nil before the first automatic produce. Explicit Run does not update it.

Go JSON encoding represents Timeout in nanoseconds. The CLI formats it as a duration string.