Starting the Daemon
Managing the Daemon
What the Daemon Does
- Loads jobs from
.fliiq/jobs/*.yaml - Schedules timers for each job based on trigger config (cron, interval, one-shot)
- Executes jobs by spawning fresh
agent_loop()calls with the job’s prompt and skills - Listens for Telegram messages (if
TELEGRAM_BOT_TOKENis set) and email (if Gmail credentials are configured) — all channel listeners use a shared persistent session store so conversation context is preserved across job runs and restarts, for every channel - Exposes health API at
http://localhost:7890/health
Architecture
Each job execution is isolated:- Fresh
agent_loop()call — no shared message history with interactive sessions - Independent — multiple jobs can run simultaneously
- Per-job memory at
.fliiq/memory/jobs/<name>.md - Audit trails saved automatically
fliiq while the daemon runs jobs in the background.
Auto-Restart on Upgrade
When Fliiq is upgraded to a new version (e.g. viapip install --upgrade fliiq), the daemon detects the version change and automatically restarts itself to pick up the new code. No manual intervention needed — the daemon comes back up on the new version without dropping any scheduled jobs.
Retry Behavior
If a job fails (API timeout, LLM error):- Transient retry: 3 attempts with 30s/60s backoff
- Startup retry: If a job’s last run failed and the daemon restarts, the job fires immediately instead of waiting for its next scheduled window
- Failure notifications: If a job exhausts all retries, the daemon sends a Telegram notification automatically (requires
TELEGRAM_BOT_TOKENandTELEGRAM_ALLOWED_CHAT_IDSto be configured)
Health Endpoint
Next Steps
- Creating Jobs — Define scheduled automations
- Triggers — Cron, interval, one-shot, and webhook triggers
- Delivery — Send job results via email, SMS, or Telegram