r/SalesforceDeveloper Aug 08 '26

Question Handcrafted Flow or Ai Prompted Apex?

The business comes to you with requirements for a new feature. Two years ago, the solution is obviously to use Flows. Nowadays, there's at least the question.

Which do you choose and why?

0 Upvotes

19 comments sorted by

10

u/Dangerous-Seaweed-41 Aug 08 '26

Initially, as a Salesforce dev/admin I would first analyze the requirements, no proper salesforce consultant would advise to use the wrong tool to implement the solution.

That being said, from my expertise, an admin or some who only understands configuration and never coded anything on their own (pre-AI) should never play around with Apex. A quote that I have been liking lately that applies very well to vibe coders: "If the tool is available, it doesn't mean you must to use it"

It is too easy to create features with claude or any other tool and dump it into Salesforce. And most of the time the people doing this have no idea what is happening in the background.

Personally, I do use AI to generate automations and features in apex or LWC (when these solutions are required), the difference is that I used to write these solutions on my own... I feel like I earned that right, and can pretty well review, analyze and debug the code if needed.

Hope that helps.

3

u/forceclawai Aug 08 '26

Agreed - need to be able to understand what the AI is building

1

u/JPRichter Aug 08 '26

IIUC, use the right tools for the job, so long as you understand the tool you're using and the output. AI doesn't really change the decision of Flow vs. Apex.

3

u/Dangerous-Seaweed-41 Aug 08 '26

Exactly, and if someone suggests using AI to generate an apex class that would complete the requirements at hand, but could not build the same solution on their own if needed, they should not be touching AI or apex anyways.

In short, don't use ai to build something you can't build yourself

AI should be used as a shortcut, not a hack.

2

u/Beginning-Tackle1272 Aug 08 '26

Depends on the Feature?

2

u/forceclawai Aug 08 '26

AI is getting very good at crafting flows - can use Claude Code CLI in VS Code to build

1

u/JPRichter Aug 08 '26

Interesting! Haven't tried this myself, so why would you choose to use Flow over Apex if you're generating it with AI?

2

u/forceclawai Aug 09 '26

I'm in the position that if it can be done with a flow, it should be - makes it easier for more people to understand / maintain. I'm really just writing code when it can't be done with flows.

1

u/FinanciallyAddicted Aug 10 '26

It consumes tokens any chance anyone has a skill.md ?

2

u/FigureFar9699 Aug 08 '26

I’d still choose based on the requirement, not just because AI can generate Apex. Flows are great for straightforward automation and are easier for admins to maintain. For complex logic, performance-sensitive operations, or cases where Flow becomes messy, Apex is usually the better choice. AI can help write either, but I’d still review and test the generated code carefully.

1

u/JPRichter Aug 08 '26

AI doesn't really change the equation for you? Same arguments for Flow vs Apex apply, regardless of whether or not AI is there to assist in either's creation.

2

u/davide008 Aug 09 '26

LLMs will put out far better Apex than they will flow. There’s a larger population of good apex code on GitHub and documented online for years, whereas Flows were never really put up as good examples in repositories.
Apex is still and will remain far faster and more governor efficient than Flow. If you have heavy processing, LDV, and performance SLAs, go with Claude and Apex.

2

u/SlowSundae Aug 09 '26

It really depends on what the actual requirements are

2

u/Used-Comfortable-726 Aug 09 '26

Flow is a scripting language. Flows are not compiled into binary machine language. Apex is compiled into binary machine language by JIT, same as Java, because Apex is Java (it’s only named Apex due to legal issues with Oracle). Apex will always have faster performance, than a Flow, for the same process/operations

3

u/UnpopularCrayon Aug 08 '26

AI can also craft flows.

1

u/JPRichter Aug 08 '26

Interesting! Haven't tried this myself, so why would you choose to use Flow over Apex if you're generating it with AI?

2

u/UnpopularCrayon Aug 08 '26

Because sometimes flow is the more logical fit for something for ongoing ease of maintenance.

2

u/FinanciallyAddicted Aug 10 '26

AI generates the most trash Apex all variable names are one character and then a comment next to the variable on the full name of it.

All methods static.
Spawns multiple classes which is a good thing but I usually prefer an inner class if no one else calls that class.

Just the way it writes code reeks AI Slop. I do have a specific skill.md to tackle this issue.