---
title: "set_conditions — AI Ability"
description: "Set conditions — Set conditional-dispatch rules for a webhook+trigger so only matching events leave the site."
url: "https://wpwebhooks.org/docs/ability-set-conditions/"
---

[WP Webhooks](/) / [Docs](/docs/) / set\_conditions

AI Ability since v2.0.0

# set\_conditions

Set conditions — Set conditional-dispatch rules for a webhook+trigger so only matching events leave the site.

Set conditional-dispatch rules for a webhook+trigger so only matching events leave the site. conditions MUST be an object {"enabled":true,"type":"and"|"or","rules":\[{"field":"<dot.path into the captured payload>","operator":"equals|not\_equals|contains|not\_contains|greater\_than|less\_than|is\_empty|is\_not\_empty|is\_true|is\_false|array\_contains|object\_contains","value":"..."}\]}. A rule may add an optional "cast":"number"|"string"|"boolean"|"stringify" to coerce the payload value before comparing (e.g. numeric compare on a string field). A rules item may also be a nested group {"type":"group","match":"and"|"or","rules":\[...\]} (Pro only; without a Pro license only ONE simple rule with type "and" is allowed). Run get\_trigger\_schema first and take field paths from the real captured payload (e.g. "args.0.form\_id"). Registered as the WordPress Ability `flowsystems-webhook-actions/set_conditions`, so external AI tools (Claude Code, Cursor) can call it over MCP or REST with a scoped API token.

/ Plan step shape

```
{ "ability": "set_conditions", "input": { "webhook_id": …, "trigger": …, "conditions": …, "conditions_evaluate_on": … } }
```

/ Scope & confirmation

Minimum API-token scope for external (MCP/REST) callers: `full`. Runs without a confirmation pause (the overall plan is still user-approved before execution starts).

/ Input fields

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| webhook\_id | param | integer | yes |  |
| trigger | param | string | yes |  |
| conditions | param | object | yes |  |
| conditions\_evaluate\_on | param | string | — | original | transformed |

/ Examples

Plan step as the AI Builder proposes it

```
{
  "id": "step_1",
  "ability": "set_conditions",
  "summary": "…",
  "input": {
    "webhook_id": 12,
    "trigger": "wpcf7_mail_sent",
    "conditions": {
      "enabled": true,
      "type": "and",
      "rules": [
        {
          "field": "args.0.form_id",
          "operator": "equals",
          "value": "16",
          "cast": "number"
        }
      ]
    }
  }
}
```

/ Related

[get\_trigger\_schema](/docs/ability-get-trigger-schema/)[Conditional Dispatch](/docs/conditional-dispatch/)[REST API reference](/webhook-wordpress-plugin-api/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"set_conditions — AI Ability — Webhook Actions Docs","description":"Set conditions — Set conditional-dispatch rules for a webhook+trigger so only matching events leave the site.","url":"https://wpwebhooks.org/docs/ability-set-conditions/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
