Overview
Automation Studio is SFMC's workflow automation engine. Unlike Journey Builder (which automates subscriber experiences), Automation Studio automates backend data operations — things like running SQL queries, importing files, exporting data, and triggering batch sends on a schedule.
Automation Studio vs Journey Builder
| Automation Studio | Journey Builder | |
|---|---|---|
| Purpose | Backend data tasks and scheduled operations | Subscriber communication journeys |
| Trigger | Schedule, file arrival, or manual run | Entry source (DE, API event, Salesforce) |
| Works on | DEs, files, SQL queries, sends | Individual contacts |
| Personalised per subscriber? | No — batch operations | Yes — per-contact processing |
| Best used for | Data prep, ETL, scheduled reports, nightly refreshes | Welcome series, re-engagement, transactional |
A common pattern: Automation Studio runs a SQL query to refresh a segment DE, then Journey Builder uses that DE as an entry source. The automation handles data prep; Journey Builder handles the subscriber experience.
Automation structure
An automation consists of:
- Steps — sequential stages. Step 2 only starts when all activities in Step 1 are complete.
- Activities — the actual work done within a step. Activities within the same step run in parallel.
Example structure
| Step | Activities (run in parallel) |
|---|---|
| Step 1 | SQL: Refresh ActiveSubscriberDE | SQL: Refresh ChurnRiskDE |
| Step 2 | SQL: Build FinalSegmentDE (joins outputs from Step 1) |
| Step 3 | Send: Weekly newsletter to FinalSegmentDE |
Trigger types
| Trigger | When it runs | Best for |
|---|---|---|
| Scheduled | On a defined repeating schedule | Daily segment refreshes, nightly data imports, weekly reports |
| File drop | When a file matching a pattern arrives on SFTP | Triggered by external system sending a data file |
| Run Once | Manually triggered — runs one time | Ad-hoc data jobs, testing, one-off migrations |
Schedule options
Scheduled automations support:
- Hourly — every N hours, starting at a specific time
- Daily — specific days of the week at a specific time
- Weekly — specific day of the week
- Monthly — specific day of the month
Automation Studio schedules run in Central Time (US) by default regardless of your organisation's timezone. Account for this when scheduling time-sensitive operations (e.g. a nightly import at midnight local time may need to be configured as 6am UTC).
Activity types
| Activity | What it does |
|---|---|
| SQL Query | Runs a SQL query and writes results to a target DE |
| Import File | Imports a CSV/TXT from SFTP into a Data Extension |
| Export File | Exports a DE to a CSV file on SFTP |
| File Transfer | Moves or transforms files between SFTP locations |
| Send Email | Triggers a User-Initiated send to a DE or List |
| Filter | Applies a filter to a DE to create a new filtered DE |
| Refresh Group | Recalculates the members of a Group |
| Script | Runs a Server-Side JavaScript script |
| Verification | Checks a condition (e.g. DE has records) and stops the automation if it fails |
| Wait | Pauses the automation for a set period between steps |
SQL query activity
The SQL Query activity is the most-used activity in Automation Studio. It runs a T-SQL query against your DEs and System Data Views and writes results to a target DE.
Setting up a query activity
-
1Create the target DE firstThe target DE must already exist before you run the query. Its schema must match the fields your SELECT statement returns — same field names and compatible data types.
-
2Write and test your SQLIn the Query Activity, write your SELECT statement. Use the Validate button to check syntax. Always test with a narrow date range first to ensure it returns the expected data.
-
3Choose the target actionOverwrite replaces all target DE data each run. Add appends new rows. Update updates existing rows. Add/Update upserts (most common for segment DEs).
-- Target DE: Segment_ActiveUK
-- Action: Overwrite (fresh each run)
-- Schedule: Daily at 6am
SELECT
s.SubscriberKey,
s.EmailAddress,
s.FirstName,
s.LastName,
s.Country
FROM [Master_Subscribers] s
INNER JOIN [_Open] o
ON s.SubscriberKey = o.SubscriberKey
AND o.EventDate >= DATEADD(day, -90, GETDATE())
WHERE
s.Country = 'UK'
AND s.OptInStatus = 'Subscribed'
Import activity
The Import File activity imports a CSV or tab-delimited file from SFMC's SFTP server into a Data Extension. This is the standard mechanism for receiving nightly data feeds from CRM systems, e-commerce platforms, and data warehouses.
Import configuration
| Setting | What it controls |
|---|---|
| File naming pattern | The file name (or pattern with wildcards) that the import looks for on SFTP. E.g. subscribers_*.csv |
| File location | The SFTP folder path where the file is expected |
| File encoding | Usually UTF-8; confirm with the sending system |
| Delimiter | Comma, tab, pipe, or other character |
| Field mapping | Map CSV columns to DE fields |
| Import type | Add & Update, Add Only, Update Only, or Overwrite |
For near-real-time imports, use a File Drop trigger instead of a schedule. The automation fires automatically when a file matching the pattern lands on SFTP. This is much more responsive than a scheduled check and removes the delay inherent in polling schedules.
File transfer activity
File Transfer activities move, rename, or transform files on SFTP. Common uses:
- Move a processed file to an archive folder after import
- Decrypt a PGP-encrypted file before importing it
- Compress/decompress files
- Transfer files between SFMC's SFTP and an external SFTP server
Common automation patterns
Pattern 1: Daily segment refresh + send
Segment_ActiveEngaged DE (Overwrite)Step 2: Send Email — weekly newsletter to
Segment_ActiveEngaged
Pattern 2: Nightly CRM data feed
subscribers_YYYYMMDD.csv into Master_Subscribers DE (Add & Update)Step 2: SQL Query — refresh
JourneyEntry_Welcome DE with new subscribers added todayStep 3: File Transfer — archive the processed import file
Pattern 3: Journey entry refresh
JourneyEntry_Welcome DE (Overwrite)Journey Builder's Welcome Journey entry source checks this DE on the same schedule and injects new contacts.
Pattern 4: Weekly performance report
Report_WeeklySummary DEStep 2: Export File — export
Report_WeeklySummary to SFTP as CSVStep 3: File Transfer — move CSV to external reporting SFTP for pickup by BI tool
Monitoring & error handling
Activity history
In Automation Studio, click an automation to see its Activity History — a log of every run with status (Complete, Error, Running), start/end times, and error messages. Check this regularly for scheduled automations that might be silently failing.
Common errors and fixes
| Error | Likely cause | Fix |
|---|---|---|
| SQL query "Object not found" | DE name misspelled or doesn't exist yet | Check exact DE name; create if missing |
| Import activity "File not found" | File didn't arrive on SFTP, wrong filename pattern | Check SFTP directory; verify file naming convention |
| Query "Column does not exist" | Target DE schema doesn't match SELECT output | Ensure target DE has matching field names/types |
| Query timeout (30 min) | Query too complex, no index on join fields | Narrow date range; add WHERE clauses; create indexed DEs |
| Automation stuck "Running" | Previous run still processing; timeout issue | Wait; if stuck >2hrs contact Salesforce support |
Set up email notifications for automation failures in Setup → Notifications. You'll get an email alert when any automation step errors — much better than manually checking logs. This is one of the first things to configure on a new SFMC instance.