Skip to content
← Back to Index

deleteJob

Keyword

 deleteJob( jobId: uuid ): nothing | Error

The deleteJob function deletes a pending Job, effectively cancelling it before it runs.

Availability

PromotionRuleReactor

Return Value

Returns nothing when the job was deleted. There is no false case — every failure is reported as an Error record instead.

Error Handling

CodeCondition
NOT_FOUNDNo job with the given jobId exists.
NOT_ALLOWEDThe job is currently running, is not in a pending state, or the caller lacks the jobs/<jobDefinitionId>:write permission for the job's definition.

Only pending jobs can be deleted — a job that has already started or finished cannot be cancelled.

Examples

Cancel a scheduled job

filtrera
from deleteJob jobId match
  Error |> 'Could not cancel the job'
  |> 'Job cancelled'

Schedule, then cancel later

filtrera
let scheduled = scheduleJob('myJobDefinition', now + 2 hours)

from scheduled match
  Error |> 'Failed to schedule'
  (jobId: uuid) |>
    // ...later, when no longer needed:
    deleteJob jobId

See Also

© 2026 Hantera AB. All rights reserved.