3

Due to one of the critical requirement, we would need to run the automation studio, less than once a hour. Has anyone have an idea if Salesforce support would be able to enable running automation studio once in 30 minutes.

  • 1
    Correct me if I am wrong, but doesn't the automation trigger when a file is added to the FTP folder? Not on a time based schedule. There is no schedule for triggered automations. Triggered automations are prompted to run whenever a file is added in the FTP folder. All files dropped into the folder are queued and executed as fast as possible. If an automation errors, each subsequent file is then processed until the queue is empty. Taken form link – cmmoutes13 Jul 19 '16 at 13:53
3

You cannot schedule an automation to run at a lower increment than once an hour via the 'scheduled automation' option.

As CMMoutes13 commented, you can set the automation to be 'triggered' via a file drop in an FTP to get around scheduling in the UI - if your automation requires a file drop.

Your other option is to use an API call to execute the automation at the interval of your choice. You will need to create it as a scheduled automation, but without setting a schedule.

Be aware that if the automation is already running or in any status other than 'Ready' the API call will fail and the Automation will not run. There is no queue for this type of execution on a scheduled automation (at least that I have been able to find).

Sample of Perform API call:

Perform an Existing Automation Sample .NET Code

The sample code below starts the specified automation. To perform a stop for the specified option, change the string action in the code to stop.

public static void PerformAutomation(SoapClient soapClient,
string iAutomationObjectID) {
Automation automation = new Automation();
automation.ObjectID = iAutomationObjectID;

string sStatus = "";
string sStatusMessage = "";
string sRequestId = "";

PerformResult[] pResults = soapClient.Perform(new PerformOptions(), "start", new APIObject[] { automation }, out
sStatus, out sStatusMessage, out sRequestId);

Console.WriteLine("Status: " + sStatus);
Console.WriteLine("Status Message: " + sStatusMessage);
Console.WriteLine("Request ID: " + sRequestId);

foreach (PerformResult pr in pResults)
{
    Console.WriteLine("StatusCode: " + pr.StatusCode);
    Console.WriteLine("ErrorCode: " + pr.ErrorCode);
    Console.WriteLine("StatusMessage: " + pr.StatusMessage);
} }
| improve this answer | |
  • Thanks Gortonington and CMMoutes13 for your comments. Unfortunately we donot have File drop in our instance and are looking for other means. On the API Call option, i browsed it and found that there is no SOAP API call available for Starting a Automation. Can someone help on this – Ganesh Kumar Jul 19 '16 at 14:27
  • There is. It is called "Perform" - code.exacttarget.com/apis-sdks/soap-api/… – Gortonington Jul 19 '16 at 15:32
  • added relevant code to answer – Gortonington Jul 19 '16 at 15:35
  • 2
    keep in mind too, with the trigger automation, you can send an empty file to the FTP at an interval of your choice. The automation does not need to interact with the file. – Gortonington Jul 19 '16 at 15:37
6

Yes. You can also use Script Activities to alternately execute two Automations.

Automation1

  1. (whatever automation step)
  2. Wait - x minutes
  3. Script Activity - Run Automation2

Automation2

  1. (whatever automation step)
  2. Wait - x minutes
  3. Script Activity - Run Automation1

Script Activities can be enabled (no charge) by SFMC Support

Here's a sample:

<script runat="server">

Platform.Load("Core","1.1.1");
var output = "";
var logDE = DataExtension.Init("LOGDATAEXTENSION");

output += "starting loop";

var automationCustomerKey = "AUTOMATION1CUSTOMERKEY"

var rr = Platform.Function.CreateObject("RetrieveRequest");
Platform.Function.SetObjectProperty(rr, "ObjectType", "Automation");
Platform.Function.AddObjectArrayItem(rr, "Properties", "ProgramID");
Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");
Platform.Function.AddObjectArrayItem(rr, "Properties", "Status");

var sfp = Platform.Function.CreateObject("SimpleFilterPart");
Platform.Function.SetObjectProperty(sfp, "Property", "CustomerKey");
Platform.Function.SetObjectProperty(sfp, "SimpleOperator", "equals");
Platform.Function.AddObjectArrayItem(sfp, "Value", automationCustomerKey);

Platform.Function.SetObjectProperty(rr, "Filter", sfp);

var retrieveStatus = [0,0,0];

var automationResultSet = Platform.Function.InvokeRetrieve(rr, retrieveStatus);
//Write("<br>automationResultSet: " + Stringify(automationResultSet));

var ObjectID = automationResultSet[0]["ObjectID"];
var Status = automationResultSet[0]["Status"];

if (ObjectID != "null") {

    output += "<br>" + automationCustomerKey + " ObjectID : " + ObjectID;
    output += "<br>" + automationCustomerKey + " Status: " + Status;

    /*
    Code Status
    -1   Error
     0   BuildingError
     1   Building
     2   Ready
     3   Running
     4   Paused
     5   Stopped
     6   Scheduled
     7   Awaiting Trigger
     8   InactiveTrigger
    */

    if (Status == 2) {

        output += "<br>starting " + automationCustomerKey + " automation";
        var obj = Platform.Function.CreateObject("Automation");
        Platform.Function.SetObjectProperty(obj, "ObjectID", ObjectID);
        var po = Platform.Function.CreateObject("PerformOptions");

        var performResult = [0,0,0];
        var performStatus = Platform.Function.InvokePerform(obj, "start", performResult, po);
        logDE.Rows.Add({"Action" : automationCustomerKey + " starting"});

    } else {
        output += "<br>" + automationCustomerKey + " is already running";
        //logDE.Rows.Add({"Action" : automationCustomerKey + " is already running"});

    }
} else {
  output += "<br>" + automationCustomerKey + " not found";
  logDE.Rows.Add({"Action" : automationCustomerKey + " not found"});
}

</script>
| improve this answer | |
6

Another option:
- copy paste the original automation
- let automation 1 run hourly at .00
- let automation 2 run hourly at .30

That worked for us.

| improve this answer | |
  • Clever and dirty. Thanks, I would not have thought of this. – J.M. Janzen Jun 18 '19 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.