Templates / Track AI agent costs and decisions via webhooks and WhatsApp digests

Track AI agent costs and decisions via webhooks and WhatsApp digests

Ready for 3.0

by Oneclick AI Squad ✓ · 1 views · created 2026-10-01 · Engineering, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 16 nodes and runs when an HTTP POST request hits its webhook URL (plus 2 other triggers). Along the way it connects WhatsApp Business Cloud.

How it runs

Trigger: When an HTTP POST request hits its webhook URL (plus 2 other triggers).

  1. Ledger Config (Edit Fields (Set)): sets 6 fields: runBudgetUsd, maxEntries, maxRuns…
  2. Report Config (Edit Fields (Set)): sets 4 fields: digestWindowHours, recentLimit, whatsappBusinessPhoneId…
  3. Validate and Price Events (Code): runs custom JavaScript code
  4. Build Ledger Report (Code): runs custom JavaScript code
  5. If: checks a condition and branches into true / false
  6. If: checks a condition and branches into true / false
  7. Append to Ledger (Code): runs custom JavaScript code
  8. Respond with Validation Error (Respond to Webhook): sends the response back to the webhook caller
  9. Respond with Ledger Report (Respond to Webhook): sends the response back to the webhook caller
  10. Send Daily Digest via WhatsApp (WhatsApp Business Cloud): send

…plus 3 more steps. See the full node list below.

Services it uses

WhatsApp Business Cloud

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (7)

From the author

Quick overview This workflow exposes webhooks to record AI agent events (LLM calls, tool calls, decisions, and errors), calculates estimated cost from token usage, stores a persistent execution ledger in n8n static data, and sends WhatsApp alerts and daily…

Excerpt from Oneclick AI Squad's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.