Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Salesforce Flow

sf_create_flow
Idempotent

Create or update Salesforce Flows via Metadata API. Supports AutoLaunched, Screen, RecordTriggered, Scheduled flows and advanced elements such as decisions, record operations, loops, and screens.

Instructions

Creates or updates a Salesforce Flow via the Metadata API. Supports AutoLaunchedFlow (required for Agentforce actions), Screen Flow, RecordTriggeredFlow, and ScheduledFlow. Supports advanced elements: Decision, GetRecords, CreateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen via the 'elements' array. GetRecords filter operators supported: EqualTo, NotEqualTo, GreaterThan, LessThan, GreaterThanOrEqualTo, LessThanOrEqualTo, IsNull, StartsWith, EndsWith. Contains is NOT supported by Salesforce Flow record lookups and will return an error. IMPORTANT for Agentforce: set flowType to 'AutoLaunchedFlow' and status to 'Active' — Draft flows and Screen flows cannot be invoked by agents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesHuman-readable flow label, e.g. 'New Lead Onboarding'
statusNoFlow activation status. IMPORTANT: Agentforce agents can ONLY invoke Active flows — Draft flows are invisible to agents and will cause silent failures. Set to 'Active' when creating flows for agent actions.Draft
apiNameYesAPI name for the flow, e.g. 'New_Lead_Onboarding'
elementsNoAdvanced flow elements: Decision, GetRecords, CreateRecords, UpdateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen. (Wait and PlatformEvent are not supported — they produced invalid XML and were removed.)
flowTypeNoFlow type: 'AutoLaunchedFlow' (required for Agentforce actions — agents can ONLY invoke AutoLaunchedFlow, not Screen flows), 'Flow' (Screen flow for guided UI), 'RecordTriggeredFlow' (fires on record create/update/delete), 'ScheduledFlow' (runs on a schedule).AutoLaunchedFlow
formulasNoFormula resources — recalculated every time they are referenced. Use for derived values instead of an Assignment when the value should always reflect current data.
constantsNoConstant resources — fixed values that never change during the flow run.
variablesNoInput/output variables
descriptionNoDescription of what this flow does
triggerTypeNoWhen to trigger: RecordBeforeSave, RecordAfterSave, RecordBeforeDelete
fieldUpdatesNoSimple field updates on the triggering record (for RecordTriggeredFlow)
textTemplatesNoText template resources — reusable text blocks with merge fields, typically for email bodies.
triggerObjectNoObject API name for record-triggered flows, e.g. 'Opportunity'
recordTriggerTypeNoWhich record changes fire the flow: 'Create' (new records only), 'Update' (edits only), 'CreateAndUpdate' (default), 'Delete'. Ignored for RecordBeforeDelete, which is already delete-only.
scheduleFrequencyNoHow often a ScheduledFlow runs. Defaults to Daily.
scheduleStartDateNoDate a ScheduledFlow starts running, YYYY-MM-DD. Defaults to today.
scheduleStartTimeNoTime of day a ScheduledFlow runs, e.g. '13:00:00.000Z'. Defaults to midnight UTC.
triggerFilterFormulaNoFormula to filter which records trigger the flow, e.g. "ISPICKVAL(StageName,'Closed Won')"
submitForApprovalProcessNameNoAPI name of the Approval Process to automatically submit the record into. Works with any approval process — just pass its API name.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate a write, idempotent, non-destructive tool. The description adds valuable behavioral details: it creates or updates (consistent with idempotentHint), lists supported elements, and explicitly calls out that 'Contains' is not supported and will return an error, plus the Agentforce activation requirement. These go beyond the annotations and aid safe usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, front-loaded with the primary action, and packs significant information (flow types, element list, operator caveat, Agentforce tip) into a few sentences. Every sentence adds value, and there is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 19-parameter tool, the description gives a solid high-level overview but omits key contextual details such as expected return values (no output schema), prerequisites (e.g., Metadata API permissions), and explicit overwrite behavior. It covers major gotchas but leaves some operational gaps for the agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter already has a detailed description. The tool description mostly summarizes the schema (flow types, elements, operators) without adding new parameter-level details. It highlights the Agentforce-critical status and flowType, but these are also in the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb and resource: 'Creates or updates a Salesforce Flow via the Metadata API.' It distinguishes from siblings by listing the supported flow types and advanced elements, unlike simpler focused tools like sf_create_scheduled_flow. The scope is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context for Agentforce (flowType 'AutoLaunchedFlow' and status 'Active') and warns against unsupported 'Contains' operator. However, it does not explicitly name alternative tools for simpler flows (e.g., sf_create_scheduled_flow), so it lacks explicit exclusions but still gives a strong contextual cue.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/semwalajay83-sem/salesforce-metadata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server