
Sf Flow
Author Salesforce Flow decision elements that use Einstein LLM prompts instead of hand-written rule criteria.
Overview
sf-flow is an agent skill for the Build phase that provides a Salesforce Flow XML template for AI Decision elements using LlmPrompt and Einstein at runtime.
Install
npx skills add https://github.com/jaganpro/sf-skills --skill sf-flowWhat is this skill?
- XML template for AI-evaluated Decision elements with LlmPrompt on decisions and rules
- Documents API version 62.0+ and per-evaluation Einstein AI credit consumption
- Shows merge-field placeholders so runtime prompts receive record context
- Separates Decision Instructions from Outcome Instructions per rule path
- Default outcome path without AI instructions for catch-all routing
- API version 62.0+ requirement
- Einstein AI credits consumed per evaluation
Adoption & trust: 1.3k installs on skills.sh; 418 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need Salesforce Flow branches judged by natural-language criteria but do not want to hand-craft and maintain complex condition logic for every outcome.
Who is it for?
Solo builders shipping on Salesforce who already use Flow Builder and Einstein and want AI-evaluated routing with documented prompt structure.
Skip if: Teams not on Salesforce, flows below API 62.0, or builders who need only classic formula-based decisions without LLM cost per evaluation.
When should I use this skill?
You are authoring or extending a Salesforce Flow with AI-evaluated Decision elements and need the LlmPrompt XML structure.
What do I get? / Deliverables
You get a copy-ready Flow decision XML skeleton with Decision and Outcome Instruction slots and merge-field guidance ready to paste into Flow Builder or metadata deploys.
- Flow decision XML snippet with placeholders filled
- Decision and Outcome Instruction prompt text
Recommended Skills
Journey fit
How it compares
Use as a Flow metadata template for Einstein decisions, not as a generic CI workflow or non-Salesforce agent skill.
Common Questions / FAQ
Who is sf-flow for?
Salesforce-focused solo builders and indie teams automating cases, leads, or service flows who want LLM-driven decision branches inside Flow.
When should I use sf-flow?
During Build integrations when you define a new AI Decision element in Flow Builder or metadata, especially when sentiment, intent, or multi-outcome classification should be prompt-driven rather than formula-driven.
Is sf-flow safe to install?
Review the Security Audits panel on this Prism page and treat generated Flow XML like any deployable metadata—validate prompts, merge fields, and Einstein credit usage in a sandbox before production.
SKILL.md
READMESKILL.md - Sf Flow
<?xml version="1.0" encoding="UTF-8"?> <!-- AI Decision Element Template ============================ Use "Define with AI (Advanced)" in Flow Builder to let AI evaluate conditions at runtime instead of manually defined criteria. Key structure: - <attributes><type>LlmPrompt</type> on the <decisions> element = Decision Instructions - <attributes><type>LlmPrompt</type> on each <rules> element = Outcome Instructions - No <conditions> block needed on AI-evaluated rules - The default outcome path needs no AI instructions Requirements: - API version 62.0+ - Einstein AI credits (consumed per evaluation) - Include merge field references in prompts so AI has data context Usage: Replace {{PLACEHOLDERS}} with your values. --> <decisions> <name>{{DECISION_API_NAME}}</name> <label>{{Decision Label}}</label> <locationX>182</locationX> <locationY>242</locationY> <!-- Decision Instructions: describes what the AI is deciding --> <attributes> <type>LlmPrompt</type> <value>{{Describe the decision. Include merge field references like {!Get_Record.FieldName} so AI has the data it needs to evaluate. Example: Detect the sentiment on the case based on subject "{!Get_Case.Subject}" and description "{!Get_Case.Description}" as Negative, Positive, Neutral, or Undetermined.}}</value> </attributes> <!-- Default outcome: catches everything that doesn't match a named rule --> <defaultConnector> <targetReference>{{DEFAULT_PATH_TARGET}}</targetReference> </defaultConnector> <defaultConnectorLabel>{{Default Outcome Label}}</defaultConnectorLabel> <!-- Named outcome: AI routes here when its instructions match --> <rules> <name>{{OUTCOME_API_NAME}}</name> <!-- Outcome Instructions: describes when AI should choose this path --> <attributes> <type>LlmPrompt</type> <value>{{Describe when this outcome applies. Example: The customer sentiment is Negative. The subject or description contains language indicating frustration, anger, dissatisfaction, complaint, or urgency.}}</value> </attributes> <conditionLogic>and</conditionLogic> <connector> <targetReference>{{OUTCOME_PATH_TARGET}}</targetReference> </connector> <label>{{Outcome Label}}</label> </rules> <!-- Add more <rules> blocks for additional AI-evaluated outcomes --> </decisions> <?xml version="1.0" encoding="UTF-8"?> <!-- ╔═══════════════════════════════════════════════════════════════════════════════╗ ║ APEX ACTION TEMPLATE ║ ║ Template: apex-action-template.xml ║ ║ API Version: 66.0+ ║ ╠═══════════════════════════════════════════════════════════════════════════════╣ ║ ║ ║ PURPOSE: ║ ║ Demonstrates how to call @InvocableMethod Apex from a Flow ║ ║ ║ ║ KEY PATTERNS: ║ ║ - actionCalls element with actionType="apex" ║ ║ - inputParameters mapping Flow vars → Apex Request ║ ║ - outputParameters mapping Apex Response → Flow vars ║ ║ - faultConnector for Apex exception handling ║ ║ - Decision element for checking success/failure ║ ║ ║ ║ PREREQUISITES: ║ ║ 1. Deploy the Apex class with @InvocableMethod first