Durable Functions

Create a scheduler for a durable function

Changed on

Each tick starts an execution rather than invoking the function, under an execution name derived from the run, so a retried tick resolves to the execution it already started. Requested regions must be a subset of the function's deployed regions.

A tick draws on the same durable allowances and concurrency cap a manual start does, and a tick that would exceed the cap fails that run.

post/projects/{id}/durable-functions/{functionId}/schedulers

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    • HTTP bearer
    • or HTTP bearer

Path parameters

id, string uuid required

Project ID

functionId, string required

Durable function ID, or its name within the project

Request body

CreateFunctionSchedulerRequest required
name, string required
enabled, boolean
schedule, ScheduleRequest required
payload, object
regions, string[]

Optional single explicit deployed region. If omitted, the scheduler chooses one deployed region and invokes according to the cron expression.

Example request

{
  "schedule": {
    "cron_expression": "*/5 * * * *"
  }
}

Response

Scheduler created

FunctionScheduler required
id, string uuid
project_id, string uuid
function_id, string uuid
function_kind, 'standard' | 'durable'

Which collection the scheduled function belongs to. A project-wide scheduler list mixes both kinds, and this is what says whether the function is read back from /projects/{id}/functions or /projects/{id}/durable-functions — and whether a tick invokes it or starts a durable execution.

name, string
enabled, boolean
schedule_kind, 'cron'
cron_expression, string
payload, object
regions, string[]
regions_explicit, boolean
next_run_at, string date-time
last_started_at, string date-time
last_completed_at, string date-time
last_error, string
run_count, integer

Total number of times this scheduler has executed. 0 for a scheduler that has never run.

health, 'healthy' | 'failing'

failing while consecutive_failures is above 0; healthy otherwise, including before its first run in the region the scheduler runs in now. A run from a region it moved away from does not count. For a durable function a run finishes when its execution does, so a run that starts but then fails counts as failed.

consecutive_failures, integer

How many runs in a row have failed in the region the scheduler runs in now. Resets to 0 when a run succeeds, and starts at 0 in a region it moves to.

last_run_status, 'succeeded' | 'failed'

Outcome of the most recent finished run. Absent before the first.

last_success_at, string date-time

When the most recent successful run finished.

last_failure_at, string date-time

When the most recent failed run finished.

created_at, string date-time
updated_at, string date-time

Changes

    • info

      the endpoint scheme security ProjectAccessToken was added to the API

    • info

      added the optional property consecutive_failures to the response with the status

    • info

      added the optional property health to the response with the status

    3 more changes in this revision