Automating ad management with rules — complete guide
Last updated: May 19, 2026
Automating ad management with rules — complete guide
TL;DR: Wevion's Rules Engine = if-then automation. Cron every 15 min evaluates active rules → SQS workers execute actions on matching entities. Verified: 22 conditions + 6 actions + 5 protections (cooldown / max-per-day / budget caps / pending-check / circuit breaker). Use for scale winners, kill losers, frequency caps, alert-only monitoring.
Table of contents
Rules Engine overview
/rules. Each rule: scope (which entities) + conditions (when fire) + actions (what do) + schedule + protections.
Cron every 15 min evaluates rules with status: active + last_evaluated_at < 15 min ago → enqueues to SYNC SQS queue.
Create your first rule
/rules/new → 5-step wizard: scope → conditions → actions → schedule → protections.
Status starts paused. Use Preview before activating.
Available metrics + operators
rul-103 available metrics — 22 metrics verified across categories
rul-104 conditions + operators — 8 operators (gt / lt / gte / lte / eq / neq / between / not_between) + trend operators (extensions)
Time ranges: today / yesterday / last_3d / last_7d / last_14d / last_30d.
Actions + scope
6 verified actions:
pause— pause entityactivate— activate entityincrease_budget_pct/decrease_budget_pct— scale budgetrelaunch(Meta-only) — copy ad with new creativenotify_only— no action, just notification
Scope: ad_account_ids[] + entity_level (campaign / adset / ad) + entity_filter (name_contains / status_in).
rul-107 schedule — interval vs daily_at_time
Platform budget minimums apply (Google $1, TikTok $20-50, others $2).
Protections (cooldown + circuit breaker)
5 verified protections:
cooldown_minutesdefault 360 (6h)max_executions_per_daydefault 3 (max 50)budget_change_limit_pctper-action capbudget_daily_capper-day capCircuit breaker (auto-pause at 50% error rate + 20 errors →
status: error)
Plus exponential backoff on individual failures.
Preview + templates
ALWAYS preview before activating:
POST /api/v1/rules/preview runs rule logic against current data WITHOUT triggering actions. Returns entities_evaluated / matched / skipped (with reasons).
Execution history
/rules/:id → executions tab. Per-fire log with entities counts + per-entity outcomes + metric snapshot.
automation_rule_execution table + ai_action_log for audit.
Best practices
Key recipes:
Scale winners:
roas gt target × 1.2 AND spend gt 50 / last_3d → increase_budget_pct 20, cooldown 720, max 3/dayKill losers:
cpa gt target × 1.5 AND spend gt 50 / last_7d → pauseFrequency cap:
frequency gt 5 / last_7d → pauseDaily spend protection:
daily_budget_pct gt 80 / today → notify_only
Troubleshoot
FAQ
Cooldown vs schedule — what's the difference?
Schedule = how often rule evaluates (every 15 min default). Cooldown = how long after acting on entity X before re-acting on same entity X (default 360 min).
Can a rule act on entities across multiple platforms?
Yes — single rule can have ad_account_ids[] from any platform. Actions apply per-platform (some action types are platform-specific, e.g. relaunch is Meta-only).
What happens at circuit breaker?
Rule's status flips to error. Stops evaluating. Admin reviews last_error + auto_pause_reason + manually re-activates.
Can I create rules with multiple conditions?
Yes. Multi-condition with AND / OR logic. Combine metrics across time ranges.
Templates vs build-from-scratch?
Templates accelerate common patterns. See rul-110 templates for built-in templates (kill_losers, scale_winners, frequency_cap, daily_spend_protection).
Bulk edit rules?
Yes — rul-112 bulk edit rules. Bulk pause/activate, bulk cooldown change, bulk delete.
Cross-platform rules?
Behind ENABLE_CROSS_PLATFORM_RULES env flag. Special template engine for cross-platform conditions.
Next steps
First rule: rul-102 create first rule
Understanding metrics: rul-103 available metrics
Pick a template: rul-110 templates
Best practices: rul-116 rule best practices
Related
am-101 Ads Manager overview — rules act on Ads Manager entities
an-111 ROAS explained — common rule metric