TransWikia.com

Running Automations in 15minute intervals

Salesforce Asked on December 4, 2021

I’m aware of the 2 methods of running the automation so that you can run it more frequently (less than 1 hour)

  • Adding wait periods between SQL activities within 1 automation
  • Cloning the automation and scheduling it to run at the hour/halfhour/etc.

Which method of the 2 has less downsides to the platform performance?

Is using SSJS method better than the 2 above?
Thanks!

2 Answers

For completeness:

One factor has not been mentioned.

I would like to add that automation runs - in theory - are limited by your marketing cloud edition. https://www.salesforce.com/content/dam/web/en_us/www/documents/pricing/mc_email_journey_pricing_sheet.pdf

"in theory", because this limit seems to be there just for SF to have a handle on exploits, but not otherwise enforced. Which is not something I would rely on forever.

E.g. With a corporate edition marketing cloud, you have 45k automations runs per year. You reach this limit with 6 hourly automations (6x24x356 = 43800). Anything that produces multiple runs in an hour of course drastically speeds up how fast you reach the limit. So be a mindful of that with solutions that entail more than one run per hour.

Of course, if you have 1 automation with 1 run / hour but four times the same code, split by 15 min. wait steps, this is still only 1 run. So that is a "better" solution in this one regard. This is not to say it is the better approach in general, as was laid out well.

Answered by Jonas Lamberty on December 4, 2021

I don't believe there's any particularly significant pro or con to either method with respect to "platform performance", given you'd be running the same queries and other activities. The key difference is the process that's initiating those activities. There are significant maintainability differences that are probably worth noting, however.

The first thing you should ask yourself is the length of time it takes to process the queries and other activities that require execution every 15 minutes. A given automation can only have one running instance and any invocations attempted while an instance is currently running will be "skipped". Also bear in mind that the time it takes to execute activities in an automation can vary wildly and is dependent on load on the slot servers at the time, as well as any collisions with other automations that might lock access to your Data Extensions concerned. My recommendation would be that if your activities typically take much more than five minutes to execute, consider running less frequently than every 15 minutes.

Adding wait periods between activities has the advantage of having all your logic in one place. The drawback is that, should one of your activities fail, subsequent steps will not execute. For example, suppose you have an automation with four queries, each separated by 15 minute waits. If the first query times out, your second, third and fourth queries will not be run.

Cloning your automation and scheduling for 0, 15, 30 and 45 minutes past the hour has the advantage of allowing each instance to run independently. If 0 minutes past the hour fails, other instances later in the hour are unaffected. The key disadvantage is that, to a degree, you're now maintaining your logic in four places. Adding supplementary steps to your automation involves updating four separate automations.

SSJS is a potential solution that you might find more manageable. Build your Automation and do not schedule it. Create four identical Automations that are scheduled at different points throughout the hour and contain a single SSJS Script Activity to start your main automation containing the steps to be executed. Your script could look something similar to this:

<script language="javascript" runat="server">
    Platform.Load("core", "1");
    var APIObject = Platform.Function.CreateObject("Automation");
    Platform.Function.SetObjectProperty(APIObject, "ObjectID", "52682de3-95f8-48c4-8174-633d1951ea57");
    var options = {};
    var StatusAndRequestID = [0,0,0];
    var newObject = Platform.Function.InvokePerform(APIObject, "Start", StatusAndRequestID,Options);
</script>

The main advantages of this approach are that if one instance of your Automation fails, subsequent instances are unaffected and the main body of your business logic is maintained by a single automation.

Answered by Macca on December 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP