function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jennifer Wolfel 13Jennifer Wolfel 13 

Flows launched from Apex

Hello all!  I am not a dev, but we have a team of them at my new company.  They don't want me using record triggered flows, and that is all that I have ever used.  So I have some questions about triggering flows from Apex.

My use case is mostly right now for sending out atuomated emails from a flow on cases. I have to send one when the case is opened and then I need to create some emails/notifications when cases have gone untouched.  So here are some questions I have. 

1) since I am triggering this from Apex, do I need to start with getting a record?  Or is that handled in Apex in the after update statements?  If I am kicking off a flow after update from Apex would it already have all of the data that I need from that case that was being updated same as record triggered? 

2) How would I build in a time dependency?  Is it the same as I would with record triggered?  For instance I need to say if it's been > 24 hours and the case hasn't been updated I need to notifiy someone of this.  Would I be able to build that in the same as before on the record triggered flows?  Or do I need something else in there to handle this?

Thanks in advance for any help or adivce on this.  I'm new to this format and getting very confused on what I need to do with my flows. 

VinayVinay (Salesforce Developers) 
Hi Jennifer,

As per my understanding,  you can trigger manually or autolaunch flow when condition is met.

2.  Yes you can use email to trigger noticfication from flow or apex as per you requirement.

https://help.salesforce.com/s/articleView?id=sf.flow_distribute_system_apex.htm&type=5
https://andyinthecloud.com/2014/10/26/calling-flow-from-apex/
https://andyinthecloud.com/2014/10/26/calling-flow-from-apex/

If you have premier support level you can reach out to accelerate team who can help.

https://help.salesforce.com/s/articleView?id=000337601&type=1

Please mark as Best Answer if above information was helpful.

Thanks,