This step is optional during pilot / initial deployment.KaireonAI ships with manual-only automation out of the box. Alert rules,
notification destinations, report templates, and report schedules can all be
created in the UI and fire end-to-end via Run Now buttons, Export
buttons, and on-demand
/api/cron/tick invocations — no AWS EventBridge
wiring required.Enable this page only when you’re ready to move alerts and scheduled reports
from on-demand to automated background evaluation. Wiring EventBridge turns
the CRON_TOKEN env var into a live tap that fans out LLM narration and
notification delivery every minute, so we recommend delaying this step until
pilot guardrails (per-tenant schedule caps, minimum cadence, LLM spend caps)
are in place. See the roadmap for the guardrail work-stream.What this wires up
The platform’s cron endpoint —POST /api/cron/tick — drives two
subsystems when called:
- Alert rule evaluation — metric threshold checks with notification fan-out (see Alert Rules).
- Report schedule execution — render PDF/CSV, narrate via LLM, deliver to configured destinations (see Report Schedules).
What still works without EventBridge
- Alert rules — defined in
/settings/alerts, stored in the database, and invokable manually by hitting/api/cron/tickwith a validx-cron-token. Rules simply stay dormant until evaluated. - Notification destinations — created and tested via the Test button
in
/settings/integrations → Notifications; fire on demand viaPOST /api/v1/notifications/send. - Report templates — built in
/settings/reports, previewed live, and executed immediately via the Run Now button orPOST /api/v1/reports/templates/[id]/run-now. - Report schedules — can be created and will show a
nextRunAtvalue, but will not fire automatically until this page is wired. Use Run Now in the meantime. - Dashboard Export — every dashboard’s Export dropdown (PDF / CSV / Markdown / HTML) works unconditionally; no cron required.
- Save as Report — creates the
ReportTemplate+ReportSchedulerows immediately; scheduled firing waits on this page.
When to enable
Turn EventBridge on when:- You want alerts to fire without a human triggering the tick.
- You need scheduled reports to arrive on cadence (daily digests, weekly executive summaries).
- Pilot guardrails for LLM / notification spend are in place.
Setup (when you’re ready)
The rest of this page documents the AWS Console setup. Terraform/CDK codification is not part of the initial release — we recommend wiring this manually first so you can verify token rotation and observability before automating.Prerequisites
- KaireonAI deployed with a reachable HTTPS URL (e.g., App Runner URL or custom domain).
- At least one notification destination configured.
- At least one alert rule enabled and referencing that destination, or at least one report schedule.
CRON_TOKENenvironment variable set on the API service to a strong random value (32+ chars). Example:
Step 1 — Store the token in AWS Systems Manager Parameter Store
Keeping the token in Parameter Store lets you rotate without redeploying and lets EventBridge Scheduler reference it via an IAM role.- AWS Console → Systems Manager → Parameter Store → Create parameter.
- Name:
/kaireonai/prod/cron-token(pick a path that matches your env conventions). - Type:
SecureString. - KMS key: default AWS-managed key is fine for most deployments; use a customer-managed KMS key if your security policy requires it.
- Value: paste the 32+ character token.
- Create.
CRON_TOKEN) reads from the same
parameter — either via App Runner’s secret reference or at deploy time.
Step 2 — Create an EventBridge Scheduler IAM role
The schedule needs permission to invoke HTTPS endpoints and read the token from Parameter Store.- IAM → Roles → Create role.
- Trusted entity type:
Custom trust policy. Paste: - Attach an inline policy with the minimum permissions:
Replace
ACCOUNT_ID, region, and the parameter path as needed. - Role name: e.g.,
kaireonai-scheduler-role. - Create.
Step 3 — Create the EventBridge Scheduler
- EventBridge → Scheduler → Schedules → Create schedule.
- Name:
kaireonai-alert-tick. - Schedule pattern:
Recurring schedule. For a once-per-minute cadence:Or use a cron expression likecron(*/5 * * * ? *)for every 5 minutes. - Flexible time window:
Off(keep ticks punctual). - Click Next.
- Target API:
API destinationsis the cleanest option, butHTTPS→Invoke API Destinationrequires a separate connection + destination setup. The simplest path is to useHTTPtarget:- Target type: Universal targets →
API Gateway / HTTP. - URL:
https://your-deployment/api/cron/tick - Method:
POST - HTTP headers:
x-cron-token:<resolve:ssm:/kaireonai/prod/cron-token>Content-Type:application/json
- Request body: empty.
- Target type: Universal targets →
- Execution role: select
kaireonai-scheduler-rolefrom Step 2. - Retry policy: up to 3 attempts, 60s retention is reasonable — the
/api/cron/tickendpoint is idempotent (each tick reads current state) so retries do not cause duplicate fires beyond whatcooldownMinutesalready suppresses. - Dead-letter queue: optional. Useful for spotting systemic failures.
- Create schedule.
Step 4 — Verify
- Wait one minute.
- Check App Runner / CloudWatch logs for the service — you should see an
entry like:
- In the platform UI, open Settings → Alert Rules — the
Last firedcolumn should update when a rule triggers.
Rotating the token
- Generate a new token (
openssl rand -hex 32). - Update the Parameter Store value.
- Update the API service’s
CRON_TOKENenv (App Runner deploy or equivalent). - The next EventBridge invocation after both updates are live uses the new token.
Cadence guidance
Match the tick cadence to the smallestwindowMinutes of your alert rules.
A rule with windowMinutes: 5 can only fire when the tick runs at least
once every 5 minutes; running it every 1 minute gives sub-window
responsiveness without meaningfully changing compute cost (the evaluator
bails quickly when no rule triggers).
| Rule windowMinutes | Recommended tick cadence |
|---|---|
| 1–5 | rate(1 minute) |
| 5–15 | cron(0/5 * * * ? *) (every 5 minutes) |
| 15–60 | cron(0/15 * * * ? *) (every 15 minutes) |
| 60+ | cron(0 * * * ? *) (hourly) |
Troubleshooting
EventBridge shows success but rules never fire — Check CloudWatch logs for401 responses on /api/cron/tick. The most common cause is the
x-cron-token header not being resolved from Parameter Store (the
<resolve:ssm:...> syntax requires the IAM role in Step 2).
Rules fire once then silently stop — cooldownMinutes is preventing
re-fire. Expected behavior. Look for status: cooldown in the tick
response.
Some tenants fail, others succeed — Per-tenant errors are isolated. The
tick response lists failures in the errors array. Debug using the
requestId that appears in the service logs.