Automation Studio

The automation object: how its steps and activities are arranged, how it starts, how it is monitored and what happens when one of its steps fails.

A private bank receives a file from its core system every night, and the quarterly portfolio report has to come out of it. What Marketing Cloud Engagement object holds that chain of tasks, and what decides when it starts?

What an automation is

Automation Studio automates Marketing Cloud Engagement’s email sends, queries and imports: Help presents it as the tool for building workflows of marketing and data tasks according to criteria you configure.

The automation is its object, and per Help it serves to start a process when specific criteria are met. Building one is two decisions: choosing a starting source, which determines how it starts, and adding the activities that occur when it runs, which can run sequentially or simultaneously.

This page covers that object. The SQL Query activity — what it reads, what SQL (structured query language) it accepts, what it writes, what limits cut it short and at what thresholds it is suspended or its automation deactivated — is the subject of the page on SQL queries over data views: here it is named and linked, never re-explained. And three boundaries of this node: Journey Builder, the engine of journeys; journey entry and exit; and the Journey Builder custom activities.

The steps and what fits in each one

The arrangement into steps orders the automation. A step holds several activities: Help says so of the detail view and of the error timeline, which points to where it happened.

The criterion is Help’s: if dependencies exist between steps, those steps should be executed sequentially to avoid errors, because run in parallel they can give incorrect results. The diagram’s last node draws the consequence from that, and it is this page’s reading. Help does not say that a step cannot begin before the previous one ends: it orders them by dependencies, it promises no sequence.

How activities are arranged across the steps of an automationAn Automation Studio automation is made of a starting source and a series of steps. The starting source is, in Salesforce Help's words, what defines how the automation starts. A step is the automation's unit of arrangement, and Help says that a single step can include several activities, which can run sequentially or simultaneously. An activity is the concrete task the automation runs, for example an import, a query or an email send. Help recommends that, if dependencies exist between steps, those steps should be executed sequentially to ensure proper order and avoid errors, because running dependent steps simultaneously can lead to incorrect results. From that recommendation it follows that each dependency detected opens one more step, which is this page's reading and not a sentence of Help's. The article that documents the Trigger Automation adds a rule inside the step, and it is the only one of this page's sources that states it: two activities in the same step cannot share a target data extension.Starting source:decides how it startsStep 1: several activitiescan run at onceStep 2: what dependson the previous stepEach dependency opensone more step

And one rule that, of this page’s sources, only the Trigger Automation article states: two activities in the same step cannot share a target data extension.

The activities Help documents

The reference article lists them with the name as it prints it.

Activity What it does, per Help
Send Email Chooses and configures a message to send on its own or in sequence according to a schedule
SQL Query Retrieves data extension or data view information according to criteria you set and includes it in a data extension. The subject of the page on SQL queries
Data Copy or Import (formerly Import File) Updates a subscriber list or a data extension from an external file, or copies a large dataset using a data extension as the source
File Transfer Unzips or decrypts a file from a configured file location
Filter Applies a data filter to create a group or a data extension with the records that meet a set of criteria
Data Extract Creates a file to use outside the application, or transforms an XML (extensible markup language) into a delimited file for import
Script Runs Server-Side JavaScript — JavaScript that runs on the server — for tasks in an email or a landing page
Wait Makes the automation wait a specific duration, or until a specific time, before continuing
Verification Avoids unintended outcomes by setting conditions on a data extension used in the automation
Refresh Group, Refresh Mobile Filtered List Reapply the rules of a group definition or the filters of a filtered list to keep them up to date
Report Definition Defines the parameters a report runs with
SMS Activity, Send GroupConnect Initiate an SMS (short message service) message or a GroupConnect message, one of Engagement’s messaging tools
Contacts to Business Unit mapping Maps existing contacts to the selected business units, which the Business Units page defines
Fire Event Signals that new contacts were added to a data extension used as the event source in a journey; that newly added data then enters the journeys whose entry events are configured to detect changes in that source
Journey Entry: Audience Added to the automations that populate Journey Builder audiences; contacts enter the journey according to the schedule set in that automation, and what happens inside is the subject of the journey entry and exit page
Send Salesforce Email Initiates a send from a Sales or Service Cloud account

