Execution history and audit
Last updated: May 19, 2026
Execution history and audit
/rules/:id. Backed by GET /api/v1/rules/:id/executions (verified, paginated). Every cron fire of a rule writes to the automation_rule_execution table with full per-entity outcomes. Audit log entries (action: rule_create / update / delete / toggle / duplicate) live separately in audit_log table. Use both to answer "what did this rule do and when?".
Who is this for
Rule owners auditing what rules actually did. Anyone debugging "why did this campaign get paused yesterday?". Admins on compliance reviews.
How to view
Per-rule execution timeline
Open
/rules/:idScroll to Executions section
Timeline shows fires in reverse-chronological order
Click a fire → expanded view per entity
Per-rule audit log
Same page → Audit tab. Shows lifecycle entries: who created / edited / paused / duplicated the rule and when.
What's in an execution record
automation_rule_execution schema fields:
idrule_idstatus— succeeded / partial_success / failedentities_evaluated— total scannedentities_matched— passed all conditionsentities_acted— action successfully appliedentities_skipped— matched but skipped by a protectionentities_errored— execution failed (API error / validation)details(JSON) — per-entity result maperror_message— top-level failure (e.g. SQS timeout)started_at,completed_at,duration_msmetrics_snapshot(JSON) — the metric values used for evaluation
Reading the details
For each entity in details:
{
"entity_id": "120211211211",
"entity_name": "Adset Prospecting US v3",
"matched": true,
"metric_values": {"roas": 1.2, "spend": 120},
"action_applied": "pause",
"before": {"status": "active"},
"after": {"status": "paused"},
"skipped": false
}
Skipped entries include skip_reason:
cooldown_activedaily_cap_reachedpending_action_existsbudget_cap_reachedentity_state_conflict
Errored entries include error_message + attempt_count.
metrics_snapshot
A JSON object of the metric values seen at evaluation time. Useful when:
Investigating "the dashboard shows ROAS 2.5 now — why did the rule pause the adset?" → check snapshot; rule saw ROAS 0.8 at fire time, late conversions raised it
Debugging condition logic — did the metric actually match?
Audit log entries
audit_log table records each rule lifecycle action:
action | when |
|---|---|
| new rule saved |
| edits to existing rule |
| rule deleted |
| pause ↔ active toggle |
| clone via |
| each successful execution |
Each entry: user_id, metadata (rule_id, change summary), ip_address, user_agent, product, created_at.
Access via /api/v1/audit-logs?resource_type=rule&resource_id={rule_id} or workspace-wide audit view.
Filtering + searching executions
Executions endpoint supports pagination + filters:
from_date/to_datestatus(succeeded / failed / partial)min_entities_acted— only fires that did somethingPagination:
limit(1-100, default 50),offset
Endpoint
GET /api/v1/rules/:id/executions (verified apps/backend/src/routes/api/rules.route.ts).
Returns paginated executions matching filter criteria.
Use cases
Why did this adset pause yesterday?
Open the adset in Ads Manager → see status changed at 14:35
Go to
/rules→ find the rule that matches the adset's scopeOpen
/rules/:id→ executions around 14:30-14:40Find the entity in details → see metric_values + match details
Validate the rule did the right thing (or fix the rule if not)
Did the new template actually act?
After activating a templated rule, check executions over 24h
entities_acted > 0confirms the rule fired actionentities_skippedreasons tell you about protection behavior
Compliance audit (90-day window)
/api/v1/audit-logs?resource_type=rule&from_date=...&to_date=...Returns all rule lifecycle actions in window with user attribution
Export for compliance review
Retention
Execution history retained per workspace plan tier — see /settings/team/billing. Audit log retention typically matches (or exceeds) execution retention.
Common mistakes
Looking at the dashboard instead of metrics_snapshot: dashboard is current; snapshot is what the rule saw. They can differ.
Confusing
entities_matchedwithentities_acted: matched = passed conditions; acted = action actually applied (skip protections aside).Missing audit log permission: audit log access may be admin-only depending on workspace policy.
Related
Notifications — get pushed instead of polling
Troubleshooting — debugging rule behavior
Ads Manager troubleshooting — entity-side investigation