Running
Start the worker in foreground, check status, and handle shutdown.
Start
bash
cueapi-worker start --config cueapi-worker.yamlThe worker runs in the foreground and logs to stdout:
[2026-03-13 09:00:00] Starting CueAPI Worker (my-laptop)
[2026-03-13 09:00:00] Handlers: draft-linkedin, sync-data
[2026-03-13 09:00:00] Heartbeat registered
[2026-03-13 09:00:05] Polling for claimable executions...
[2026-03-13 09:00:05] Claimed execution 550e8400... (task: draft-linkedin)
[2026-03-13 09:00:08] Execution 550e8400... completed (success, 3.2s)
Check status
bash
cueapi-worker statusShows whether a worker is running and its PID.
Graceful shutdown
Press Ctrl+C (SIGINT) or send SIGTERM:
- Stops accepting new executions
- Waits for active handlers to finish
- Stops the heartbeat thread
- Exits cleanly
^C
[2026-03-13 10:00:00] Shutdown requested, waiting for 1 active handler(s)...
[2026-03-13 10:00:02] All handlers finished. Shutting down.
Background execution
For long-running deployment, use a process manager or install as a service:
bash
# Simple background
nohup cueapi-worker start --config cueapi-worker.yaml &
# Or install as a system service (recommended)
cueapi-worker install-service --config /path/to/cueapi-worker.yamlSee Service Installation for launchd/systemd setup.