Automation · Workflows

Workflow Cost Tracking

Automation feels free until the invoices arrive — task fees, API calls, compute per run. Cost tracking makes each run's price visible so you can tune it before it surprises you.

John Kihiu12 min read

Automation platforms and the APIs they call bill by usage — per task, per operation, per API call, per second of compute. Individually tiny, these add up across thousands of runs, and a single inefficient workflow or a runaway loop can dominate a bill without any obvious code change. Cost tracking is making the per-run price a number you can see and attribute.

Attribute cost per run

Total spend tells you there is a cost; per-run and per-step attribution tells you where it comes from. Tag each run with the resources it consumed — platform task count, external API calls, compute time, any metered third-party actions — and price them. Then you can answer the questions that matter: which workflow is most expensive, and is each run's cost proportional to the value it delivers.

Cost sourceTrack
Platform task/step feesSteps executed per run × plan rate
External API callsCall count per provider, priced per their tiers
Compute / execution timeDuration × compute rate
Metered actions (SMS, email, LLM)Units × unit price

Find the expensive steps

Cost is rarely evenly spread. One step — a paid enrichment API, an LLM call, an SMS send — usually dominates, and finding it is where the savings are. A step that runs on every record but only matters for a few can often be gated behind a cheap condition; a paid lookup can frequently be cached. Step-level cost attribution turns "this workflow is expensive" into "this one step is 80% of the cost," which is an actionable target.

Catch runaway loops early

The scariest automation cost is the loop that should not exist — a workflow that triggers itself, a retry with no cap, a fan-out that multiplies. These do not creep; they spike. Alert on cost-per-run anomalies and on total daily spend crossing a threshold, so a runaway pages you the same day instead of showing up as a shocking end-of-month invoice.

Cost and efficiency are the same lens

The step that costs the most is usually also the slowest and the most rate-limited. Optimising for cost — caching a lookup, gating an expensive step, batching calls — almost always improves latency and reliability too. Track cost and you get a prioritised list of what to make faster, for free.

Workflow cost tracking is per-run, per-step attribution across every metered resource, a focus on the one or two steps that dominate, and anomaly alerts that catch runaways before the invoice does. Automation stays cheap only when its cost is visible — otherwise it is a bill that grows quietly until someone asks why.

John Kihiu
Acumatica ERP Developer · Laravel Engineer

Independent software engineer in Nairobi specialising in Acumatica customisations, Laravel backends, and tax fiscalisation integrations across East and Southern Africa.