Template

Client Usage Guardrails Template Pack — Ledger, 60/80/100 Alerts, Throttle, and Kill‑Switches (Zapier/Make/n8n)

Copy‑ready templates to meter per‑client usage, alert at 60/80/100%, throttle bursty runs, and toggle non‑critical automations on Zapier, Make, and n8n with one‑click re‑enable. Built for solo operators who need cost control without babysitting.

This pack turns the episode’s guardrail system into copy‑ready templates you can deploy per client. Workflow: (1) record usage in the Ledger, (2) auto‑roll up burn vs. budget, (3) trigger Slack at 60/80/100%, (4) auto‑throttle queues, and (5) flip kill‑switches on non‑critical automations with one‑click re‑enable. Make a copy, replace fields in [BRACKETS], and test with a dummy client before going live.

Google Sheets — Usage Ledger (copy‑ready schema)

  • Make a copy of the Google Sheet at [LINK_TO_SHEET_COPY].
  • Use one row per usage event (vendor export, webhook summary, or manual entry). Keep client names consistent.
  • The sheet includes three tabs: Ledger, Budgets, and Rollup+Alerts.

Required columns in Ledger (A→L):

  1. Date → [DATE] (e.g., 2026-04-18)
  2. Client → [CLIENT_NAME]
  3. Source → [SOURCE] (one of: OpenAI, Anthropic, Gemini, Zapier, Make, n8n)
  4. Model/Plan → [MODEL_OR_PLAN] (e.g., gpt-4o, Claude 3 Sonnet, Gemini 3 Pro, Zapier Professional, Make Core)
  5. Metric → [METRIC] (allowed: tokens_in, tokens_out, tasks, credits)
  6. Quantity → [QTY] (number)
  7. Unit → [UNIT] (allowed: tokens, task, credit)
  8. Price In/MTok → [PRICE_IN_USD_PER_MTOK] (for tokens_in)
  9. Price Out/MTok → [PRICE_OUT_USD_PER_MTOK] (for tokens_out)
  10. Task Unit Price → [TASK_UNIT_PRICE_USD] (Zapier per task)
  11. Credit Unit Price → [CREDIT_UNIT_PRICE_USD] (Make per credit)
  12. Est. Cost (USD) → formula

Paste these example formulas in Ledger:

  • Est. Cost (tokens):
    • Input tokens → =IF([@[METRIC]]="tokens_in", [@[QTY]]/1000000*[@[PRICE_IN_USD_PER_MTOK]], )
    • Output tokens → =IF([@[METRIC]]="tokens_out", [@[QTY]]/1000000*[@[PRICE_OUT_USD_PER_MTOK]], )
  • Est. Cost (Zapier tasks): =IF([@[METRIC]]="tasks", [@[QTY]]*[@[TASK_UNIT_PRICE_USD]], )
  • Est. Cost (Make credits): =IF([@[METRIC]]="credits", [@[QTY]]*[@[CREDIT_UNIT_PRICE_USD]], )
  • Combine (final Est. Cost cell): =IFERROR(SUM( {input_cost_cell, output_cost_cell, task_cost_cell, credit_cost_cell} ),0)

Budgets tab columns:

  • Client → [CLIENT_NAME]
  • Source → [SOURCE]
  • Month (YYYY‑MM) → [MONTH] (e.g., 2026-04)
  • Budget (USD) → [BUDGET_USD]
  • Priority → [PRIORITY] (critical or non-critical)
  • Kill‑Switch Armed? → [KILL_SWITCH_ARMED] (TRUE/FALSE)

Rollup+Alerts tab (drives Slack + kill‑switches):

  • Client → query from Budgets
  • Source → query from Budgets
  • Month → query from Budgets
  • Used (USD) → =IFERROR(SUMIFS(Ledger!$L:$L, Ledger!$B:$B, [@Client], Ledger!$C:$C, [@Source], TEXT(Ledger!$A:$A, "yyyy-mm"), [@Month]),0)
  • Budget (USD) → from Budgets
  • % Used → =IFERROR([@[Used (USD)]]/[@[Budget (USD)]],0)
  • Alert Level → =IF([@[% Used]]>=1,"100", IF([@[% Used]]>=0.8,"80", IF([@[% Used]]>=0.6,"60","")))
  • Last Notified → [LAST_NOTIFIED_LEVEL] (manual/automation‑updated)
  • New Alert? → =AND([@[Alert Level]]<>"", [@[Alert Level]]<>[@[Last Notified]])
  • Slack Message → =[@Client]&" / "&[@Source]&": "&TEXT([@[% Used]],"0%")&" of $"&ROUND([@[Budget (USD)]],0)&" (used $"&TEXT([@[Used (USD)]],"0.00")&"). Threshold: "&[@[Alert Level]]&"%."

