Skip to main content
Use a rule to check campaign performance and apply an action on a schedule. For example, pause ads that spend above your limit without a purchase.

Create a rule

  1. Open Rules and select New rule.
  2. Select the ad accounts and target level.
  3. Add a target filter, or choose an empty filter to cover the selected level.
  4. Add a task with at least one action. Add conditions when the action depends on performance.
  5. For each condition, set the metric, timeframe, operator, and comparison value.
  6. Choose a recurring schedule or one exact run time, then set the time zone.
  7. Save as a draft with dry-run mode enabled.
Use Active items only to limit a task to active objects. Turn it off if you need the rule to consider paused objects too. Budget-increase actions require a maximum daily budget; budget-decrease actions require a minimum. Absolute adjustments and rule safety bounds use major account-currency units. Direct creation tools use minor units instead.

Use custom metrics

Select an active custom metric for the Rule’s ad account and target level. Custom metrics use closed account dates. The Rule checks that every required custom value exists before it selects a task. A missing value cannot pass through an OR condition or a fallback task. An explicit zero is a value. An import in progress or a failed import does not stop the Rule. The Rule reads current stored values, which can include some corrections from that import. Check the import task and use dry-run mode when you test a new Rule. See Import custom metrics.

Check a dry run

Run the current rule version with dry_run: true. Review which objects match and which actions the rule would take before allowing live changes.
Draft a rule for this account that pauses active ads when spend exceeds 50 today and purchases are zero. Use dry-run mode, show the target filter and schedule, and wait for me to review before activation.
Your agent should call rules_schema for the rule vocabulary and rules_capabilities for the selected account and level. Recorded event availability does not prove that Meta accepts the event for optimization. It should obtain the account ID and ask for any missing targeting or scheduling choices.

Timed actions and duplication

A task can have an empty top-level condition group when you want a scheduled action without metric checks. Through MCP, use schedule.cron for recurring work or schedule.run_at for one exact time with a UTC offset. Choose one mode and supply an IANA time zone. Duplication rules can copy campaigns, ad sets, or ads. An ad-set rule can use a destination campaign in the same account and creates paused copies. An ad rule requires both destination campaign and ad-set IDs. Check the source level, destination, delivery status, and optional execution limit before activation.

Edit or activate

Read the rule’s current version before changing it. rules_update replaces the definition, so preserve fields you intend to keep. To allow scheduled live changes, set the rule to Active and turn off Dry run. Review both settings before saving. A manual MCP rules_run defaults to dry-run mode.

Apply shared Guardrails

Enabled Guardrails apply when a rule prepares a provider action. A rule can pass its performance conditions and still receive a guardrail denial. Guardrails check the resolved budget owner, current provider facts, policy limits, and trusted rule action source. They also apply during a dry run. Review the decision before a live run.

Review results

Open the run details or use rule_runs_get. Review Activity for decisions and provider actions. rules_delete archives the rule.