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
tanmayeetanmayee 

how to get the count of workflow rules in an organization

does anyone know how to get the count of workflow rules in an organization.

 

thanks in advance.

sfdcfoxsfdcfox
There is no easy way to get a total count of workflow rules in the organization. You can create a list view for all workflow rules, then page through the list until you reach the end. The total count would then be # of pages * page size + final page size.
Vinay K 39Vinay K 39
There is no way that you get the org directly, but you can pull the count using workbench.
 using REST explorer with Get(),
 /services/data/v45.0/tooling/query/?q=Select+Id+From+WorkflowRule
Kirill_YunussovKirill_Yunussov
You can also query for it via the Developer Console in SF.   Make sure to check the "Use Tooling API" checkbox.

Here is a query of all fields for this object:
Select Id, Name, ManageableState, NamespacePrefix, TableEnumOrId, FullName, Metadata From WorkflowRule limit 1
When quering FullName or Metadata, can only pull 1 record at a time.
Without those two fields, can get all WF rules like so:
Select Id, Name, ManageableState, NamespacePrefix, TableEnumOrId From WorkflowRule
Or just get the total count:
Select count() From WorkflowRule
Kirill_YunussovKirill_Yunussov
Also, grouped by Object:
Select count(id), TableEnumOrId From WorkflowRule group by TableEnumOrId order by count(id) desc

 
Nikita Meshram 2Nikita Meshram 2
Hi Tanmayee,

This is easy to find using the Standard salesforce option like Workbench or Developer Console using SOQL Using this you can check all your Workflow Rules.

You may also attempt AppExchange Solutions for this, such as the Satrang Metadata Search AppExchange App, which offers all search possibilities for Components. You can also use particular Keywords to search for results. You may download the search results in Excel and PDF format.

AppExchange App URL - https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009wgF7EAI&channel=recommended&tab=e

Disclaimer: I work at Satrang Technologies, the publisher of this Satrang Metadata Search App Exchange App.