Savings Playbooks // FlowLedger Research
AI Piece Direct API Key Pass-Through vs SaaS AI Markups
Calling LLM endpoints directly from Activepieces avoids both per-task automation fees and per-prompt SaaS AI credit markups.
Measured Unit Economics & Telemetry
Hosted automation suites increasingly bundle proprietary AI steps that charge both task credits and inflated token markups. Inside self-hosted Activepieces, AI pieces and TypeScript fetch steps pass raw JSON straight to your provider API key—including budget high-throughput endpoints like Xiaomi MiMo—while local Redis rate limits prevent runaway retry loops.
| Resource / Billing Line | Audited Value | FinOps Impact |
|---|---|---|
| SaaS AI Task + Wrapper Markup | $0.02 - $0.08 / run | Double-billed per step + AI credit tier |
| Direct API Key in Activepieces | Wholesale token cost | $0 automation platform markup |
| Xiaomi MiMo / OpenAI HTTP Step | Sub-5 MB worker delta | Async I/O bound while awaiting LLM stream |
| Retry Loop Guardrail | Max 2 retries / 60s timeout | Prevents accidental $500 token burn |
Implementation & Configuration Checklist
- Store LLM Keys in Encrypted Connections: Use Activepieces native piece connections or environment secrets rather than hardcoding API keys inside flow JSON.
- Raise AP_WEBHOOK_TIMEOUT_SECONDS for LLMs: Set worker step timeouts cleanly for 30-90s reasoning completions without triggering duplicate BullMQ retries.
- Prune Large Prompt/Response Logs: Set AP_EXECUTION_DATA_RETENTION_DAYS=14 on AI-heavy workflows so 50 KB completions do not bloat Postgres.
AP_EXECUTION_DATA_RETENTION_DAYS=14
AP_FLOW_TIMEOUT_SECONDS=600
LLM_RETRY_MAX=2
Workflow Infrastructure FAQ
Why do LLM steps rarely increase Activepieces worker RAM?
Waiting on an external HTTPS LLM response is asynchronous I/O in Node.js, consuming minimal CPU or heap per concurrent stream.
Can BullMQ retries accidentally double-bill LLM API tokens?
Yes—disable automatic step retries on non-idempotent LLM calls or set explicit HTTP timeout ceilings above model latency.