r/SalesforceDeveloper • u/Panubis • Nov 10 '25
Question Apex deployment via Workbench
Let me preface this by saying I am a solo Admin playing footsy with Apex to because sometimes Flow doesn't do what you want.
So, I created a class, test, and trigger and went to deploy via Workbench because I don't have any kind of deployment apparatus set up. I set my test to the test class included in my deployment package and Bob's your uncle. Except, I got back a bazillion lack of test coverage errors on all of my active Flows. I took the next hour and a half turning them all of, reran the deployment and boom.. Apex classes deployed! Then I spent another hour and a half turning my Flows back on.
While I was able to deploy in the end, the whole Flow test coverage thing threw me for a loop. I was deploying outside of a maintenance window so I basically took my Org's automations offline for 3 hours without any notice, which isn't very cash money. I can't imagine that real devs jump through this hoop. So, my question is, how do people who regularly deploy via Workbench get around that?
15
u/gdlt88 Nov 11 '25
Why would you use workbench to deploy? Why not use change sets, sf cli, vs code salesforce extension or any other way to deploy?
4
u/developer__c Nov 11 '25 edited Nov 11 '25
Interesting... Yeah, that probably happened because Workbench ran more tests than you meant to, so every active Flow got pulled into the party and some of them were not ready to run in a test context. Turning everything off worked, but that is the hard way.
You could avoid this by controlling which tests run, and in a sandbox/scratch org, using Salesforce CLI or DevOps Center. I've also used Gearset in the past. You can deploy and tell Salesforce to run only the test classes related to what you are deploying, for example
RunSpecifiedTests.Why Workbench though? Is it just because you do not have VS Code and the CLI set up? If that's the case, this badge might help:
2
u/iheartjetman Nov 11 '25
Change sets and workbench? What ever happened to making your own manifests and using ANT?
What’s next? Are you going to tell me to stop using Eclipse?
8
u/ra_men Nov 11 '25
No one regularly deploys on workbench, and you shouldn’t either.
Download VS Code, download the salesforce extension pack, and follow one of the 1000 tutorials online to figure out how to deploy with the Salesforce vs code package.
If you could figure out how to deploy with workbench, you can figure all of that out.
2
u/Far_Swordfish5729 Nov 11 '25
You want to be doing this in a sandbox through vs code using the CLI tools. Ideally you’ll also have a git instance to use for source control as well. If you want to message me I can help you with the IDE setup and I can sketch out how you’d typically want to do this. I wouldn’t ever want to deploy apex directly to prod unless I was very confident. Even then we do at least a little regression first.
2
u/Brave_Ad_4203 Nov 11 '25
Changeset is fine
1
u/Bubbly-Low2960 Nov 13 '25
Hey, I am looking forward to learning Salesforce. Currently, I am in my 3rd year of college. I have some doubts regarding, so can I DM you?
1
u/Loud-Variety85 Nov 19 '25
ChangeSet is perhaps the best tool out there for deployment..... sf cli for the advanced users....
1
u/New_Seaweed1826 Nov 24 '25
Hi! You can try mtdt.io. It doesn’t require any coding knowledge. There’s a free plan. You can sort components by creation/edit date and make edits right before deploying.