Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Salesforce Flow

sf_create_flow
Idempotent

Creates or updates Salesforce Flows via Metadata API, supporting AutoLaunched, Screen, RecordTriggered, and Scheduled flow types with advanced elements like Decision, GetRecords, and Subflow.

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 already indicate a write, idempotent, non-destructive tool; the description aligns by saying 'Creates or updates'. It adds valuable behavior warnings: Contains returns an error, Draft/Screen flows cannot be invoked by agents. No contradictions with annotations.

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 (under 120 words), front-loaded with the main purpose, and structured logically: purpose→supported types/elements→key limitation→critical Agentforce warning. Every sentence carries useful information without redundant restatement of the schema.

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

Completeness4/5

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

For a tool with 19 parameters and nested element definitions, the description covers the highest-risk areas: flow type selection, element support, GetRecords filter restrictions, and Agentforce activation requirements. It does not detail update-replacement semantics or deployment behavior, but the rich schema and annotations cover most of the missing context.

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

Parameters4/5

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

Schema coverage is 100%, so the description does not need to restate parameter definitions. It adds cross-parameter context (e.g., flowType/status combos for Agentforce, unsupported filter operators) that is not obvious from the schema alone, improving the agent's ability to set parameters correctly.

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 opens with 'Creates or updates a Salesforce Flow via the Metadata API', which is a specific verb+resource pairing. It further lists supported flow types and element categories, distinguishing it from more limited sibling tools like sf_create_scheduled_flow or sf_activate_flow.

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?

Provides clear context: defines which flow types are supported, explicitly warns that Contains is not supported for GetRecords, and gives a critical Agentforce requirement (AutoLaunchedFlow + Active). However, it does not name alternatives or explicitly state when to use another tool, so it stops short of full when/when-not guidance.

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