Running

Start the worker in foreground, check status, and handle shutdown.

Start

bash
cueapi-worker start --config cueapi-worker.yaml

The 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 status

Shows whether a worker is running and its PID.

Graceful shutdown

Press Ctrl+C (SIGINT) or send SIGTERM:

  1. Stops accepting new executions
  2. Waits for active handlers to finish
  3. Stops the heartbeat thread
  4. 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.yaml

See Service Installation for launchd/systemd setup.