SextantDocs
v2.4latest
v2.4latestv1.9legacy

Switching keeps you on the same page when it exists in the other version.

On this page

jobs

Create, list, inspect, cancel and retry jobs from the command line, with every flag.

Updated CLI reference Version v2.4

Text
sextant jobs create    Create a job
sextant jobs list      List jobs
sextant jobs get       Show one job
sextant jobs cancel    Cancel a job
sextant jobs retry     Retry a failed or dead job

jobs create

Shell
sextant jobs create --queue emails --handler send-receipt \
  --payload '{"orderId":"ord_4412"}' --in 10m --idempotency-key receipt-ord_4412
--queuestring required
Queue to run on.
--handlerstring required
Registered handler name.
--payloadjson optional default {}
JSON payload. Use --payload-file <path> to read it from a file, or - for standard input.
--run-attime optional
RFC 3339 time. Mutually exclusive with --in.
--induration optional
Delay, for example 90s or 2h.
--priorityinteger optional default 5
0 to 9. Higher runs first within a queue.
--max-attemptsinteger optional
Overrides the queue’s value for this job.
--idempotency-keystring optional
Deduplicates creates for 24 hours.
--waitboolean optional
Block until the job finishes and exit 4 if --wait-timeout passes first.

jobs list

Shell
sextant jobs list --queue emails --state failed --state dead --since 1h --limit 20
--queuestring optional
Only this queue.
--statestring optional
Repeat to match several states.
--handlerstring optional
Only this handler.
--sinceduration optional
Only jobs created within this period.
--limitinteger optional default 50
Page size, up to 200. --all follows the cursor until the end.
Shell
$ sextant jobs list --state dead
ID              QUEUE   HANDLER       STATE  ATTEMPTS  CREATED
job_8f3k2m9q    emails  send-receipt  dead   5/5       2 minutes ago
job_1c7da0b4    emails  send-receipt  dead   5/5       14 minutes ago

jobs get, cancel, retry

Shell
sextant jobs get job_8f3k2m9q -o json
sextant jobs cancel job_8f3k2m9q
sextant jobs retry job_8f3k2m9q

cancel accepts several ids, and --queue emails --state queued cancels everything matching (add --yes to skip the confirmation). For the full history of attempts use sextant inspect.