Price Table (optional tab for lookups):

  • Provider → [PROVIDER] (OpenAI/Anthropic/Gemini/Zapier/Make)
  • Model/Plan → [MODEL_OR_PLAN]
  • Price In/MTok → [USD_IN_MTOK]
  • Price Out/MTok → [USD_OUT_MTOK]
  • Task Unit Price → [USD_PER_TASK]
  • Credit Unit Price → [USD_PER_CREDIT]
  • Last Updated → [YYYY‑MM‑DD]

Tip: Lock data validation lists for [SOURCE] and [METRIC] to prevent drift. Update prices monthly or when vendors change models/features.

Slack 60/80/100% alerts — plug‑and‑play automations

Use either Zapier or Make to watch the Rollup+Alerts tab and post to Slack only when New Alert? is TRUE.

Option A — Zapier recipe:

  1. Trigger: Google Sheets — New or Updated Spreadsheet Row
    • Spreadsheet: [SHEET_NAME], Worksheet: Rollup+Alerts
  2. Filter: New Alert? equals TRUE
  3. Action: Slack — Send Channel Message
    • Channel: #[ALERT_CHANNEL]
    • Message: use the Slack Message field from the sheet
    • Threading: [TRUE|FALSE]
  4. Action: Google Sheets — Update Row
    • Set Last Notified = Alert Level

Option B — Make scenario:

  1. Module: Google Sheets > Watch Rows (sheet: Rollup+Alerts)
  2. Filter: New Alert? == TRUE
  3. Module: Slack > Create a Message
    • Channel: #[ALERT_CHANNEL]
    • Text: map from Slack Message
  4. Module: Google Sheets > Update a Row to set Last Notified

Duplicate suppression: The Last Notified column prevents repeat alerts at the same threshold. Reset it at month‑start with a scheduled automation.

Recommended channels and copy:

  • 60% (info): "[CLIENT]/[SOURCE] hit 60% of $[BUDGET_USD] — keep an eye on burn."
  • 80% (warning): "[CLIENT]/[SOURCE] at 80% — consider throttling non‑critical runs."
  • 100% (action): "[CLIENT]/[SOURCE] reached 100% — kill‑switching non‑critical automations now. Re‑enable link inside."

Make kill‑switch — scenario start/stop (cURL + HTTP module)

Quick cURL you can run from your terminal, a serverless function, or an automation step. Use US/EU base URLs per your Make account.

Placeholders to set:

  • [MAKE_BASE_URL]https://us1.make.com or https://eu1.make.com
  • [MAKE_API_TOKEN] → personal access token with scenarios:write
  • [SCENARIO_ID_LIST_NON_CRITICAL] → comma‑separated IDs

Stop scenarios (kill‑switch OFF):

# Stop a single scenario
curl -X POST "[MAKE_BASE_URL]/api/v2/scenarios/[SCENARIO_ID]/stop" \
  -H "Authorization: Token [MAKE_API_TOKEN]" \
  -H "Content-Type: application/json"

# Stop multiple (bash loop)
for ID in [SCENARIO_ID_LIST_NON_CRITICAL]; do 
  curl -s -X POST "[MAKE_BASE_URL]/api/v2/scenarios/$ID/stop" \
    -H "Authorization: Token [MAKE_API_TOKEN]" -H "Content-Type: application/json"; 
  echo " Stopped $ID"; 
done

Start scenarios (re‑enable ON):

curl -X POST "[MAKE_BASE_URL]/api/v2/scenarios/[SCENARIO_ID]/start" \
  -H "Authorization: Token [MAKE_API_TOKEN]" \
  -H "Content-Type: application/json"

Make HTTP module snippet (inside a Make scenario):

  • Module: HTTP > Make a request
    • Method: POST
    • URL: [MAKE_BASE_URL]/api/v2/scenarios/[SCENARIO_ID]/[start|stop]
    • Headers: Authorization: Token [MAKE_API_TOKEN], Content-Type: application/json
    • Body: leave empty

Tip: Keep the toggler scenario separate from the scenarios it controls. Store [SCENARIO_ID_LIST_NON_CRITICAL] in a Data Store for easy edits. Pair with a Slack confirmation step.

n8n kill‑switch — Activate/Deactivate via built‑in node + template

Use n8n’s native operations instead of guessing endpoints. The built‑in n8n node supports activating/deactivating workflows, and the official template demonstrates scheduling these operations.

Inputs you must set:

  • [N8N_BASE_URL] → e.g., https://automation.yourdomain.com
  • [N8N_API_CREDENTIALS] → API key or Basic Auth with workflow permissions
  • [WORKFLOW_ID_LIST_NON_CRITICAL] → comma‑separated IDs

