You need to sign in to do that
Don't have an account?

How to write a test class for starting a flow in apex?
I want to try to bulkify a headless flow using an apex batch job to call it every hour, but I can't find anything on how to write a test class for a batch that only calls a flow. Has anyone tried to do this? Are there any gotchas you ran into with the flow?
Awesome question. Headless flows are pretty similar to Apex Triggers in terms of functionality, so my educated guess is that you could test a headless flow the same way you would test a trigger. In other words, you could insert records and/or update the records to assert your flow is working properly. For bulk conditions, you could create / update several records at once to prove your Flow is working properly.
Thanks!