Flow segmentation methodology for complexity management, pattern detection, and safe editing. Use when editing flows, extracting subflows, or managing flow complexity.
From opspal-salesforcenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-salesforceThis skill is limited to using the following tools:
extraction.mdpatterns.mdtroubleshooting.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
/flow-edit/flow-analyze-segments/flow-interactive-build| Complexity | Risk | Recommended Mode |
|---|---|---|
| 0-5 | Low | /flow-edit (Quick Edit) |
| 6-9 | Medium | Standard editing or segmentation |
| 10-19 | High | /flow-interactive-build |
| 20+ | Critical | Segmentation + refactoring |
| Type | Pattern | Budget |
|---|---|---|
| Validation | Decision clusters at start | 5 points |
| Enrichment | recordLookups + assignments | 8 points |
| Routing | Dense decision clusters with branching | 6 points |
| Notification | Email/Chatter actions at end | 4 points |
| Loop Processing | Loops with record operations | 10 points |
# Quick edits (low complexity)
/flow-edit <FlowName> "<instruction>" --org <alias>
# Analyze segments
/flow-analyze-segments <FlowName> --org <alias>
# Extract to subflow
/flow-extract-subflow <FlowName> --segment <name>
# Full segmentation mode
/flow-interactive-build <FlowName> --org <alias>
| Element Type | Points |
|---|---|
| Decision | 2 |
| Loop | 3 |
| recordLookup | 1 |
| recordCreate | 2 |
| recordUpdate | 2 |
| recordDelete | 3 |
| subflow | 1 |
| action (Apex) | 2 |
| screen | 2 |
| Condition | Multiplier |
|---|---|
| Nested loops | 1.5x |
| >20 elements | 1.2x |
| >50 elements | 1.5x |
| Cross-object operations | 1.3x |
Pattern: 2+ decisions within first 5 elements
Purpose: Entry criteria checking
Typical elements: Decision, Assignment (fault handling)
Pattern: recordLookup followed by Assignment
Purpose: Gather data before processing
Typical elements: recordLookup, Assignment, Decision
Pattern: Dense decision cluster (3+ decisions, <30% other)
Purpose: Direct flow based on conditions
Typical elements: Decision, Assignment
Pattern: Email/Chatter actions in last 5 elements
Purpose: Alert users of changes
Typical elements: actionCalls (email/chatter)
Pattern: Loop containing record operations
Purpose: Process collections
Typical elements: loop, recordUpdate/Create, Assignment
For flows with complexity < 10, use quick edit:
/flow-edit Account_Processing "Change Status_Check label to 'Active Check'" --org prod
| Condition | Recommendation |
|---|---|
| Segment used in 2+ flows | Extract to shared subflow |
| Segment > 10 elements | Extract for maintainability |
| Segment has clear boundary | Good extraction candidate |
| Segment has complex error handling | Extract with fault path |
/flow-extract-subflow Account_Flow --segment Validation --preview
Output:
Segment: Validation
Elements: 4 (Decision x2, Assignment x2)
Input Variables: AccountId, Status
Output Variables: IsValid, ErrorMessage
Impact: 2 connectors will point to subflow
| Stage | Purpose |
|---|---|
| 0 | Complexity Analysis |
| 1 | Flow Loading |
| 1.5 | Segment Suggestion Review |
| 1.6 | Interactive Partition Mode |
| 2 | Element Addition |
| 3 | Variable Management |
| 4 | Connector Wiring |
| 5 | Validation & Deploy |
<Object>_<Action>_<Segment>
Example: Account_Update_Validation
See supporting files:
patterns.md - Segment detection algorithmsextraction.md - Subflow extraction guidetroubleshooting.md - Common issues