Ultrahost/ docs

A job points at a function, runs on a schedule, and keeps a history of attempts.

Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.

Create

SDKRESTDescription
cron.create(name, config)POST /cron/jobsCreate a scheduled job
cron.get(name)GET /cron/jobs/{name}Retrieve job configuration
cron.list()GET /cron/jobsList scheduled jobs
cron.update(name, config)PATCH /cron/jobs/{name}Update the schedule or target
cron.delete(name)DELETE /cron/jobs/{name}Delete a job
cron.enable(name)POST /cron/jobs/{name}/enableEnable a job
cron.disable(name)POST /cron/jobs/{name}/disablePause a job
ts
await ultrahost.cron.create("daily-report", {
  schedule: "0 8 * * *",
  timezone: "America/New_York",
  function: "generate-report",
  enabled: true,
  retries: 3
});

function is the name of a Custom Function, not a server you operate.

Configure

Jobs support:

  • Recurring cron schedules and one-time schedules
  • A timezone on the job
  • Retry policies
  • Execution timeouts
  • Failure notifications

disable() pauses the job and keeps its configuration. delete() removes it.

Creating and editing jobs is control-plane work. Running an already-enabled job is not a reason to hand the browser an admin credential.

Use

SDKRESTDescription
cron.run(name)POST /cron/jobs/{name}/runTrigger immediately
cron.history(name, options?)GET /cron/jobs/{name}/runsList execution history
cron.getRun(name, runId)GET /cron/jobs/{name}/runs/{runId}Retrieve one execution
cron.retry(name, runId)POST /cron/jobs/{name}/runs/{runId}/retryRetry a failed execution

History is cursor-paginated like other lists. A run that is still in progress can be followed through the same operation shape used elsewhere when the execution outlives the request.