I saw this question about retrieving Automation info and I can't find how to do the basic task of retrieving information about all the automations in a folder with given CategoryID (=folderID) as I made before with Data Extensions or Query Activities using


var folderQAs = QueryDefinition.Retrieve({Property:"categoryId",SimpleOperator:"equals",Value:folderID});)

or this


Is there something similar to Automations? (like this)


I got a list of all automations/journeys/unknownThings with the following code:

var cols =  ["Name", "Status", "ModifiedDate", "CustomerKey", "ObjectID"
var filter = {
  Property: "Status",
  SimpleOperator: "IN",
  Value: [-1,0,1,2,3,4,5,6,7,8]

var list = prox.retrieve("Program", cols, filter);
for(var a = 0; a < list.Results.length; a++) {

Thank you in advance

1 Answer 1


You can use the filter on the CategoryID property (best ensure to be case sensitive) This next example works for data extensions; all you should have to do is replace the Object in the last line with "Automation", as all the properties are present on both objects:

<script type="javascript" runat="server">
var prox = new Script.Util.WSProxy();
var props = { QueryAllAccounts: true };
var cols = ["Name","CustomerKey","CategoryID"];
var filter = {
    Property: "CategoryID",
    SimpleOperator: "equals",
    Value: 123456
var opts = {
    BatchSize: 25
var data = prox.retrieve("DataExtension", cols, filter, opts, props);</script>

Here is an example "the old fashioned way" with QueryDefinitions retrieved by a (complex, meaning >1 conditions) filter. You can see that it works off the same object structure, so the methods and objects are interchangeable. You could e.g. use this filter on CategoryID instead. Only make sure that you don't ask for properties that are not on the object. E.g. "IsSendable" would be only present on DEs.

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                <Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
                <LeftOperand xsi:type="par:SimpleFilterPart">
               <RightOperand xsi:type="par:SimpleFilterPart">

It's good to familiarize yourself with SSJS filters;

For the general use of simple and complex filters, here is a good explanation: How can I create a ComplexFilterPart using SSJS / API in Marketing Cloud?

...and here is an example to apply a complex filter in WSProxy: SSJS Complex filter with more than one propertie

some more useful WSproxy examples: https://github.com/jdeblank/sfmc_dev/tree/master/wsproxy

operators are documented here, albeit a little "shady" as definitions like "works on most objects" are used unironically: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/simpleoperators.htm

And you can of course find the objects here: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/soap_web_service_objects.html

You must log in to answer this question.

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