I am looking for documentation or an example for how to create a SOAP request for the following Automation Studio tasks:

  • Data Extract
  • SQL Query
  • Send Email
  • Transfer File

I've been able to work through creating send email task using example sample SOAP request documented here.

I have also attempted to request definition of tasks (from an existing Automation created in Automation Canvas) using the following SOAP envelope request. The issue is that the response does not include an ActivityObject element identifying the type of task.

  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Filter xsi:type="SimpleFilterPart">
  • I agree there need to be better automation studio examples. I'll see if I can track down any better information. Commented Feb 23, 2015 at 17:24

2 Answers 2


2 things:

  1. Data Extracts and File Transfer APIs are not exposed. So, you cannot create these from the API.
  2. The Query and SendEmail Objects can be found here. Note there are no examples here, and there are several different objects you will need to consider.

Good luck!

EDIT: In addition for some related examples, have a look at the technical articles.

  • thanks for the response, documentation here has example of EmailSendDefinition ActivityObject request. Issue that I am working through is about how to construct the ActivityObject requests for other tasks. For example how do you construct the ActivityObject request for doing a “SQL Query”? Commented Feb 25, 2015 at 3:10
  • @mattcameron did you ever figure this out? I, too, am interested in creating a SQL Query step in an Automation via the API, but the documentation is so unbelievable bad and incomplete, i'm left with trial and error for hours and hours.
    – EvilJordan
    Commented Mar 21, 2016 at 8:05
  • @EvilJordan no I didn't find solution for this. Very interested in any findings you are able to share. Commented Mar 22, 2016 at 22:49
  • @mattcameron I almost got it working completely. I'll add a new comment to this question so I can include code.
    – EvilJordan
    Commented Mar 23, 2016 at 5:09

I almost got this process working completely to create a SQL Query Activity within an Automation. Where this fails is "selecting" the actual query you want to use for the Step. Once this runs, I went in via the GUI, to the "Workflow" tab, picked the SQL Query Task that was created and manually clicked on the appropriate SQL Query Definition. Hit "Save", and you're good to go. Not ideal, but way further along than anything else I've been able to find. I welcome help to complete the process!

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <ns1:Objects xsi:type="ns1:Automation">
                <ns1:ID>YOUR MID HERE</ns1:ID>
            <ns1:Name>Automation Name</ns1:Name>
            <ns1:Description>Automation Description</ns1:Description>
                    <ns1:Name>Automation Task Annotations</ns1:Name>
                            <ns1:ObjectID>RANDOMLY GENERATED UUID</ns1:ObjectID>
                            <ns1:Name>Automation Activity Name</ns1:Name>
                            <ns1:ActivityObject xsi:type="ns1:QueryDefinition">
                                <ns1:ObjectID>SQL Query Definition Object ID</ns1:ObjectID>
                                <ns1:Name>SQL Query Definition Name</ns1:Name>

You would think, this block:

<ns1:ActivityObject xsi:type="ns1:QueryDefinition">
    <ns1:ObjectID>SQL Query Definition Object ID</ns1:ObjectID>
    <ns1:Name>SQL Query Definition Name</ns1:Name>

is where you use the same ObjectID that your already-created Query Definition owns. Unfortunately, that does absolutely nothing for you and you end up with the issue I described at the beginning.

It's also worth mentioning that any attempt to automate the Scheduling of an Automation via the API will fail (though the API will happily return a Success message), almost certainly because of the aforementioned issue with the SQL Query Definition not being selected. I discovered, with SFMC help, that unless an Automation is "complete," which includes have everything selected properly, even though there is no GUI feedback that something isn't right, one cannot add a schedule.

  • 2
    An update, almost a year later, not that anyone will see this, least of all anyone that actually works for SF or cares. Salesforce is a garbage company that ruins products and can't document or create products worth a damn. They ruined ExactTarget and will probably do the same with Demandware. Your support is garbage and your documentation is the worst in the industry. I have no idea how you've become as big as you have, and I hope you fail. For anyone considering using SF that stumbles upon this comment: Save yourself from the headaches and failures. STAY AWAY!!
    – EvilJordan
    Commented Dec 12, 2016 at 21:18

You must log in to answer this question.

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