taskq.xyz / docs / queue

Agentic jobs. Sealed artifacts. Terminal proof.

Queue is TaskQ's asynchronous execution plane for work that should not pretend to be a chat response: code edits, reports, file deliverables, multi-step analysis, patches, and long-running agent execution. The Gateway still owns auth, policy, placement, proof, usage, and settlement.

01 · submit

Submit a Queue job.

Queue requests are still submitted through the public Gateway. The customer bearer is checked first, then credential handle, policy, balance, eligible capacity, worker lease, and proof entry.

terminal — queue submitPOST /q/submit
curl https://api.taskq.xyz/q/submit \
  -H "authorization: Bearer $TASKQ_API_KEY" \
  -H "x-taskq-credential: cred_prod_anthropic_ca" \
  -d '{
    "task_type": "code_patch",
    "provider": "anthropic",
    "model": "claude-sonnet-4-5",
    "policy": {
      "must_run_in": ["CA"], "must_not_run_in": ["US"],
      "worker_trust_floor": "audited",
      "key_custody": ["pinned","enclave","customer_owned"]
    },
    "input": { "repo_ref": "artifact:repo_bundle_01",
      "instructions": "Patch the API client and return a diff." }
  }' 
02 · job object

Receive a job object, not fake completion.

Queue returns a job ID, lease reference, request ID, and proof lookup surface. A job is not complete until it reaches a terminal state. "Failed-but-complete" is forbidden.

response — accepted job202 Accepted
{
  "job_id": "job_01J...",
  "request_id": "req_01J...",
  "status": "leased",
  "lease_id": "lease_01J...",
  "worker_ref": "worker_blind:...",
  "chain_key": "sha256:...",
  "status_url": "/q/thread/job_01J..."
}
TASKQ QUEUE RECEIPTVERIFIED
planequeue
statusleased
workeraudited
artifactpending
fallbacknone
✓ job accepted under policy
03 · lifecycle

Every Queue job moves through explicit states.

Billing, artifacts, proof closure, and settlement depend on the terminal state.

queued

Accepted

Gateway accepted the request. No worker has taken the lease yet.

leased

Slot reserved

A compliant worker slot is reserved with a TTL and lease ID.

running

Execution active

The worker is performing the job and may emit signed checkpoints.

succeeded

Artifact sealed

Output is content-addressed, hash-recorded, and linked to the chain.

failed

Terminal failure

Failure is explicit. It is not marked complete, and blind retry rules do not hide it.

policy_blocked

Refused with proof

If no compliant capacity exists, Queue writes prevention evidence instead of falling back.

04 · poll the thread

The thread endpoint returns state, checkpoints, proof references, and artifact IDs.

terminal — job statusGET /q/thread/{id}
curl https://api.taskq.xyz/q/thread/job_01J... \
  -H "authorization: Bearer $TASKQ_API_KEY"
response — runningcheckpointed
{
  "job_id": "job_01J...",
  "status": "running",
  "checkpoint_count": 4,
  "placement_proof": "proof_...",
  "chain_key": "sha256:...",
  "artifacts": []
}
05 · artifacts

Retrieve sealed artifacts.

Artifacts are content-addressed, hash-recorded, retention-policy controlled, optionally encrypted under the customer key domain, and exportable with the chain segment.

terminal — artifact retrievalGET /q/artifacts/{id}
curl https://api.taskq.xyz/q/artifacts/art_01J... \
  -H "authorization: Bearer $TASKQ_API_KEY" \
  -o taskq-output.bundle

Sealed — content hash required

A successful job must point to valid output metadata and artifact hashes.

Exportable — moves with the evidence

The artifact metadata travels with audit exports and verifier bundles.

06 · custody and trust

Queue may run on leased BYOW workers when policy permits it.

Sensitive customers can require audited trust floors, pinned/enclave key custody, customer-owned workers, or private pools. Default sensitive posture: no plain leased credential custody. Leased capacity must satisfy jurisdiction, attestation, health, price, capacity, and lease requirements.

07 · failure semantics

Queue failures are part of the evidence model.

Refusals, lease failures, worker failures, artifact failures, and settlement-pending states are explicit.

409
NO_COMPLIANT_CAPACITY

No worker satisfies hard constraints. The correct response is refusal with proof.

503
CAPACITY_CONTENTION

Eligible capacity existed but lease acquisition failed after retries.

failed
TERMINAL_WORKER_FAILURE

The job failed and must not be presented as complete.

pending
SETTLEMENT_PENDING

Execution finished, chain closed, but ledger reconciliation is not final yet.

Next doc
Chain — look up, verify, and export signed proof
→