-
Notifications
You must be signed in to change notification settings - Fork 0
Epic: Queue-based trigger — internal task queue with push API #806
Copy link
Copy link
Closed
5 / 55 of 5 issues completed
Copy link
Labels
Milestone
Description
Summary
Implement an internal task queue system that decouples task producers from consumers. External systems or other workflows push tasks onto named queues via API, and a QueueStrategy consumes them to trigger workflow dispatches. This pattern enables fan-out architectures, priority-based work distribution, and clean producer/consumer separation.
Goals
- Implement a persistent internal task queue with SQLite-backed storage
- Add
POST /queues/{name}/pushAPI endpoint for task submission - Implement
QueueStrategythat consumes tasks from a named queue - Add
Queuevariant toTriggerConfigwith queue name and optional batch size - Support FIFO ordering with optional priority levels
- Wire into the strategy factory, API validation, and CLI
Design Notes
- Queue storage should use the existing SeaORM/SQLite infrastructure in
SchedulerStorage - Tasks in the queue are distinct from
scheduler::Task— they carry a payload that gets converted to aTaskon dequeue - Consider visibility timeout: tasks are invisible to other consumers while being processed, returned to queue on failure
- Queue names are workflow-scoped or globally named (design decision needed)
- The push API should be lightweight — no authentication beyond the standard API middleware
- Batch consumption:
QueueStrategycan dequeue one or more tasks per cycle - Dead letter queue (DLQ) for repeatedly failed tasks — may be deferred to a follow-up
Acceptance Criteria
- Queue table added via SeaORM migration
-
POST /queues/{name}/pushendpoint accepts task payloads -
QueueStrategyimplementsTriggerStrategytrait - FIFO ordering guaranteed
-
Queuevariant added toTriggerConfig - Strategy factory creates
QueueStrategyfrom config - CLI commands for queue inspection (list, peek, purge)
- Unit and integration tests
- Documentation
Blocked By
- Phase 1-5 (Epic: Phase 1 — Introduce TriggerStrategy abstraction #326, Epic: Phase 2 — Cron and Delay triggers #327, Epic: Phase 4 — Webhook trigger #329, Epic: Phase 5 — Manual trigger and API dispatch #330) — all closed, foundation is ready
Stack Base
Stack on: feature/autonomous-pipeline — this epic's issues can be worked in parallel with other Phase 6 epics.
Key Files
crates/orchestrator/src/scheduler/strategy.rs— add QueueStrategycrates/orchestrator/src/scheduler/types.rs— add Queue variantcrates/orchestrator/src/scheduler/runner.rs— wire into create_strategy()crates/orchestrator/src/scheduler/storage.rs— queue table and operationscrates/orchestrator/src/scheduler/api.rs— queue push endpoint
Reactions are currently unavailable