Set Plan Trigger
set_plan_triggerMake a plan fire on its own when something changes in the CRM, change such a trigger, or remove it. A trigger watches one object (account, contact, lead, opportunity, case or user) for one kind of change: 'enters' (a record now matches filter_spec, a filter in the shape runs use, and did not before, e.g. an opportunity whose stage becomes Closed Won), 'changes' (any change to the named fields), or 'created' (a record the CRM creates from now on, optionally matching filter_spec). Changes LiveCRM itself makes do not fire it unless fire_on_livecrm is true. With scope_mode 'matched' (the default) each firing runs the plan's runs on just the records that changed, or the accounts, contacts or opportunities linked to them; 'plan' fires the plan as it stands. Changes are gathered for batch_window_seconds (default 0: it fires on the first change) into one firing of at most max_records records (default 500), at most max_firings_per_day times a day (default 48). ONCE SET, EVERY FIRING RUNS WITH NOBODY CONFIRMING IT, so read the plan with get_plan first. Setting a trigger needs every permission the plan's steps call, and each firing runs with your permissions as they stand when it fires. Only an active plan takes a trigger. action 'update' replaces the whole definition of trigger_id; 'remove' deletes it. get_plan lists a plan's triggers.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"plan_id": "<plan_id>",
"connection_id": "<connection_id>"
},
"name": "set_plan_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | What it watches for. Required for add and update. | |
| name | No | What a person calls it. | |
| state | No | inactive keeps the trigger without firing it. Default active. | |
| action | No | add (default), update or remove. | |
| fields | No | For 'changes': the fields to watch, by their filterable names. | |
| plan_id | Yes | The plan the trigger fires. | |
| scope_mode | No | matched (default): the changed records; plan: the plan as it stands; slice: on the Subscription plan's account triggers only, each account becomes a Subscription run for its missing personas. | |
| trigger_id | No | The trigger to update or remove. | |
| filter_spec | No | For 'enters' (required) and 'created' (optional): a filter over object_type, as runs take. Call list_filterable_fields first. | |
| max_records | No | 1 to 10000. Default 500. | |
| object_type | No | The object it watches. Required for add and update. | |
| connection_id | Yes | The CRM connection. Call list_crm_connections first. | |
| fire_on_livecrm | No | Fire on changes LiveCRM itself makes too. Default false. | |
| match_ttl_hours | No | 1 to 720. How long a caught record waits before it expires. Default 168. | |
| max_firings_per_day | No | 1 to 1440. Default 48. | |
| batch_window_seconds | No | 0 to 86400. Default 0, which fires on the first change. |