Last Updated on May 1, 2022 by Rakesh Gupta
Big Idea or Enduring Question:
- How to find all record-triggered and scheduled-triggered flows for an object?
After reading this blog, you’ll be able to:
- Find out all record-triggered flows for an object
- Find out all scheduled-triggered flows for an object
- and much more
Business Use case
Arda Turan is working as a System Administrator at Gurukul on Cloud (GoC). Arda wants to learn the different ways to find out record-triggered flows for an object.
Automation Champion Approach (I-do):
There are possible solutions for the above business use case. We will go through them one by one.
- Using SOQL Query
- Access Record-Triggered Flows from the Object Manager
- Visualize All Your Record-Triggered Flows in One Place with Flow Trigger Explorer
- Flows list view
Solution 1 – Using SOQL Query
To get specific object apex triggers, we can write a SOQL query on the FlowDefinitionView object by passing the object name in the TriggerObjectOrEventLabel field.
Below SOQL query will return all the record-triggered and scheduled-triggered flows on the Opportunity object.
Select id, IsActive, Label, ProcessType, ManageableState , TriggerObjectOrEventId, TriggerObjectOrEventLabel, TriggerType from FlowDefinitionView where TriggerObjectOrEventLabel='Opportunity'
If you only want to get all the record-triggered flows on the Opportunity object, then
Select id, IsActive, Label, ProcessType, ManageableState , TriggerObjectOrEventId, TriggerObjectOrEventLabel, TriggerType from FlowDefinitionView where TriggerObjectOrEventLabel='Opportunity' and TriggerType IN ('RecordAfterSave', 'RecordBeforeSave')
This is one of the best approaches as it is more flexible and easier to add and remove filters as needed.
Solution 2 – Access Record-Triggered Flows from the Object Manager
You can get a picture of all of an object’s record-triggered flows directly from the Object Manager. You can even create a New Flow or open up Flow Trigger Explorer from the object’s setup menu!
This is one of the easiest approaches to finding out all record-triggered flows for an object but doesn’t provide much information. For example, if the record-triggered flow belongs to a managed or unmanaged package.
Solution 3 – Visualize All Your Record-Triggered Flows in One Place with Flow Trigger Explorer
See and manage your record-triggered flows with Flow Trigger Explorer, a new tool that’s more visual and interactive than the Flows list view. Flow Trigger Explorer shows all of the flows that are associated with a specified object and that run when a record is created, updated, or deleted. For example, quickly see all flows that are triggered to run when a case record is created.
In Flow Trigger Explorer, select an object and a trigger to see flows that run when a record for that object is created, updated, or deleted. It will show all of the before-save and after-save flows that run for the same object and trigger.
Solution 4 – View Record-Triggered Flows Using List View
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.