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
Shweta GargShweta Garg 

Get metadata of multiple Workflows in single callout using Tooling API in Apex

Hi All,

I have a requirement to retrieve metadata of all workflows, validation rules and flows using Tooling API. There is a limitation with Tooling API that we can not query metadata field when query returns more than one record. Mentioned in Force.com Tooling api doc-"Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance."
Because of this limitation I have to make callout for each workflows(validation or flows) one by one present in an org. So, if there are 1000 workflows then I will have to make 1000 callouts to retrieve metadata. This sometimes hits our org's API request limit and also increases processing time.

Is there any way to get metadata of multiple workflow rules in single callout.
Please suggest me. 

Thanks,
Shweta
 
Sir Rodney MacKenzieSir Rodney MacKenzie
Shweta - did you find solution for this?  I have the same problem.