Template approach (recommended):

  1. Import the official template "Activate and Deactivate workflows on schedule using native n8n API" → [N8N_TEMPLATE_LINK].
  2. Add a trigger that fires when Rollup+Alerts.Alert Level == 100 for Priority == non-critical and Kill‑Switch Armed? == TRUE.
  3. Add an n8n node — Operation: Deactivate Workflow; loop over [WORKFLOW_ID_LIST_NON_CRITICAL].
  4. For re‑enable, add another route triggered by a secure webhook → Operation: Activate Workflow over the same list.

Notes:

  • n8n v2 UI labels are Publish/Unpublish; activation operations remain available via API and the built‑in node.
  • Keep kill‑switch logic in a dedicated workflow to avoid self‑disabling. Confirm with a Slack step.
  • In self‑hosted setups, secure the re‑enable webhook with a token [REENABLE_TOKEN].

Throttle recipes — queue + wait defaults per platform

Throttle to prevent 429s/timeouts before they become failures. Use platform‑native controls; don’t hand‑roll rate limiters unless needed.

Zapier:

  • Add Delay After Queue near the top of bursty Zaps handling webhooks, Tables, or bulk events.
  • Queue Name: [CLIENT_OR_FLOW_QUEUE_NAME] (same name = serialized)
  • Wait between runs (sec): [QUEUE_WAIT_SECONDS] (start with 5–20)
  • Still respect Zapier limits (e.g., Tables ~ 450/min, 150/5s per Zap↔Table). Enable Autoreplay.

n8n:

  • In production, cap concurrency via env var: N8N_CONCURRENCY_PRODUCTION_LIMIT=[SAFE_COUNT].
  • If using Queue Mode, set worker concurrency to [WORKER_COUNT] and add Wait nodes to pace loops.
  • Add a per‑client queue (e.g., a Redis list or keyed limiter) if you combine multiple tenants into one workflow.

Make:

  • Rely on automatic retries with backoff and avoid stacking parallel retries. Keep scenario scheduling conservative.
  • If you process backlogs, space replays with a small Sleep module or chunked Data Store reads.

Rule of thumb: ship throttle first, then scale concurrency only when logs prove headroom.

Price table — centralize unit costs for reliable math

Use this tab (or a separate doc) to centralize unit prices so the Ledger remains copy‑paste simple.

Columns:

  • Provider → [OpenAI|Anthropic|Gemini|Zapier|Make]
  • Model/Plan → [MODEL_OR_PLAN]
  • Price In/MTok → [USD_IN_MTOK]
  • Price Out/MTok → [USD_OUT_MTOK]
  • Task Unit Price → [USD_PER_TASK] (Zapier; derive from plan price or observed overage)
  • Credit Unit Price → [USD_PER_CREDIT] (Make)
  • Last Updated → [YYYY‑MM‑DD]

How to use:

  • Tokens: in Ledger, set [PRICE_IN_USD_PER_MTOK] and [PRICE_OUT_USD_PER_MTOK] by lookup (e.g., =IFERROR(VLOOKUP([@[MODEL_OR_PLAN]], PriceTable!A:G, {col_in,col_out}, FALSE), )).
  • Tasks/Credits: set [TASK_UNIT_PRICE_USD] and [CREDIT_UNIT_PRICE_USD] from this table or the month’s plan math.
  • Review monthly or when vendors announce changes. Feature‑level charges (e.g., grounding/search) can alter effective unit cost — budget accordingly.

Test plan + rollback — dry run this pack safely

Before go‑live, run a safe simulation.

Checklist:

  • Add a test client [TESTCO] with small budgets in Budgets.
  • Insert 3–4 Ledger rows to cross each threshold; confirm Slack fires at 60/80/100 once each.
  • Flip Kill‑Switch Armed? to TRUE for [TESTCO] non‑critical flows and observe:
    • Zapier → targeted Zaps turn OFF; re‑enable link works.
    • Make → targeted scenarios STOP; re‑enable START confirms.
    • n8n → targeted workflows DEACTIVATE; re‑enable ACTIVATE confirms.
  • Verify throttles: introduce a small spike and confirm queues serialize runs without errors.
  • Post‑test: reset Last Notified, clear test rows, return Kill‑Switch Armed? to FALSE.

Risk controls:

  • Never include critical flows in [ZAP_ID_LIST_NON_CRITICAL], [SCENARIO_ID_LIST_NON_CRITICAL], or [WORKFLOW_ID_LIST_NON_CRITICAL].
  • Store re‑enable links in an internal runbook and protect with [REENABLE_TOKEN].
  • Add an owner override: [OWNER_SLACK_ID] gets a DM with a 15‑minute snooze button.