The last three require additional provisioning, and Help refers you to the account executive.

Two carry a detail that gets forgotten. The Verification only works inside an automation, is not reused, and admits no company in its step: several Verification activities yes, no other kind. And its logic is easily read backwards: it acts when it detects that the conditions you set are met, and it can then stop the automation, notify, or both. The condition describes the case to be caught, not the good one.

The Wait touches the schedule, and here you must not generalise. With a Wait in progress, the new run that arrives — scheduled or by file drop — is skipped, because an automation must finish its own run completely before subsequent ones begin. For a different cause the outcome is the opposite: on exceeding the duration limit, the one running stops by itself as the next scheduled occurrence begins, and that limit with its figure is documented by the page on SQL queries. No source covers an overlap that is neither of those two.

And one concurrency limit: up to 40 simultaneous filter and query activities; those over the limit are queued.

How it starts: the three starting-source types

A starting source defines how an automation starts. There are three types and the difference is what fires it.

Type What makes it start What is worth knowing
Scheduled Automation A schedule you define It has to be activated to run, and its duration must be compatible with its schedule
File Drop Automation The upload of a file to the Enhanced FTP (file transfer protocol), to the Import or Triggered_Automations folders or a subfolder of them It does not read extensions: it ignores whatever follows the final dot. Seven file types do not start it: .bmp, .eml, .jpg, .jpeg, .pdf, .png and .xml. Each Enhanced FTP folder supports only one, except with a file name pattern. And changing a file’s name without changing its content does not start it
Trigger Automation The upload of a file to an external location such as Amazon S3, Google Cloud Storage or Microsoft Azure Blob Storage, with a trigger API (application programming interface) request It does read extensions, and requires them with the Equals and Ends With operators. Help warns that folders holding more than 10,000 files cannot be operated with

Of the two file-based types Help says the same thing separately: they are queued by default, and when the running one completes or fails, the next file starts the next one; with queuing off, the rest are ignored while one is running. Of the file drop it adds a permanent effect: on pausing or deactivating it, instances in the QueuedFile status retain that status permanently. And a gap remains: no source says what happens to a queued file when the running one is inside a Wait, the case where it rules that the new run is skipped.

Help writes that place two ways, Enhanced FTP and Enhanced SFTP, with no article carrying a date nor being more specific; this page writes Enhanced FTP and records the fact. And two similar names must not be confused: starting source belongs to the automation, entry source to the journey.

How it is monitored

The overview page shows up to 50 automations in the account, with their activities, the run history and the folders; Help does not say whether those 50 are a per-account maximum or only what fits there. Two views: List, which fits more without detail, and Detail, with the abbreviated design and the errors.

The history lives apart, on the History tab, with a limitation: it shows only completed runs, not the ones running or scheduled. Help proposes reading it for low success rates, which it investigates with the _AutomationInstance and _AutomationActivityInstance data views, and for automations with many skipped runs or many runs.

Of the twelve statuses Help publishes, these say the most when diagnosing; the selection is this page’s.

Status What it means, per Help
Building It is being edited and cannot run
Paused It was manually paused and will not run again until it is reactivated
Stopped It was stopped during its most recent run
AwaitingTrigger It is waiting for a file drop or a trigger to start
InactiveTrigger It has a file drop or a trigger and will not run again until it is reactivated
Skipped It was skipped; rerun it if needed, and otherwise it runs the next time it is scheduled

For any of this to arrive by email, an address goes in Notification Settings, on the Activity tab: it notifies you when a run is skipped, errors or completes, and the Event Notification Service (ENS) also serves. That same address, in its Runtime Error or Skipped Run box, receives the alert that the system deactivated the automation.

When a step fails

Four of the six errors below say the same thing, that the file is not where it was expected or is not the expected one; the other two are about frequency and duration.

