Agent skill

sf-flow

Creates and validates Salesforce Flows with 110-point scoring. TRIGGER when: user builds or edits record-triggered, screen, autolaunched, or scheduled flows, or touches .flow-meta.xml files. DO NOT TRIGGER when: Apex automation (use sf-apex), process builder migration questions only, or non-Flow declarative config (use sf-metadata).

Stars 252
Forks 63

Install this agent skill to your Project

npx add-skill https://github.com/Jaganpro/sf-skills/tree/main/skills/sf-flow

Metadata

Additional technical details for this skill

author
Jag Valaiyapathy
scoring
110 points across 6 categories
version
2.1.0

SKILL.md

sf-flow: Salesforce Flow Creation and Validation

Use this skill when the user needs Flow design or Flow XML work: record-triggered, screen, autolaunched, scheduled, or platform-event Flows, including validation, architecture choices, and safe deployment sequencing.

When This Skill Owns the Task

Use sf-flow when the work involves:

  • .flow-meta.xml files
  • Flow Builder architecture and XML generation
  • record-triggered, screen, scheduled, autolaunched, or platform-event flows
  • Flow-specific bulk safety, fault paths, and subflow orchestration

Delegate elsewhere when the user is:

  • writing Apex-first automation → sf-apex
  • creating objects / fields first → sf-metadata
  • deploying metadata → sf-deploy
  • seeding post-deploy test data → sf-data

Required Context to Gather First

Ask for or infer:

  • flow type
  • trigger object / entry conditions
  • core business goal
  • whether this is new, refactor, or repair
  • target org alias if deployment or validation is needed
  • whether related objects / fields already exist

Recommended Workflow

1. Choose the right automation tool

Before building, confirm Flow is the right answer rather than:

  • formula field
  • validation rule
  • roll-up summary
  • Apex

2. Choose the right Flow type

Need Default flow type
same-record update before save before-save record-triggered
related-record work / emails / callouts after-save record-triggered
guided UI screen flow
reusable background logic autolaunched / subflow
scheduled processing scheduled flow
event-driven declarative response platform-event flow
AI-evaluated routing (sentiment, intent, tone) autolaunched with AI Decision element

3. Start from a template

Prefer the provided assets:

  • assets/record-triggered-before-save.xml
  • assets/record-triggered-after-save.xml
  • assets/screen-flow-template.xml
  • assets/autolaunched-flow-template.xml
  • assets/scheduled-flow-template.xml
  • assets/platform-event-flow-template.xml
  • assets/ai-decision-template.xml
  • assets/subflows/

4. Validate against Flow guardrails

Focus on:

  • no DML in loops
  • no Get Records inside loops
  • proper fault paths
  • correct trigger conditions
  • safe subflow composition
  • AI Decision elements not placed inside loops (credit cost per iteration)
  • AI Decision prompts include merge field references for data context

5. Hand off deployment and testing

Use:

  • sf-deploy for deploy / dry-run
  • sf-data for high-volume test data

High-Signal Rules

Flow architecture

  • before-save for same-record field updates
  • after-save for related records, emails, and callouts
  • do not loop over $Record
  • use subflows when logic becomes wide or repetitive

Bulk safety

  • no DML in loops
  • no Get Records in loops
  • test with 251+ records when bulk behavior matters
  • prefer Transform when the job is shaping data, not per-record branching

Error handling

  • every data-changing path should have fault handling
  • avoid self-referencing fault connectors
  • deploy Flows as Draft first when activation risk is non-trivial

Output Format

When finishing, report in this order:

  1. Flow type and goal
  2. Files created or updated
  3. Architecture choices
  4. Bulk/error-handling notes
  5. Deploy/testing next steps

Suggested shape:

text
Flow: <name>
Type: <flow type>
Files: <paths>
Design: <trigger choice, subflows, key decisions>
Risks: <bulk safety, fault paths, dependencies>
Next step: <dry-run deploy, activate, or test>

Flow Testing (CLI)

Run Flow tests from the command line without VS Code:

bash
# Run all flow tests
sf flow run test --target-org <alias> --json

# Run tests for a specific flow
sf flow run test --class-names MyFlow --target-org <alias> --json

# Get results for an asynchronous run
sf flow get test --test-run-id <id> --target-org <alias> --json

