Docs › AWS Lambda with EventBridge Scheduler with RunVouch
AWS Lambda with EventBridge Scheduler with RunVouch
CloudWatch can alarm on errors and on invocation count, if you build those alarms. It cannot tell a function that returned in 200 ms because a feature flag was off from one that did the work.
How it runs on AWS Lambda + EventBridge Scheduler
Inside the handler, with the two HTTP calls (no binary needed). Python: pip install runvouch into the deployment package and use runvouch.vouch() as a context manager; any language: plain HTTPS.
Store the key
Put the key in Secrets Manager or SSM Parameter Store and read it at cold start, or as an encrypted environment variable on the function.
Report the run (two HTTP calls)
import os, runvouch
runvouch.agent("nightly-report", cadence_s=86400, grace_s=1800, evidence_required=True)
def handler(event, context):
with runvouch.vouch("nightly-report", evidence=lambda: {"s3_object": wrote_object}) as run:
wrote_object = build_report() # your work
run.tool("bedrock.invoke", {"model": "anthropic.claude-3"}, cost=0.02)The start call returns run_id; the end call takes status (ok or fail), optional cost and tokens, and evidence as a JSON object of booleans. Full reference on the API page.
Register the cadence and caps
rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2
Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.
What goes silent on AWS Lambda + EventBridge Scheduler
- A disabled or deleted schedule stops invocations; without a custom alarm on
Invocations == 0nobody notices. MISSED notices. - Timeouts show as errors, but a function that catches everything and returns
{"ok": true}is a success to Lambda. Evidence is what separates the two. - Retries (asynchronous invocation retries twice by default) can triple an LLM bill; the per-run cost cap and retry-storm detector see them as one agent.
What RunVouch detects
| Alert | What it means here |
|---|---|
| MISSED | cadence plus grace passed and no run started |
| FAILED | non-zero exit or a reported failure, with the stderr excerpt |
| NO_EVIDENCE | the run said ok but the file, URL or assertion you required is missing |
| STALLED | a run started and never ended within max runtime |
| RETRY_STORM | the same tool called with identical input many times in one run |
| BUDGET_RUN / BUDGET_DAY | cost cap crossed; the agent is paused until you resume it |
| DRIFT | duration or output size far off its 7-run baseline |
Need a key? Get a free key · Stuck? contact