Error What it means What Help suggests
Import failed: File {{filename}} not found The source file is missing, or none matches the file naming pattern Check that the file’s pattern matches the one configured and that it was dropped in the intended location
Invalid File Age The file’s timestamp is invalid, or a setting prevents processing files of that age Make sure it is not older than the age limit, or change that limit
We couldn't import your file. Verify that the file … contains data The file carried no data Confirm that it has data
We couldn't import your file because the last import occurred less than … ago The previous import ran too recently Wait the MaxFrequencyHours value or shorten it
We couldn't import your file. Verify that the field mappings are valid The field mapping was invalid Check that the file’s columns match the mapping
Extract took too long to run The extract took longer than the system allows Reduce the dataset: less date range or fewer records

With something already running, each control does something different.

Control What it does to the run in progress What it does to the schedule
Stop, on the Workflow canvas The activities of the step in progress complete, but subsequent steps do not start; any sends running are canceled separately, from Tracking —
Pause If it is running, it continues There will be no future scheduled runs; it comes back with Active on the Schedule tab
Skip Next Occurrence — It skips the next run without stopping the schedule
Editing while it runs, from the three configuration articles It stops it It leaves future runs paused until everything is saved

To resume what was left half done there is Advanced Run Once, which runs only a portion — an entire step, individual activities or a combination — and restarts from the one following the activity that errored. Only scheduled automations support it, so one that starts from a file has no such selective rescue. And it carries a trap: a Completed status can mean that only the selected activities completed.

Example: a private bank’s quarterly portfolio report

A private bank’s core system drops a file with the positions every night. Its client identifier, a Text field, is the contact key, and contact key and subscriber key are the same value. The case is invented. There are two automations, because the load is nightly and the send quarterly: separating them is this page’s proposal, and the ordering of the nightly one’s first two steps is what Help documents for a file-drop scenario.

The nightly one, which prepares the data:

  1. Starting source: File Drop Automation over a directory inside Import, with a dynamic file name pattern by date.
  2. Step 1: File Transfer, which prepares the file if it arrives compressed or encrypted.
  3. Step 2: Data Copy or Import, with its import definition, which sets its behavior on each run.
  4. Step 3: Verification, alone in its step, with the condition written about the faulty load — the table with no rows — and the action of stopping when it is met.

The quarterly one, scheduled, which builds the audience and sends:

  1. Step 1: the query that builds the audience: the page on SQL queries documents it, with its statement and its target table, and this example does not redo it.
  2. Step 2: Send Email over that table. What about it cannot be undone is covered by the Data Extensions page, and that its key carries the client identifier follows from the equivalence between contact key and subscriber key.
  3. Notification Settings with an email address on both, before activating them.

And when step 2 of the nightly one fails because the file arrived empty: the error names it, the timeline points to the step and step 3 stops it, which is what it is there for. Starting from a file, it has no Advanced Run Once: it recovers by dropping the file again, or with Run Once over the whole automation, repeating the transfer. The selective one belongs only to the quarterly one, because it is scheduled.

When an automation, and when something else

The criterion in each row is Help’s; the arrangement is this page’s.

Situation What Help indicates
A process that has to start when a criterion is met This is the case for an automation
Moving a large dataset from an external file or another table The Data Copy or Import activity, which Help presents as the way to manage transfers without complex SQL queries
Checking the data before the automation carries on The Verification activity, which can stop it
Several automations each with many runs Help suggests considering combining them
An automation that often skips runs It suggests considering modifying its schedule so it has time to complete

Before production

  1. Dependencies in separate steps and, per the Trigger Automation article, no pair in the same step sharing a target table (see “The steps”).
  2. The starting source with its considerations — activation if it is scheduled, the file type if it is file drop, the trigger API if it is trigger — and the duration measured against the schedule, counting the Wait activities (see “How it starts” and the activities section).
  3. Queuing decided deliberately if it starts from a file, knowing that pausing leaves QueuedFile instances that way permanently (see “How it starts”).
  4. A Verification in its own step before the first send, with the condition written about the case to be caught and the action of stopping when it is met (see the activities section).
  5. Notification Settings with a real address, the same box as the deactivation alert (see “How it is monitored”).
  6. The History tab located, which shows only completed runs, and a check on whether there is Advanced Run Once, which only scheduled automations support (see the two sections above).

Official sources

Back to the knowledge base