Series: Openalice (6/6)

OpenAlice Automation and Heartbeat: Let AI Monitor the Market While You Sleep
Early on with OpenAlice, you're probably using it like this: whenever you want to know something, you go ask it. It answers, you think, and occasionally you have it analyze a position.
That's useful — but there's a problem. You still have to remember to ask.
Markets don't wait. Opportunities appear while you're in a meeting. The Fed makes a statement while you're asleep. NVDA breaks a key resistance level while you're eating. You can't monitor the market 24 hours a day, but you also don't want to miss the moments that actually matter.
That's exactly what OpenAlice's automation layer is built to solve.
Event Log: The Core of All Automation
Before getting into Cron and Heartbeat, there's one foundational design to understand — the append-only event log.
All of OpenAlice's system activity flows through this log: trades, AI messages, scheduled triggers, heartbeat results — all of it as typed events, with real-time subscription support.
This design makes automation clean: each feature is a "listener" on this event bus, and triggers the corresponding behavior when its event type comes in. Different features don't need to know anything about each other — they just listen for the events they care about.
Once you understand this, the logic of Cron, Heartbeat, and Webhook becomes clear — they all work by pushing events into the log under specific conditions, and the AI reads the events and acts on them.
Cron Scheduling: Trigger AI Tasks on a Timer
Cron lets you define time rules and automatically trigger AI tasks at specified times.
Three formats supported:
- Cron expressions — standard cron syntax for precise time control
- Intervals — run every X minutes/hours
- One-time timestamp — trigger once at a specific moment
Practical use cases:
# Pre-market analysis every morning at 9:00 AM
Every day at 9:00 AM, give me a pre-market overview for today's open
# Weekly portfolio review reminder
Every Monday at 8:30 AM, generate a weekly portfolio health report
# Fed decision day reminder
Remind me 1 hour before the Fed announces its rate decision
After a Cron trigger fires, OpenAlice sends an event into the log. The AI reads it and executes the corresponding research or analysis task, then sends the result to your configured channel (Web UI or Telegram).
Heartbeat: The Proactive Market Sentinel
Cron is "timer-based triggering" — it runs at the scheduled time regardless of what the market is doing.
Heartbeat is different — it decides whether to interrupt you based on what the market is actually doing.
Heartbeat is a special Cron job that periodically reviews market conditions, but only proactively notifies you when something "actually worth noting" is happening. What counts as "actually worth noting" — you define that.
Heartbeat workflow:
Periodic trigger (frequency you set, e.g. every 30 minutes)
→ AI reviews market conditions
→ Does anything match the conditions you've set?
→ Yes → notify you (Web UI / Telegram)
→ No → stay silent, don't interrupt
There's a key design detail here: Heartbeat will filter for active trading sessions. You can configure it to only monitor during specific market hours, staying silent when markets are closed — otherwise you'd get a "nothing particularly notable" notification at 3 AM.
What kinds of conditions make sense to put in a Heartbeat?
- A specific instrument breaking above a recent high or below support
- A technical indicator reaching overbought/oversold territory
- A macro indicator (yield curve, VIX) crossing a threshold
- A position drawing down by a certain percentage that warrants attention
- A specific keyword appearing in financial news ("Fed," "earnings miss," "geopolitical")
What Heartbeat solves isn't "making decisions for you" — it's "getting you to the decision at the right moment."
Webhook: External Trigger Integration
Webhooks let external systems push events into OpenAlice — this is a planned feature, but the design concept is worth understanding now.
Use cases include:
- Your TradingView strategy fires a signal, calls a webhook to tell OpenAlice
- An API service returns specific data, pushes an event to OpenAlice
- Another AI Agent finishes an analysis and triggers OpenAlice to execute a trade
This direction positions OpenAlice not just as a standalone tool, but as a node that can connect into a larger AI workflow.
Telegram: Mobile Trade Review Panel
For automated notifications to be useful, the receiving end needs to be convenient — that's why Telegram integration exists.
OpenAlice has a Telegram bot that lets you:
- Receive proactive Heartbeat notifications
- Receive Cron task results
- Check position status
- Review AI-staged orders and decide whether to push execution
The trade review panel on Telegram is especially interesting: the AI has done the analysis in the background, staged an order, attached a commit message — then sends you a Telegram message. You glance at it, tap "Confirm Execution" or "Ignore."
That's it. No need to open a laptop, no need to log into a broker interface — review the AI's recommendation on your phone and decide whether to let it execute.
Designing a Good Automated Workflow
Putting these features together, you can build a genuinely useful workflow:
Pre-market preparation (Cron)
30 minutes before the open every day, automatically run an analysis: key index futures, overnight US market action, any major events today (earnings, Fed speeches, important data). Results go to Telegram — you read through it during your commute and arrive at your desk with direction.
Market monitoring (Heartbeat)
Set a Heartbeat to review your holdings every 30 minutes — only notify on anomalies. Normal market fluctuation doesn't need your attention, but if NVDA suddenly drops 5% in a day, or VIX breaks 30, you get an alert immediately.
Decision execution (Trading-as-Git)
After a Heartbeat triggers a notification, the AI has already staged potential response orders (e.g., adding or reducing a position). You review the explanation on Telegram and decide whether to push.
With these three working together, your market reaction speed is on par with someone watching the screen all day — without actually watching the screen all day.
The Boundaries of Automation
One thing worth saying clearly: the more automation you enable, the more important Guard Pipeline becomes.
The more proactively the AI monitors, and the more automatically it executes, the more you need safety guardrails set in Guard Pipeline — maximum position size, per-order limit, maximum trades in 24 hours, which instruments are whitelisted for auto-execution.
OpenAlice's design encourages gradually expanding automation permissions: run in notification-only mode for a while first, confirm that the AI's judgment aligns with your preferences, then selectively open execution permissions. Don't set it to fully automatic from the start — you're still building your understanding of how it thinks.
This isn't saying OpenAlice can't be trusted — it's saying any automated system needs to be observed before it's trusted.
End of the Series
Five articles later, you should have a clear picture of OpenAlice:
Architecture → Four layers (trading, research, automation, interface), each with a distinct role
Environment setup → Node 22 + pnpm 10 + Claude Code, a five-minute job
Trading design → Trading-as-Git: stage, commit with message, push
Research tools → OpenBB engine, technical indicators, fundamentals, news monitoring
Automation → Cron timer + Heartbeat conditional triggers + Telegram mobile review
From here, it's about working it into your actual workflow — ask it the questions you genuinely care about, set the Heartbeat conditions you actually need, use it to analyze the positions you're actually holding.
Nothing builds your understanding of it faster than real use.
Back to the Series Overview
This is the fifth and final stop in the OpenAlice series, covering automation scheduling, Heartbeat monitoring, and Telegram integration. The full reading map is at OpenAlice Beginner's Course.