Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Reports, Analytics & Dashboards

Reports, Analytics & Dashboards

Track AI agent costs and decisions via webhooks and WhatsApp digests

When an API call/webhook arrives, it builds reports with Claude using WhatsApp.

What it does

## AI Agent Execution Ledger Records every tool call, LLM call, decision and error from any agent (or Supervisor workflow). Each event is priced, stored with a sequence number, and rolled into per-run cost / token / error summaries. Budget overruns trigger a one-time WhatsApp alert. A report endpoint + daily digest give cost & activity by agent, tool, model and decision. ### Pipeline POST /agent-ledger-event → Validate & Price → Append to Ledger → (optional) Budget Alert GET /agent-ledger-report → Aggregate report → JSON or WhatsApp digest ### Setup checklist 1. Add WhatsApp Business credentials to both WhatsApp nodes. 2. Edit Ledger Config: run budget, pricing-per-1M-tokens, retention limits, WhatsApp IDs. 3. Edit Report Config: digest window, recent-entry limit, WhatsApp IDs. 4. Activate the workflow (static data only persists on active / production runs). 5. No Anthropic credential is required – this workflow only records data. ### Send events POST /webhook/agent-ledger-event json { "events": [ { "runId": "run-1", "agentName": "researcher", "eventType": "llm_call", "model": "claude-sonnet-4-6", "inputTokens": 1800, "outputTokens": 420, "latencyMs": 2300 }, { "runId": "run-1", "agentName": "researcher", "eventType": "tool_call", "toolName": "web_search", "toolCostUsd": 0.01, "status": "ok" }, { "runId": "run-1", "agentName": "supervisor", "eventType": "decision", "decision": "route:writer", "reasoning": "research done", "confidence": 0.9 } ] } A single event object (without the events array) also works. ### Read the ledger GET /webhook/agent-ledger-report Optional query params: ?runId=, ?agent=, ?since= , ?limit=. ### Hook into a Supervisor workflow After each specialist output / Claude call, add an HTTP Request node that POSTs the agent name, usage tokens and decision to the event webhook.

The steps

  1. Receive Ledger Event
  2. Ledger Config
  3. Validate and Price Events
  4. If Events Are Valid
  5. Respond with Validation Error
  6. Append to Ledger
  7. Respond with Recorded Summary
  8. If Budget Alert Needed
  9. Send Budget Alert via WhatsApp
  10. Receive Report Request
  11. Daily Digest Schedule
  12. Report Config
  13. Build Ledger Report
  14. If Request Came From Webhook

16 steps in total.

Similar automations