Build
Jobs and workloads
Give work a durable identity from submission through accepted results.
What a job is
A job is a finite operation over records, or a continuous stream, with an identity that outlives the request, conversation or sandbox that submitted it. The platform seals inputs and code at admission, cuts records into partitions, places attempts on eligible outposts, retries under the operation’s declared replay policy, accepts exactly one output per partition and settles the job with explicit coverage. Finite work and streams alike survive an outpost restart.
| Kind | What it runs |
|---|---|
| script | Your Python entrypoint over records: map_records, map_batches or single. |
| predict | A served detector over every record’s image, with no code and no sandbox. |
| task | A prompt for an agent, here or on a peer. It can pause with a question. |
| overwatch_scan | An Overwatch area scan (Scan in the console); the outpost plans one record per tile. |
| stream | Continuous work opened by a feed, such as a Watchdog guard. It runs until stopped. |
Follow the lifecycle
States are queued, running, input_required and the four terminal states completed, partial, failed and canceled; the console shows canceled as Stopped. Coverage counts partitions: expected, completed, failed, running, pending. A job completes when every partition is accepted, settles partial when some are, and fails when none are. A partial result keeps its coverage and is never a complete dataset with holes.
Read its current state, wait for settlement and retrieve accepted rows from any later run with the job ID.
import drkm
drkm.connect()
job = drkm.Job("your-job-id")
print(drkm.job(job.id)["coverage"])
job.wait()
print(job.rows())Make retries intentional
Silence is not failure. An attempt that times out is recorded as unknown and one that is stopped as canceled; both are silence. A replay-safe operation’s partition returns to the queue for another attempt while attempts remain, and a partition of a worker declared replay_safe=False fails instead, so the job settles partial with explicit coverage. Silence counts against max_attempts; a receiver’s busy refusal does not. The attempt timeout restarts when the receiver reports work in progress, and an attempt still queued at a receiver may wait up to four timeout windows for a slot before it is recorded as unknown.
A submission key is scoped to you: the same key with the same sealed work replays the existing job, the same key with different work is refused with a conflict, and renaming a retry still replays because the name is outside the fingerprint.
drkm console jobs --limit 50
drkm console jobs YOUR_JOB_ID
drkm console jobs YOUR_JOB_ID --runs | less # every partition and attemptStreams and schedules
A stream takes no input records and has no finite result: a Watchdog guard is one durable continuous job per feed. Closing the browser does not stop it, an outpost that restarts or loses power resumes it under the same job ID, and feed interruptions are retried while it runs. An explicit Stop ends it; so does a failure of the guard itself, which settles it as failed.
A recurring agent prompt is a schedule: each occurrence is admitted as a task job with the occurrence as its idempotency key, and while an occurrence is still queued, running or waiting for an answer, the next one is skipped rather than queued behind it.