Flow tests execute in the org and can take 1-5 minutes. sf flow run test returns a test run ID for asynchronous runs; use sf flow get test to retrieve results later. Always run with --json and use background execution for longer runs.


Cross-Skill Integration

Need Delegate to Reason
create objects / fields first sf-metadata schema readiness
deploy / activate flow sf-deploy safe deployment sequence
create realistic bulk test data sf-data post-deploy verification
create Apex actions / invocables sf-apex imperative logic
embed LWC in a screen flow sf-lwc custom UI components
expose Flow to Agentforce sf-ai-agentscript agent action orchestration

Reference Map

Start here

  • references/flow-best-practices.md
  • references/flow-quick-reference.md
  • references/orchestration.md
  • references/testing-guide.md

Design / orchestration

  • references/subflow-library.md
  • references/governance-checklist.md
  • references/transform-vs-loop-guide.md
  • references/orchestration-guide.md
  • references/orchestration-parent-child.md
  • references/orchestration-sequential.md
  • references/orchestration-conditional.md

AI Decision

  • references/ai-decision-guide.md

Screen / integration / troubleshooting

  • references/form-building-guide.md
  • references/integration-patterns.md
  • references/lwc-integration-guide.md
  • references/agentforce-flow-integration.md
  • references/xml-gotchas.md
  • references/testing-checklist.md
  • references/wait-patterns.md
  • assets/

Score Guide

Score Meaning
88+ production-ready Flow
75–87 good Flow with some review items
60–74 functional but needs stronger guardrails
< 60 unsafe / incomplete for deployment

Expand your agent's capabilities with these related and highly-rated skills.

Jaganpro/sf-skills

sf-diagram-mermaid

Salesforce architecture diagrams using Mermaid with ASCII fallback. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use sf-diagram-nanobananapro), or asks about non-Salesforce systems.

252 63
Explore
Jaganpro/sf-skills

sf-integration

Salesforce integration architecture with 120-point scoring. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use sf-connected-apps), Apex-only logic (use sf-apex), or data import/export (use sf-data).

252 63
Explore
Jaganpro/sf-skills

sf-deploy

Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex/LWC code (use sf-apex/sf-lwc), creating metadata XML (use sf-metadata), or querying org data (use sf-data).

252 63
Explore
Jaganpro/sf-skills

sf-industry-commoncore-omnistudio-analyze

Cross-cutting OmniStudio analysis skill for namespace detection, dependency visualization, and impact analysis across OmniScripts, FlexCards, Integration Procedures, and Data Mappers. TRIGGER when: user asks about OmniStudio dependencies, wants namespace detection (Core vs vlocity_cmt vs vlocity_ins), needs impact analysis, or requests dependency diagrams. DO NOT TRIGGER when: authoring OmniScripts (use sf-industry-commoncore-omniscript), building FlexCards (use sf-industry-commoncore-flexcard), creating Integration Procedures (use sf-industry-commoncore-integration-procedure), or configuring Data Mappers (use sf-industry-commoncore-datamapper).

252 63
Explore
Jaganpro/sf-skills

sf-industry-commoncore-callable-apex

Salesforce Industries Common Core (OmniStudio/Vlocity) Apex callable generation and review with 120-point scoring. TRIGGER when: user creates or reviews System.Callable classes, migrates `VlocityOpenInterface` / `VlocityOpenInterface2`, or builds Industries callable extensions used by OmniStudio, Integration Procedures, or DataRaptors. DO NOT TRIGGER when: generic Apex classes/triggers (use sf-apex), building Integration Procedures (use sf-industry-commoncore-integration-procedure), authoring OmniScripts (use sf-industry-commoncore-omniscript), configuring Data Mappers (use sf-industry-commoncore-datamapper), or analyzing namespace/dependency issues (use sf-industry-commoncore-omnistudio-analyze).

252 63
Explore
Jaganpro/sf-skills

sf-datacloud-act

Salesforce Data Cloud Act phase. TRIGGER when: user manages activations, activation targets, data actions, or downstream delivery of Data Cloud audiences and data. DO NOT TRIGGER when: the task is segment creation (use sf-datacloud-segment), data retrieval/search work (use sf-datacloud-retrieve), or STDM/session tracing (use sf-ai-agentforce-observability).

252 63
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results