Skip to content

Scheduled messages

A scheduled message publishes a fixed body to a queue or a topic on a cron schedule. Use it to wake a worker ("run the nightly report"), or with a webhook to call an HTTPS endpoint on a timetable.

API only for now

Scheduled messages are managed through the API. Console pages are not available yet.

Create

mutation {
  createScheduledMessage(input: {
    name: "nightly-report"
    schedule: "0 2 * * *"            # five fields, UTC
    topic: "jobs"                    # or queue: "reports"
    routingKey: "report.nightly"     # topics only
    body: "{\"kind\":\"nightly\"}"
    contentType: "application/json"
    enabled: true
  }) { name nextRunAt }
}

runScheduledMessage(name) publishes once immediately, outside the schedule. scheduledMessage(name) shows the next and last run, the last status (OK or FAILED), the last error and how often it has run.

Schedule

Standard five-field cron (minute, hour, day of month, month, day of week), numbers only, always in UTC. The shortest interval is one minute. Messages are sent within about 15 seconds of the scheduled time.

Guarantees

At-least-once per occurrence.

  • An occurrence is normally published once. In a rare failure between publishing and recording it, the same occurrence is published again; both copies carry the same message id, <name>@<occurrence time>, so a consumer can drop the duplicate.
  • After the platform was unavailable, one late message is sent and the schedule continues from then; occurrences missed during the outage are not replayed.
  • If publishing fails (for example the target queue was deleted), the failure is recorded on the scheduled message and that occurrence is not retried.

Limits and permissions

  • scheduledMessages quota: 20 per tenant by default.
  • The body follows the message size limit.
  • Deleting the target queue or topic deletes the scheduled messages that point at it.
  • Reading and managing scheduled messages are separate permissions; editors hold both by default.

To run code on a schedule, not just send a message, use a scheduled job.