1

I have used the following query in postman

SELECT Id, ApiName,Label, ProcessType From FlowDefinitionView Where ProcessType = 'flow'

result has given me the Ids of all the flows whose processTypes are flows.

What I now want to do is, hit an endpoint (if it exists) it might take Id as parameter and get the definition of the flow.

Which means the same XML file data that I would have gotten If I would go to VsCode and manually retrieve the Flow Data from the Org Metadata.

Currently the URI is :

{{_endpoint}}/services/data/v{{version}}/query/?q=SELECT Id, ApiName,Label, ProcessType From FlowDefinitionView Where ProcessType = 'flow'

Requirement: A similar URI, which when made a Get Request returns the definition of the flow (XML file with the flow's metadata)

1
  • I use viusal studio and if you have it retrieve the flows by adding them to package.xml. then it will retrieve the flows in XML format. Add this to the package.xml and retrieve the source from the org.
    – Ohmicron
    Commented Apr 24 at 14:23

1 Answer 1

0

There isn't a simple, synchronous endpoint that will return exactly the XML metadata you're looking for without going through at least one extra step, such as handling a ZIP file or dealing with SOAP.

The XML format presented in VS Code is limited to the Metadata API, which requires quite a few moving parts to get going. Either you'll have to do a file-based retrieve(), or the CRUD-based readMetadata. Neither of these options are what I would call "fast" (in terms of time to set up). The former is asynchronous and returns a ZIP file, so you have to deal with extra complexities, and the latter is in SOAP, so you need extra XML processing.

If you just want to "hit an endpoint" with minimal fuss, consider the Tooling API, instead.

{{_endpoint}}/services/data/v{{version}}/tooling/sobjects/Flow/{{flowId}}

If you ask for JSON (Accept: application/json header), you'll get back a JSON that contains a Metadata property. This will contain the exact same information you'd get in VS Code, but in JSON form.

If you ask for XML (Accept: application/xml header), you'll get something that very closely resembles the XML of VS Code. You'll still have to deal with the Metadata property, and all of the elements inside will have an XML namespace, but otherwise this results in the same data.

You must log in to answer this question.

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