
Generating Flow
Generate Salesforce Flow XML (screen, autolaunched, record-triggered, scheduled) through a fixed MCP metadata pipeline when you want declarative automation instead of Apex.
Overview
Generating-flow is an agent skill for the Build phase that generates Salesforce Flow metadata XML through a three-step MCP pipeline for screen, autolaunched, record-triggered, and scheduled automations.
Install
npx skills add https://github.com/forcedotcom/afv-library --skill generating-flowWhat is this skill?
- Only catalog skill for Salesforce Flow generation via MCP execute_metadata_action
- Required 3-step pipeline: fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration
- Covers Screen, Autolaunched, Record-Triggered (before/after-save), and Scheduled flows
- Trigger phrases: record created/updated, daily schedule, email on event, field updates, workflow/flow XML
- Includes Flow metadata specification context for deployment troubleshooting
- Fixed 3-step MCP pipeline: fetchGroundedObjectMetadata → flowElementSelection → flowElementGeneration
- Supports Screen, Autolaunched, Record-Triggered, and Scheduled flow types
Adoption & trust: 1.4k installs on skills.sh; 512 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know the business rule (“when a record is created, update a field and send email”) but lack correct Flow metadata XML and a reliable generation path on Salesforce.
Who is it for?
Salesforce builders automating record lifecycle, scheduled jobs, or guided screen flows who already use MCP against their org.
Skip if: Teams not on Salesforce, one-off Apex-only logic, or requests that only need Apex/LWC without Flow metadata.
When should I use this skill?
User asks to create, build, or generate a Flow; flow-like triggers (“when a record is created”, “trigger daily at”, “send an email when”, “update the field when”, “automate”, “workflow”, or “flow XML/metadata”).
What do I get? / Deliverables
You receive Flow metadata XML produced from grounded org metadata and element selection, ready to review and deploy—or to debug deployment errors against the spec.
- Generated Salesforce Flow metadata XML
- Flow element selection grounded on org metadata
Recommended Skills
Journey fit
Flow metadata is product automation wired into the Salesforce org—canonical placement is Build while you integrate business logic on the platform. The skill targets platform integrations and no-code automation (Flows, triggers, schedules), not generic frontend or PM work.
How it compares
Salesforce Flow generator via MCP metadata actions—not a generic CI workflow or off-platform Zapier-style skill.
Common Questions / FAQ
Who is generating-flow for?
Solo and indie builders (and small Salesforce teams) who automate in Salesforce with Flows and want the agent to emit metadata through the official MCP pipeline instead of guessing XML.
When should I use generating-flow?
Use it during Build integrations when you need Screen, Autolaunched, Record-Triggered, or Scheduled flows; when you say “when a record is created,” “trigger daily,” “send email when,” or ask for flow XML/metadata.
Is generating-flow safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and confirm MCP access to your Salesforce org before running generation against production metadata.
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