Skip to main content
Manage Bolt schedules from code: create, change, and delete the schedules you build in Paradime or through the API, deploy the schedules defined in YAML, and manage the Trigger URLs that start a schedule from a request.
Prerequisites:
  • These operations are available on every plan.
  • An account API key with the X-Paradime-Workspace header, or a workspace API key.
  • The Bolt admin capability group. To read a schedule’s environment, the key also needs Environment admin.
Keys, errors, pagination, and jobs work the same in every area. See Conventions.

Operations

Keys with the older Bolt schedules admin group can also call createBoltScheduleDefinition, deleteBoltScheduleDefinition, and Workspace.boltSchedules, and keys with Bolt schedules metadata viewer can read Workspace.boltSchedules. Updates, deploys, and Trigger URLs need Bolt admin.

Create a schedule

createBoltScheduleDefinition creates a schedule as the Bolt UI does. Paradime deploys it in the background after the call returns. The schedule input is the same BoltScheduleInput that the Bolt API takes, so every setting documented there works here: notifications, integrations, self-healing, Turbo CI, deferred schedules, parent-schedule triggers, and environment variables. Send your own slug to make the call safe to retry:
  • With a slug, sending the same input again returns the same schedule. The same slug with other settings is a CONFLICT.
  • Without a slug, Paradime mints one, and every call creates another schedule.
  • A slug is lowercase letters and digits in groups joined by single hyphens, at most 80 characters. It never changes. A slug that a YAML schedule holds, or that a deleted schedule held, can’t be used.
environment is the slug of a Bolt environment, such as production. Set exactly one of commands and commandConfigs. Leaving out suspended or continueOnError sets them to false.
For new code, use createBoltScheduleDefinition rather than the Bolt API’s createBoltSchedule. It accepts your slug, is safe to retry, returns the stored schedule, and reports errors with a code. createBoltSchedule keeps working.

List schedules

Workspace.boltSchedules lists the schedules created in Paradime or through the API, ordered by slug. It doesn’t list YAML schedules. To read every deployed schedule, YAML schedules included, use listBoltSchedules from the Bolt API.

Change, pause, or delete a schedule

updateBoltScheduleDefinition replaces the settings of a schedule created in Paradime or through the API, then redeploys it. Every setting you leave out is cleared, except suspended, continueOnError, and envVars, which keep their values. name changes the display name only: the slug never changes. Sending the same input again changes nothing. To pause a schedule, send its settings with suspended: true. To resume it, send them with suspended: false.
BoltScheduleDefinition returns only some of a schedule’s settings. For example, it doesn’t return notifications. Keep the full definition in your code, and send all of it on every update, or the settings you leave out are removed.
deleteBoltScheduleDefinition deletes the schedule and redeploys the workspace’s schedules. Deleting it again is not an error. The slug is never given out again. The schedule’s Trigger URLs stay, but start nothing: delete them with deleteTriggerUrl.
Both mutations refuse a schedule defined in YAML with CONFLICT. Change or remove it in the repository, then deploy the YAML schedules. The Bolt API’s suspendBoltSchedule and deleteBoltSchedule keep working for keys with the Bolt schedules admin group.

Deploy schedules from YAML

deployBoltSchedules reads the YAML schedules (paradime_schedules.yml or the .bolt/ folder) from the workspace’s deploy branch, and deploys them together with the schedules created in Paradime or through the API. The deploy runs as a job: the mutation returns a job at once, and you poll adminJob until its status is SUCCEEDED or FAILED. Only the key that started the job can read it. See Async jobs. Send branch to check which branch the deploy reads. If the workspace deploys from another branch, the call fails with VALIDATION_FAILED before anything starts. To change the deploy branch, set scheduleDeploymentBranch with updateWorkspace.
Poll the job with its id:
When the job succeeds, result.schedules lists every schedule the deploy read, YAML and UI. A schedule that couldn’t be deployed doesn’t fail the job: it has a failureReason, for example when no data warehouse connection is set up for its environment. The job fails:
  • With VALIDATION_FAILED when the YAML has an error. failure.reason gives the error.
  • With INTERNAL when the deploy doesn’t finish within 15 minutes, or fails for an unexpected reason.
If the deploy branch no longer exists, the job fails, and Bolt stops the YAML schedules until a later deploy succeeds. Schedules created in Paradime or through the API keep running.

Start a schedule with a Trigger URL

A Trigger URL starts a schedule when it receives a POST request that carries its secret. In Paradime, it is an incoming webhook, listed in the schedule’s Trigger URLs card.
  1. Make the schedule run on request: set triggerOnWebhook: true, and schedule: "OFF" for no time-based runs. For a YAML schedule, set trigger_on_webhook: true in the file and deploy it.
  2. Create the Trigger URL with createTriggerUrl. The schedule can be one created in Paradime or through the API, or a deployed YAML schedule. The name is 1 to 100 characters, and unique among the schedule’s Trigger URLs.
  3. Store the secret. It is shown only in this response.
Send requests to url with the secret in the Authorization header:
See Incoming webhooks for the request body, filters, and the responses Paradime sends. A second createTriggerUrl with a name the schedule already uses is a CONFLICT, because the first secret can’t be shown again. To get a new secret, rotate it.

Rotate, pause, resume, or delete a Trigger URL

These mutations take the Trigger URL’s publicId, the last part of its URL. Each change applies at once, without a deploy.
  • rotateTriggerUrlSecret returns a new secret, once. The old secret stops working at once.
  • pauseTriggerUrl stops the URL from starting runs, and resumeTriggerUrl lets it start them again. Pausing a paused URL, or resuming a running one, changes nothing.
  • deleteTriggerUrl deletes the URL. Deleting it again is not an error.
To check a schedule’s Trigger URLs, read Workspace.triggerUrls with the schedule’s slug. It never returns a secret: secretUpdatedAt says when the secret last changed, and lastEventAt when the URL last received a request.

Errors

These are the cases specific to Bolt. For the error format and the codes every area shares, see Errors. A deploy job that fails reports VALIDATION_FAILED or INTERNAL in failure.code, as described in Deploy schedules from YAML.