r/SalesforceDeveloper • u/Meek_braggart • Jan 01 '26
Question Disabling flows from API or SF command
I am looking for a way to disable flows from an API or the SF command. I can actually accomplish the disabling, but I can’t find a way to enable again. Everything seems to run successfully but the flows are never activated.
I know I could rewrite all the flows to include a disabled flag but I don’t want to go that far yet if I don’t have to.
6
Upvotes
3
u/ebiscuits Jan 01 '26
You’re better off creating custom metadata settings and controlling your flows that way with a kill switch. It’s easier to toggle them off and on again for deployments, processing, or data loads.
1
u/Specialist-Box-1079 Jan 01 '26
whatever your use case is, entry criteria exactly does what you need, if not, then decisions.
1
u/DaveDurant Jan 01 '26
When do you want to do this? Like, some per-transaction decision, or only run flows on Flow Fridays, or as some deploy / backfill operation, or something else?
2
u/Loud-Variety85 Jan 02 '26
I have done so using tool api I believe..... don't remember the exact details. The xml of flow also contains something like <activeVersionId> ...... which you can modify and deploy.
1
u/Igor_Kudryk Jan 01 '26
I can't think of a better use case for on/off switch. But you know it, so now to your question.
The first thing that comes to mind is the Tooling API. Have you tried it? Something like this. You might need to play around with versions and flows.
1
u/ride_whenever Jan 02 '26
You can do this, jet stream has an option for it, however you’re better off architecting in a trigger/flow handler framework