
Generating Flow
Generate Salesforce Flow XML through a fixed three-step MCP metadata pipeline when you need record-triggered, screen, scheduled, or autolaunched automation without Apex.
Overview
Generating-flow is an agent skill for the Build phase that produces Salesforce Flow metadata XML through a three-step MCP pipeline (fetchGroundedObjectMetadata, flowElementSelection, flowElementGeneration).
Install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-flowWhat is this skill?
- Single skill path for all Flow types: Screen, Autolaunched, Record-Triggered (before/after save), and Scheduled
- Mandatory 3-step MCP pipeline: fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration
- Triggers on natural language patterns like “when a record is created,” “trigger daily at,” and “automate this workflow”
- Returns deployable Flow metadata XML aligned with Salesforce Flow specification
- Covers troubleshooting guidance for Flow-related deployment errors
- 3-step MCP pipeline: fetchGroundedObjectMetadata, flowElementSelection, flowElementGeneration
Adoption & trust: 758 installs on skills.sh; 513 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need Salesforce automation (record triggers, screens, schedules) but hand-authored Flow XML or Builder sessions are slow and error-prone for an AI coding agent.
Who is it for?
Builders extending a Salesforce-backed SaaS who already have MCP wired to their org and want repeatable Flow generation from conversational requirements.
Skip if: Teams without Salesforce MCP access, pure Apex/LWC feature work, or orgs where automation policy forbids agent-generated metadata without human Flow Builder review.
When should I use this skill?
User asks to create, build, or generate a Flow; or describes flow-like automation (record created, daily schedule, email when, update field when, workflow, flow XML/metadata).
What do I get? / Deliverables
After the skill runs, you receive grounded Flow metadata XML ready to deploy, with object and element choices aligned to the MCP generation steps.
- Salesforce Flow metadata XML
- Element selection grounded on org object metadata
Recommended Skills
Journey fit
Flow generation is integration work that ships automation into a Salesforce org during product build, not launch or growth tooling. Salesforce Flows connect CRM events, email, and record updates to your app—classic build-phase integrations against a live platform.
How it compares
Use this structured MCP pipeline instead of asking the agent to invent Flow XML from memory or generic CRM snippets.
Common Questions / FAQ
Who is generating-flow for?
Solo and indie builders shipping on Salesforce who use agent tools with execute_metadata_action and need Flow metadata, not one-off Apex scripts.
When should I use generating-flow?
During Build integrations when you must create Screen, Autolaunched, Record-Triggered, or Scheduled flows, or when prompts mention automating on record create, daily schedules, or email-on-event patterns.
Is generating-flow safe to install?
Review the Security Audits panel on this Prism page and your org’s change-management rules before letting an agent push Flow metadata to production.
SKILL.md
READMESKILL.md - Generating Flow
## Goal Generate Salesforce Flow metadata by running the required 3-step MCP pipeline (fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration) and return the flow XML. ## When to Use This Skill Use this skill when you need to: - Create any type of Flow (Screen, Autolaunched, Record-Triggered, Scheduled) - Generate Flow metadata XML - Automate business processes without code - Build user-guided workflows or background automation - Troubleshoot deployment errors related to Flows ## Specification # Flow Metadata Specification ## Overview 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). ## Purpose - Automate complex business processes with declarative logic and branching - Guide users through multi-step data collection and decision workflows via Screen Flows - Perform CRUD operations on Salesforce records automatically - Execute background processing and integrations via Autolaunched Flows - React to record changes in real-time with Record-Triggered Flows - Schedule recurring tasks and batch operations with Scheduled Flows - Create reusable, maintainable automation that admins can modify without code ## Flow Generation Pipeline **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.** ### MCP Connection Details **All 3 pipeline steps MUST be called using this MCP tool:** - **MCP Tool Name:** `execute_metadata_action` - **The `action` 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:** ### Step 1 (REQUIRED): Fetch Grounded Object 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):** - **userPrompt** (STRING, REQUIRED): The user's natural language request - **inflightMetadata** (ARRAY, REQUIRED): Custom objects/fields from local sfdx project. Use empty array `[]` if none needed. **Outputs:** - **groundingMetadata** (STRING): Grounded object metadata for org schema relevant to the request, returned as a JSON string. **You must pass this directly to Step 2 — it is already a string and does not need to be serialized again.** ### Step 2 (REQUIRED): Flow Element Selection (`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):** - **u