Enqueue a task
enqueue_taskAppend a task to a named work queue for workers to claim. Supports priorities, delays, retries, deduplication, and dependency-gated execution.
Instructions
Append a task to a work queue (created on first use). payload is the opaque task body (often JSON) a worker reads after claiming. Optional: kind/title for triage, priority (higher runs sooner), maxAttempts (auto re-queue up to N on nack/lease-expiry), visibilityTimeoutMs (default lease), delayMs (schedule into the future), dedupeKey (collapse duplicate enqueues), and — for the goals system — goalId (tag the task to a goal) and dependsOn (task ids that must all reach done before this task becomes claimable; a DAG gate). Returns the new task id + seq.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | free-form category for triage | |
| queue | Yes | queue name (created on first enqueue) | |
| title | No | ||
| goalId | No | goals system: tag this task to a goal | |
| delayMs | No | delay before the task becomes claimable | |
| payload | Yes | opaque task body the worker reads after claiming (often JSON) | |
| priority | No | higher = claimed sooner (default 0) | |
| dedupeKey | No | collapse duplicate enqueues sharing this key | |
| dependsOn | No | goals system: task ids that must all be `done` before this task is claimable (DAG gate) | |
| maxAttempts | No | re-queue up to N times (default 5) | |
| visibilityTimeoutMs | No | default lease length per claim |