When should I use Apex instead of flows?
Visual flows become harder to test than a code service once they involve loops, cross-object branches, or bulk behavior. Starting with a flow often forces you to introduce code anyway, leaving you managing conflicting triggering mechanisms that create ongoing issues for long-term maintenance.
Core Friction Pattern
Analysis of 5 peer accounts across online developer and community forums reveals that “When should I use Apex instead of flows?” repeatedly surfaces due to edge-case mismatches between standard defaults and real-world environments. Standard troubleshooting frequently falls short, compelling practitioners to develop custom workarounds.
+5 alternative community-tested workarounds cataloged below.
What the numbers show
Counted from the threads quoted below. How we count
- People have been saying this in most months since September 2026.
- This comes up 100.6× more often in r/salesforce than across the site as a whole.
What people tried
Every workaround mentioned in the threads below. We haven’t tested any of them — and nobody here is claiming they worked.
Found another way around this?
Share your steps and trade-offs so fellow engineers don't have to reinvent the wheel. No account required.
When should I use Apex instead of flows?
- 1Using Flow until performance or testing limits are hit and then switching to ApexDid this help you?
- 2Relying on team skill sets (admins vs developers) to dictate the automation choiceDid this help you?
- 3Leveraging AI coding assistants to write code faster instead of building complex visual workflowsDid this help you?
- 4Using whatever styling method one is most comfortable withDid this help you?
- 5Splitting changes by type, putting site-wide styles in global settings or a single CSS fileDid this help you?
- 6Putting custom code in one place like a child theme or customizerDid this help you?
In their words
Unedited, grouped by where they were said, most upvoted first within each place, each linked to the thread it came from.
“once a flow has several loops, cross-object branches, or needs careful bulk behavior, it starts feeling harder to test than a small Apex service.”source ↗
“This is a good question. Still wrestle with it now.”source ↗
“whenever you start with triggered flow, inevitably you find reasons you need apex. Then all of a sudden you are managing different triggering mechanisms and trying to make them play nice, which often leads to issues.”source ↗
“in my experience with sites other devs have built, it's a PITA to dig around and "reverse engineer" the previous dev's CSS patterns.”source ↗
“What is better for longterm, specifically for an e-commerce site.”source ↗
Where this came up
People with this problem also raised
Related community dilemmas clustered by discussion consensus
Buy once cry once or start with cheaper equipment?
Deciding between expensive commercial gear and budget alternatives creates a paralyzing trap before a business even opens. Opting for cheaper tools risks frequent breakdowns and capability limits, while buying high-end equipment upfront drains essential capital before generating steady revenue.
Are later steps in lawn care programs actually necessary?
Commercial multi-step programs and soil amendments like humic acid are largely speculative and not strictly necessary for a healthy lawn. Because their actual efficacy on soil compaction and drainage is difficult to prove, homeowners end up questioning whether paying for these extra applications is just a marketing tactic.
Why does AI-generated code get bloated and hard to maintain?
AI coding assistants often turn short scripts into thousands of lines with unwanted extras like error checking, leaving you understanding less as the codebase grows. Progress starts fast, but drift and inconsistency set in as projects and notes expand, turning the last 5% of changes into a slow grind. Without closely reviewing every edit, trying to keep the code working starts to feel like pulling a slot machine handle.
How do I switch from old sysadmin stuff to IaC?
Sysadmins with years of legacy experience feel majorly behind when trying to re-enter the job market without large-scale cloud infrastructure or modern tool proficiency. This leaves them stuck relying on basic manual workflows while struggling to transition into full-time DevOps roles.
Is premium gas actually necessary if my car recommends it?
Using a lower octane than recommended can cause engine knocking and reduce efficiency, but cars designed for standard fuel do not benefit from paying extra for higher octane. Check your owner's manual to see if premium gas is strictly required or just recommended, as using higher-than-necessary octane wastes money without improving engine performance.
How to streamline Intune security policies across multiple tenants
Scaling security baselines across multiple client tenants while balancing strict institutional controls with unique user needs makes policy maintenance extremely difficult. This friction prevents IT providers from efficiently standardizing configurations and keeping systems manageable.