Help us improve
Share bugs, ideas, or general feedback.
From sf-skills
Generates Salesforce Flow metadata (Screen, Autolaunched, Record-Triggered, Scheduled) via a 3-step MCP pipeline. Use for automating business processes, building workflows, or generating flow XML.
npx claudepluginhub ccmalcom/sf-skills-plugin --plugin sf-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/sf-skills:generating-flowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate Salesforce Flow metadata by running the required 3-step MCP pipeline (fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration) and return the flow XML.
Builds Salesforce Lightning Experience apps from natural language by generating all required metadata types (objects, fields, pages, tabs, security) in dependency order.
Builds, scaffolds, deploys, and tests Power Automate cloud flows via FlowStudio MCP server without the portal. Useful for creating flow definitions, wiring connections, updating actions, or generating workflows from scratch.
Outlines best practices for Salesforce Flow Orchestrator (2025) to build multi-user, multi-stage workflows with approvals, fault paths, and no-code automation.
Share bugs, ideas, or general feedback.
Generate Salesforce Flow metadata by running the required 3-step MCP pipeline (fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration) and return the flow XML.
Use this skill when you need to:
Salesforce Flows are powerful automation tools that enable complex business process automation without code. Flows can collect and process data through interactive screens, execute logic and calculations, manipulate records, call external services, and trigger based on various events. Flow types include Screen Flows (user-guided), Autolaunched Flows (background processing), Record-Triggered Flows (database events) and Scheduled Flows (time-based).
MANDATORY: You MUST follow this exact 3-step pipeline. No exceptions. No shortcuts. No skipping steps. Do NOT manually create flow metadata XML or attempt to generate flow metadata outside of this pipeline. Do NOT attempt to use any other tool, API, or method to generate flow metadata. This pipeline is the ONLY supported way to generate flows. Any deviation will produce invalid or broken metadata.
All 3 pipeline steps MUST be called using this MCP tool:
execute_metadata_actionaction parameter selects which pipeline step to run: "fetchGroundedObjectMetadata", "flowElementSelection", or "flowElementGeneration"Flow generation is a strict 3-step pipeline. ALL steps must be called in order. Every step is required. There is no alternative approach — this is the only way to generate flow metadata:
fetchGroundedObjectMetadata)Fetches org schema metadata relevant to the flow generation request. This step is mandatory and must always be called first.
Inputs (all required):
[] if none needed.Outputs:
flowElementSelection)Selects flow elements (assignments, decisions, record ops, etc.) and their connections based on the user prompt and grounded metadata. This step is mandatory and must be called after Step 1.
Inputs (all required):
"" for first call)Outputs:
flowElementGeneration)Generates flow metadata element by element. This step is mandatory and must be called after Step 2. Must be called repeatedly in a loop until isComplete is true.
Inputs (all required):
"A4V" to get flow metadata in XML format.Outputs:
isComplete is true.MANDATORY: Loop until complete. NEVER pause or ask the user to confirm continuation.
flowElementGeneration with the operationId from Step 2 and requestSource (use "A4V" for XML output, empty string or other value for JSON).isComplete output and the result field after each call.isComplete is false and no errors are returned, you MUST call flowElementGeneration again with the same operationId from Step 2. Do NOT ask the user if they want to continue. Do NOT pause. Do NOT summarize progress mid-loop. Just keep calling.isComplete is true or the invocable action returns errors. There is no maximum number of iterations — keep going regardless of how many calls it takes.isComplete is true, extract the flow metadata from the result field.STRICT CONSTRAINTS (CRITICAL) — These rules apply to the XML returned by the generation pipeline:
DATA TYPE: ARRAY (not string)
STRICT NAMING CONVENTION - MUST FOLLOW EXACTLY:
| Property | Correct Name | Do NOT Use |
|---|---|---|
| Object API name | apiName | objectApiName, name, objectName |
| Field API name | apiName | fieldApiName, name, fieldName |
| Field type | type | fieldType, dataType |
| Lookup target | referenceTo | relatedTo, lookupTo, reference |
When custom objects are needed (sample format showing multiple field data types):
[
{
"type": "CustomObject",
"apiName": "CustomerRequest__c",
"label": "Customer Request",
"fields": [
{
"apiName": "Status__c",
"type": "Picklist",
"label": "Status",
"values": ["New", "In Progress", "Completed"]
},
{
"apiName": "Priority__c",
"type": "Number",
"label": "Priority"
},
{
"apiName": "AssignedTo__c",
"type": "Lookup",
"label": "Assigned To",
"referenceTo": "User"
},
{
"apiName": "Description__c",
"type": "Textarea",
"label": "Description"
},
{
"apiName": "Email__c",
"type": "Email",
"label": "Contact Email"
},
{
"apiName": "DueDate__c",
"type": "Date",
"label": "Due Date"
},
{
"apiName": "IsUrgent__c",
"type": "Boolean",
"label": "Is Urgent"
},
{
"apiName": "Amount__c",
"type": "Currency",
"label": "Amount"
}
],
"relationships": []
}
]
Supported field types: Text, Textarea, Number, Picklist, Lookup, Email, Phone, URL, Date, Datetime, Boolean, Checkbox, Currency, Percent
When no custom objects needed:
[]
[] (NOT the string "[]")Instructions for Vibes when custom objects ARE relevant:
apiName: The object's API name (with __c suffix for custom objects)label: The object's display labeltype: Set to "CustomObject"fields: Array of field objects, each containing:
apiName: The field's API name (with __c suffix for custom fields)type: The field type (Text, Number, Picklist, Lookup, etc.)label: The field's display labelvalues: (Picklist only) Array of picklist valuesreferenceTo: (Lookup only) The target object API nameuserPrompt for each individual flow. Each userPrompt must describe only ONE flow. Do NOT pass the entire multi-flow request as a single userPrompt. See the multiple flows section below for examples.[] (empty array) when no custom objects needed"[]" - this is incorrectFIRST: Before calling any pipeline step, check if the user's request contains multiple flows. If it does, you MUST split it into separate single-flow prompts. Each flow gets its own 3-step pipeline with its own userPrompt that describes ONLY that one flow.
NEVER pass a multi-flow request as a single userPrompt field. NEVER club multiple flow descriptions into one userPrompt.
When the user requests multiple flows (e.g., "Create flows for my app: 1) ... 2) ... 3) ..."), you MUST:
userPrompt that describes ONLY that one flow.WRONG - Multiple flows clubbed into one userPrompt:
{
"userPrompt": "Create flows for the app: 1) Record-Triggered Flow on ResourceAllocation__c to update Resource__c. 2) Screen Flow to allocate resources. 3) Record-Triggered Flow on Supply__c to auto-flag Low_Stock__c.",
...
}
CORRECT - Separate call for EACH flow:
Flow 1 - Step 1 (fetchGroundedObjectMetadata):
{
"userPrompt": "Create a Screen Flow named Tenant_Onboarding that captures tenant details, selects a Unit__c with Status__c = 'Vacant', creates Lease__c...",
"inflightMetadata": [...]
}
Then call Step 2 (flowElementSelection) with the groundingMetadata from Step 1, then Step 3 (flowElementGeneration) with the operationId from Step 2.
Flow 2 - Step 1 (fetchGroundedObjectMetadata):
{
"userPrompt": "Create an Autolaunched Flow named Generate_Onboarding_Checklist that given a Lease__c Id input, queries OnboardingTask__c...",
"inflightMetadata": [...]
}
Then call Step 2 and Step 3 for this flow.
Flow 3 - Step 1 (fetchGroundedObjectMetadata):
{
"userPrompt": "Create a Record-Triggered Flow named Sync_Unit_On_Lease_Changes that on insert and update of Lease__c...",
"inflightMetadata": [...]
}
Then call Step 2 and Step 3 for this flow.
Mandatory Rules:
isComplete is true or errors are returned) BEFORE starting the next flow's pipeline. Do NOT interleave or parallelize pipelines across flows. Everything is SEQUENTIAL — NEVER parallel.inflightMetadata with custom objects/fields specific to that flow prompt.inflightMetadata containing only the objects/fields relevant to that particular flow.Example 1: Standard objects only (no custom objects)
Step 1 - fetchGroundedObjectMetadata:
{
"userPrompt": "Create a scheduled-triggered Flow named Daily_Good_Morning that runs daily at 6:00 AM and sends an email to the running user saying good morning.",
"inflightMetadata": []
}
Step 2 - flowElementSelection:
{
"userPrompt": "Create a scheduled-triggered Flow named Daily_Good_Morning that runs daily at 6:00 AM and sends an email to the running user saying good morning.",
"groundingMetadata": "<groundingMetadata string from Step 1 — pass directly, do not serialize again>",
"operationId": ""
}
Step 3 - flowElementGeneration (call in a loop):
{
"operationId": "<operationId from Step 2>",
"requestSource": "A4V"
}
Call repeatedly with the same operationId until isComplete is true or errors are returned. A flow can have any number of elements, so expect multiple iterations. When isComplete is true, extract the flow metadata from the result field. Use "requestSource": "A4V" to get flow metadata in XML format.
Example 2: With custom objects from local sfdx project
Step 1 - fetchGroundedObjectMetadata:
{
"userPrompt": "Create a flow that updates the status of a Customer Request when it's assigned",
"inflightMetadata": [
{
"type": "CustomObject",
"apiName": "CustomerRequest__c",
"label": "Customer Request",
"fields": [
{
"apiName": "Status__c",
"type": "Picklist",
"label": "Status",
"values": ["New", "In Progress", "Completed"]
},
{
"apiName": "AssignedTo__c",
"type": "Lookup",
"label": "Assigned To",
"referenceTo": "User"
}
],
"relationships": []
}
]
}
Step 2 - flowElementSelection:
{
"userPrompt": "Create a flow that updates the status of a Customer Request when it's assigned",
"groundingMetadata": "<groundingMetadata string from Step 1 — pass directly, do not serialize again>",
"operationId": ""
}
Step 3 - flowElementGeneration (call in a loop):
{
"operationId": "<operationId from Step 2>",
"requestSource": "A4V"
}
Call repeatedly with the same operationId until isComplete is true or errors are returned. A flow can have any number of elements, so expect multiple iterations. When isComplete is true, extract the flow metadata from the result field. Use "requestSource": "A4V" to get flow metadata in XML format.
userPrompt.userPrompt, NOT in inflightMetadata.inflightMetadata is ONLY for custom object/field metadata from local project (see above). No exceptions.operationId from Step 2 until isComplete is true or errors are returned. A flow can have any number of elements — do NOT stop early, do NOT pause to ask the user if they want to continue, regardless of how many iterations it takes.result field when isComplete is true.Failure to follow this checklist exactly will result in broken or missing flow metadata.
userPrompt describing only one flow[] when no custom objects needed"[]" (string) - must be [] (array)"A4V" alwaysoperationId from Step 2 until isComplete is true or errors are returned — no pausing, no asking the user to continue, no matter how many iterationsisComplete is true<label>, <description>, or any other node). The final XML must be identical to what the pipeline returned.