Skip to content

Event Service

The event service is an asyncio-based pub/sub runtime for agent workflows.

What It Does

  • Listens to Telegram bot updates (long polling)
  • Emits cron-style interval events
  • Projects source-specific events into normalized workflow.request events
  • Writes events to stdout and/or JSONL for traceability

Event Flow

  1. Source emits event (telegram.message, cron.tick)
  2. Event bus routes by wildcard patterns
  3. Projectors transform source events into workflow.request
  4. Sinks write events to stdout and/or JSONL

Running

Cron only:

bof service run --cron market_scan=15m

Telegram + cron:

bof service run --telegram --cron watchlist_refresh=30m

With audit log:

bof service run --telegram --cron watchlist_refresh=30m --event-log logs/events.jsonl

Options

Flag Description
--telegram / --no-telegram Enable Telegram polling
--telegram-token Bot token (falls back to TELEGRAM_BOT_TOKEN)
--telegram-poll-timeout Poll timeout in seconds
--cron NAME=INTERVAL Repeatable cron spec (e.g. brief=30m)
--event-log <path> JSONL trace output path
--quiet Disable stdout event stream

Full help:

bof service run --help