I have search online and could not find any resource that talks about how to get metadata for Approval Process

I know that the approval process stores in the ProcessDefinition object but what I'm trying to find is the Entry Criteria that user have selected for the Approval Process how do I get this information in metadata api (workbench)

Here is the screen shot for ref:

enter image description here EDIT END

I'm trying to execute the following rest explorer in Workbench and getting this error, what I'm doing wrong here?


INVALID_TYPE message: sObject type 'ProcessDefinition' is not supported. errorCode: INVALID_TYPE

2 Answers 2


I suspect you just want a normal SOQL query rather than a Tooling API query.

The following ran against the SOAP Partner API no problem.

Select Id, Name From ProcessDefinition

It also worked in the Developer Console, which means it was executed against the REST API. enter image description here

Request URL:https://foo-dev-ed.my.salesforce.com/services/data/v40.0/query/?q=Select%20Id%2C%20Name%20From%20ProcessDefinition&columns=true&_=111111111111

See also:

Update for subsequent question

To get the Entry Criteria for the approval process you will need to go to the Metadata API. See ApprovalProcess and the associated entryCriteria of type ApprovalEntryCriteria.

Getting to that in Apex will require a bit of work. You could try the Apex Wrapper Salesforce Metadata API. There is also the official Apex Metadata API, but that doesn't have access to the approval processes yet (as at Summer '17). Try raising the use case in the success community or as an idea.

  • I'm trying to get Entry Criteria for the approval process, how would you get that? and I'm aware of the ProcessDefinition object and other Process objects
    – Nick
    Sep 20, 2017 at 23:17
  • @NickKahn Can you refine your question with your requirements. I read it as just needing to run the SOQL query. Sep 20, 2017 at 23:19
  • go to the Metadata API? can you show me how would you do that in workbench rest explorer? I tried /services/data/v40.0/process/approvals but did not find any information
    – Nick
    Sep 21, 2017 at 14:12
  • @NickKahn The Metadata API isn't available via REST. It is SOAP based. You want the migration>retrieve tab in Workbench. You will need to create a package.xml to retrieve the ApprovalProcess Sep 22, 2017 at 0:46
  • can that be possible via REST API ?
    – Nick
    Sep 22, 2017 at 0:48

because ProcessDefinition is not the supported object in tooling API.

you can check for supported object list here.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .