---
template: "page.peb"
title: "deploy_flow — Create an Agent Trigger"
description: "Agent tool reference for creating an approved Salesforce agent trigger."
displayName: "Deploy Flow"
category: "skills"
contentType: "reference"
audience: "agent"
tags: "skills,tools,agents,salesforce,triggers,flow"
section: "support"
seoTitle: "deploy_flow Tool Reference"
seoDescription: "Inputs, approval, restrictions, and results for creating Salesforce agent triggers."
---

Creates the selected agent's initial Salesforce Flow trigger. Supports record changes, platform events, and schedules.
Use it in an authenticated, foreground **Agent Builder** session for the selected agent.
Do not assign this tool to the target business agent. Do not use it in public chat or background execution.
The user needs read and edit access to the agent and its trigger definitions, plus **Manage Flow** permission.
The integration connection also needs permission to create and activate Flows.

## Approval

Reuse supplied configuration. Describe only missing object or field metadata. Ask only for missing material details.
Use `ask_user_choice.bodyMarkdown` for the approval.
Include the label, record changes, conditions, record context, schedule, and Salesforce org time zone.
Include the exact invocation instructions, or state that no additional instructions will apply.
Include the activation choice.
Offer **Create and enable** (`activate: true`), **Create disabled** (`activate: false`), and **Revise**.
Revise requires another review. Do not show raw Flow metadata or internal identifiers in the approval.

## Inputs

The strict schema requires every property below, including every property in the active configuration block.
Use `null` for unused blocks and optional values. Provide exactly one non-null configuration block.

| Input | Value |
| --- | --- |
| `label` | Business name; maximum 80 characters. |
| `type` | `record`, `platformEvent`, or `schedule`. |
| `activate` | Boolean. Set true only after approval to enable. |
| `instructions` | Plain-text invocation instructions; maximum 4,000 characters, or null. |
| `record`, `platformEvent`, `schedule` | The matching configuration object; the other two must be null. |

- **record:** `object`, `event` (`create`, `update`, `createOrUpdate`), `conditions`, `updateMode`, `changedFields`.
  Creation uses null update settings. Updates use `entersCriteria` with nonempty conditions and null changedFields,
  or `fieldsChange` with named changedFields. `fieldsChange` supports update-only. Creation plus field-change updates
  needs two separately approved triggers. Runs with the qualifying record ID.
- **platformEvent:** `object` (API name ending `__e`), `conditions`, `recordIdField`, `contextFields`,
  `contentDocumentIdField`, `contentVersionIdField`, `supportingContentVersionIdField`. Use described event fields.
  Record and document mappings need text or ID fields. Never map event Id or ReplayId as a business or document record.
  A null recordIdField runs without business-record context. Use contextFields for relevant event payload fields.
- **schedule:** `scope` (`agent`, `matchingRecords`), `frequency` (`once`, `daily`, `weekly`), `startDate`
  (`YYYY-MM-DD` or null), `localTime` (`HH:mm`), `object`, `conditions`. Agent scope runs once per occurrence without
  record context; object and conditions must be null. `matchingRecords` needs object and runs for each matching record.
  Uses the Salesforce org timezone. A null startDate selects the next suitable occurrence. Explicit starts must be future.

Use object and field API names. `changedFields` and `contextFields` are arrays of field API names, or null.
`conditions` is null or an object with `match` (`all`, `any`) and nonempty `rules`.
Each rule requires `field`, `operator`, and `value`. Values are strings, numbers, booleans, or null; match the field type.
Operators: `equals`, `notEquals`, `greaterThan`, `greaterOrEqual`, `lessThan`, `lessOrEqual`, `contains`,
`startsWith`, `endsWith`, `isNull`, `isNotNull`. Null-check operators require a null value.

## Example

After schema confirmation and **Create disabled** approval:

```json
{
  "label": "Review closed-won opportunities",
  "type": "record",
  "activate": false,
  "instructions": null,
  "record": {
    "object": "Opportunity",
    "event": "update",
    "conditions": {"match": "all", "rules": [{"field": "StageName", "operator": "equals", "value": "Closed Won"}]},
    "updateMode": "entersCriteria",
    "changedFields": null
  },
  "platformEvent": null,
  "schedule": null
}
```

## Restrictions and results

Agent and tenant identity come from the authenticated session. Do not supply IDs, namespaces, Flow names, native
Flow JSON/XML, or action wiring. Do not use formulas, SOQL, merge expressions, relationship traversal, or custom graphs.
Do not write trigger registration through `dml_sobjects`. This tool does not replace definitions or add Flow versions.
Report only verified results. Failed creation produces no saved trigger. Registration failure can leave a disabled
Flow without a Studio entry. Activation failure can leave a registered disabled trigger. Follow returned recovery
instructions for uncertain outcomes. Retry only the same parameters when instructed; do not change them to bypass errors.
After success, use **Triggers** for Refresh, Enable/Disable, Open Flow, and Remove. Use only a verified Flow link.
Remove deactivates and unregisters the trigger. It retains the Flow in Salesforce.
For the Admin workflow, see [Manage Agent Triggers](/support/agentBuilder/agent-triggers.html).
