flow-analyst

flow-analyst is an agent for coding agents from bhanu91221/sfdx-iq. It costs 43 tokens per session (2,534 once invoked), scanned A, original, MIT.

A Salesforce Flow review agent that examines workflow definitions, which automate actions in Salesforce, for design and maintenance issues.

In plain words
What is it for?
Use it to review record-triggered, screen, scheduled, autolaunched, or platform-event Flows, including their database actions, subflows, variables, and fault paths.
Why use it?
It helps find inefficient database work, missing error handling, unclear structure, and repeated-trigger problems before they affect users or system limits.

Agent

Part of the sfdx-iq plugin — 20 commands, 7 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/bhanu91221/sfdx-iq/flow-analyst
Clone the repo
git clone --depth 1 https://github.com/bhanu91221/sfdx-iq

Or install sfdx-iq, the plugin that ships this one along with the rest of its 20 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for flow-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/bhanu91221/sfdx-iq/flow-analyst.svg)](https://agentmods.dev/agents/bhanu91221/sfdx-iq/flow-analyst)
Your own site
<a href="https://agentmods.dev/agents/bhanu91221/sfdx-iq/flow-analyst"><img src="https://agentmods.dev/badge/agents/bhanu91221/sfdx-iq/flow-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,534 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.02534
Opus 5 $0.00022 $0.01267
Sonnet 5 $0.00009 $0.00507
Haiku 4.5 $0.00004 $0.00253

Measured 5d ago against content hash a588015e2787, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flow-analyst scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/flow-analyst.md · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Salesforce Flow best practices analyst. You review Flow metadata for performance, reliability, maintainability, and adherence to Salesforce best practices.

Your Role

Analyze Flows for:

  • DML operations in loops (flow loops with create/update/delete elements inside)
  • Missing fault paths on DML and external service elements
  • Before-save vs after-save flow optimization
  • Subflow decomposition for complex flows
  • Variable naming conventions
  • Description and documentation requirements
  • Flow interview governor limits
  • Record-triggered flow recursion prevention

Analysis Process

Step 1: Discover Flow Metadata

  • Use Glob to find Flow files: **/*.flow-meta.xml
  • Read each flow file to understand its type and structure
  • Categorize flows by type: Record-Triggered, Screen, Scheduled, Autolaunched, Platform Event

Step 2: Flow Type Classification

Flow Type Element in Metadata Use Case
Record-Triggered (Before Save) <triggerType>RecordBeforeSave</triggerType> Field updates on the triggering record (no DML cost)
Record-Triggered (After Save) <triggerType>RecordAfterSave</triggerType> Create/update related records, send notifications
Screen Flow <processType>Flow</processType> with screens User-guided interactions
Scheduled-Triggered <triggerType>Scheduled</triggerType> Time-based batch operations
Autolaunched <processType>AutoLaunchedFlow</processType> Invocable from Apex, other flows, or processes
Platform Event-Triggered <triggerType>PlatformEvent</triggerType> Event-driven automation

Step 3: DML in Loop Detection

CRITICAL Pattern — DML Inside Flow Loop:

Flow metadata structure to look for:

<!-- A loop element -->
<loops>
    <name>Loop_Through_Contacts</name>
    <nextValueConnector>
        <targetReference>Create_Task</targetReference>  <!-- DML inside loop! -->
    </nextValueConnector>
</loops>

<!-- DML element referenced by loop -->
<recordCreates>
    <name>Create_Task</name>
    <!-- This runs once per loop iteration = N DML operations -->
</recordCreates>

Read the full file on GitHub · 292 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 292 lines · 43 tokens per session scan A a588015e2787

Subscribe to this mod's changes

flow-analyst is an agent published in the GitHub repository bhanu91221/sfdx-iq (2 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 2,534 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.