agent-task-queue

Build and operate a multi-agent task queue in OpenClaw with priority queues, delayed/dead-letter queues, scheduling, retry/timeout control, dependency management, parallel execution, and execution tracking using the bundled TypeScript runtime.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "agent-task-queue" with this command: npx skills add imgolye/agent-task-queue

Agent Task Queue

Use this skill when a task needs queue-based orchestration for multiple agents or workers. The bundled runtime is in src/ and covers:

  • Priority queue, delayed queue, and dead-letter queue behavior
  • Scheduler polling with concurrency limits, retries, and timeouts
  • Dependency validation, dependency gating, and result propagation
  • Task logs and aggregate metrics
  • Pluggable storage through in-memory, SQLite, or Redis backends

Workflow

  1. Import TaskQueue and Scheduler from src/index.ts.
  2. Pick storage:
    • Default InMemoryStorage for local execution or tests
    • SQLiteStorage for single-node persistence
    • RedisStorage for distributed workers
  3. Register handlers with scheduler.register(taskType, handler).
  4. Enqueue tasks with priority, runAt, dependencies, retryPolicy, and timeoutMs as needed.
  5. Drive execution via scheduler.tick() or scheduler.start().
  6. Inspect queue.logs(), queue.metrics(), queue.getSnapshot(), and queue.get(taskId) for state and traceability.

Key Files

  • src/TaskQueue.ts: queue lifecycle, ready/dead-letter snapshots, logs, metrics
  • src/Scheduler.ts: polling loop, concurrency control, retries, timeout handling
  • src/DependencyManager.ts: DAG validation and dependency result propagation
  • src/storage/: storage implementations
  • tests/task-queue.test.ts: behavior coverage
  • examples/basic.ts: end-to-end usage

Implementation Notes

  • Dependency tasks must already exist when a dependent task is enqueued.
  • A task becomes runnable only after all dependencies are completed.
  • Completed dependency results are stored and exposed to downstream handlers through context.dependencies.
  • When retries are exhausted, the task is moved to dead_letter.
  • Timeout cancellation uses AbortSignal; long-running handlers should watch context.signal.

Validation

Run:

npm run check

If Redis or SQLite packages are unavailable in the environment, install dependencies first with npm install.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Ai Automation Consulting

AI 自动化咨询服务 - 帮你用 AI 省时省钱。适合:中小企业、自由职业者、想提效的人。

Registry SourceRecently Updated
Automation

myskill

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express...

Registry SourceRecently Updated
Automation

GridClash

Battle in Grid Clash - join 8-agent grid battles. Fetch equipment data to choose the best weapon, armor, and tier. Use when user wants to participate in Grid...

Registry SourceRecently Updated