sf-flow-automation

Implements and reviews Salesforce record-triggered flows, invocable Apex actions, and flow test metadata.

2|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/grzmol/vibe-force --skill sf-flow-automation-grzmol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-flow-automation
Source: https://github.com/grzmol/vibe-force/tree/main/skills/sf-flow-automation
Command: npx skills add https://github.com/grzmol/vibe-force --skill sf-flow-automation-grzmol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Salesforce record automation fails in predictable ways: flows and Apex triggers fighting over the same field, flows with no entry conditions firing on every save, DML inside loops burning governor limits, and FlowDefinition files silently overriding which flow version is active on deploy. This Skill encodes the decision rules, order-of-execution placement, metadata shapes, and anti-patterns needed to build flow automation that survives deployment. ## Core Features & Use Cases - Flow vs Apex decision matrix: Choose before-save flow, after-save flow, scheduled flow, platform-event flow, or Apex trigger based on where the work sits in the order of execution, with the rule of one automation owner per object. - Invocable Apex patterns: Write bulk-safe @InvocableMethod classes with @InvocableVariable request/response types, list-in list-out signatures, and no DML inside loops. - Flow metadata and deployment: Author Flow and FlowTest XML, avoid the FlowDefinition activeVersionNumber override trap, and handle flow activation and test coverage requirements on production deploys. - Use Case: When a story asks to set a renewal date when an Opportunity closes, the Skill directs a before-save flow assigning $Record with an entry condition and doesRequireRecordChangedToMeetCriteria, rather than an after-save flow with an extra Update Records element. ## Quick Start Ask the assistant to add a record-triggered flow that sets a field on Opportunity when the stage changes, and have it decide between Flow and Apex and produce the flow metadata.

Frequently Asked Questions about sf-flow-automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between a Salesforce flow and an Apex trigger?

Use a before-save record-triggered flow for same-record field updates and an after-save flow for related-record changes. Choose Apex for complex branching, recursion, callouts, or bulk algorithms. Never let a flow and a trigger both maintain the same field on one object.

How do I call Apex from a Salesforce flow?

Expose a static public method annotated with @InvocableMethod on an outer class, taking a single List parameter of primitives, sObjects, or a class with @InvocableVariable members. Return a list of the same size and order, and keep all DML outside loops.

What is the difference between before-save and after-save record-triggered flows?

Before-save flows run at step 3 of the order of execution and mutate the in-memory $Record for free, before before-triggers. After-save flows run at step 14 after the record has an Id, and anything they write re-enters the full save procedure.

Why does my flow deploy activate the wrong version?

A deployed FlowDefinition's activeVersionNumber overrides the status field in the flow file, so an older version can go live. Since API 44.0 Salesforce recommends version-less flow file names and dropping flowDefinitions/ from the repository entirely.

Does a FlowTest provide Apex code coverage?

No. FlowTest metadata verifies flow behavior with assertions but produces no Apex coverage. An @InvocableMethod called by a flow still needs its own Apex test class, ideally with multiple requests asserting constant query and DML counts.

Why is my record-triggered flow hitting governor limits?

Flows share the Apex per-transaction limits, so a Get Records element inside a loop burns the same 100 SOQL queries as Apex. Collect ids first, query once with the In operator, and act outside the loop; Code Analyzer rule DbInLoop detects this.