Prerequisites:
- These operations are available on every plan.
- An account API key with the
X-Paradime-Workspaceheader, or a workspace API key. - The Bolt admin capability group. To read a schedule’s
environment, the key also needs Environment admin.
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 sameslugwith other settings is aCONFLICT. - 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.
Example response
Example response
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.
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.
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.
id:
Example response
Example response
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_FAILEDwhen the YAML has an error.failure.reasongives the error. - With
INTERNALwhen the deploy doesn’t finish within 15 minutes, or fails for an unexpected reason.
Start a schedule with a Trigger URL
A Trigger URL starts a schedule when it receives aPOST request that carries its secret. In Paradime, it is an incoming webhook, listed in the schedule’s Trigger URLs card.
- Make the schedule run on request: set
triggerOnWebhook: true, andschedule: "OFF"for no time-based runs. For a YAML schedule, settrigger_on_webhook: truein the file and deploy it. - 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. - Store the
secret. It is shown only in this response.
Example response
Example response
url with the secret in the Authorization header:
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’spublicId, the last part of its URL. Each change applies at once, without a deploy.
rotateTriggerUrlSecretreturns a new secret, once. The old secret stops working at once.pauseTriggerUrlstops the URL from starting runs, andresumeTriggerUrllets it start them again. Pausing a paused URL, or resuming a running one, changes nothing.deleteTriggerUrldeletes the URL. Deleting it again is not an error.
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.
Related
- Python SDK: Bolt: the same operations in
paradime.admin.bolt. - Paradime CLI:
paradime admin:paradime admin bolt schedulescreates, changes, lists, and deletes schedules. - Bolt API: trigger runs, read run status and logs, and the older schedule operations.
- Deploy schedules and Schedules as code: the same schedules in Paradime and in YAML.
- Incoming webhooks: Trigger URLs in Paradime, and how to call them.
- Administration API: Environments: the Bolt environments a schedule runs in.