Overview

The Background Automations shortcut and MFC Deck implement a Background event trigger on iOS 14. Use it to run shortcuts, decks, and cards on a recurring time interval throughout the day or when you are in a specific application.

The Background Automations trigger has the following options:

Toggling apperance settings every 60 seconds with Background Automations

Background

iOS 14 introduced several new triggers (e.g. Battery Level and Charging) and updated existing Time of Day trigger so they can run automatically without confirmation. iOS 14 lacks, however, a Background trigger that can run periodically in the background. A native solution may arrive with iOS 15, but until then, this implementation allows you to experience what a Background trigger can offer.

How It Works

Together, MFC Deck and the Background Automations shortcut implement a Background automation trigger by quickly toggling the Low Power Mode on and off. Detecting this quick toggle — as opposed to regularly toggling the setting — permits the creation of a background loop in which shortcuts can run continually in the background.


Table of Contents


System Requirements

The Running App automation requires the following apps and shortcuts on iOS 14:

Required

Optional

Running App automation requirements

Personal Automations

The Low Power Mode and Do Not Disturb triggers are used to start Background Automations. You can also use Open and Close App triggers to set an active app variable that you can use in your own shortcuts.

MFC Deck

MFC Deck transforms your shortcuts into dynamic control decks, Home Screen widgets, beautiful Siri voice responses and Apple Watch cards.

It has custom actions that are needed for Background Automations to work. You can also specify a deck or card to run whenever the Background trigger occurs. Cards have the ability to set their own run schedule and limits, meaning you can create a card that runs a shortcut once every day, only in the morning, or every five minutes.

Note: Background Automations requires MFC Deck version 1.1.0 or higher.

MFC Deck Autocuts Shortcut

This shortcut is used to run all the cards within a deck in MFC Deck. Download MFC Deck Autocuts here.

Background Automations Shortcut

This shortcut is the brain of the Background Automations process. Download Background Automations here.


Quick Setup

  1. Get MFC Deck
  2. Get Automations shortcut
  3. Set Up Automations
  4. Testing

Get MFC Deck

You can download MFC Deck for free from the App Store. To take advantage of Background Automations, you must purchase the MFC Deck Premium In-App Purchase. You can trial MFC Deck Premium for free with a 14-day trial.

MFC Deck Hero

Get Background Automations Shortcut

After downloading and installing the Background Automation shortcut, you’ll see two configuration pages. You’ll be able to choose the language for the shortcut on the second page. Refer to the localization section in this document for the languages that are supported.

When you run the Background Automations shortcut, the following menu will be presented:

Configuring the Running App Automations shortcut

Start Background Automations

Kicks off background automations by quickly toggling Low Power Mode or Do Not Disturb twice. Background Automations shortcut detects this quick toggle, runs the action, and waits before repeating the quick toggle of the assigned trigger.

Set Action

Choose from one of three actions to perform while the Background trigger is repeatedly called:

  1. Run Shortcut: Runs a shortcut.
  2. Run Deck: Runs all available cards in a given deck in MFC Deck.
  3. Run Card: Runs a card in a given deck in MFC Deck.
  4. Run Shortcut from LaunchCuts: Runs a shortcut from a LaunchCuts folder.

With Options 2 and 3, you can configure the availability of cards, which means you can have some shortcuts that run once per hour while others might run once every few minutes.

If no action is defined, nothing will happen when the Background trigger runs.

Setting the action

Set Interval

The interval value is an integer from 10 to 90 which determines how often the Background trigger will be fired. Because of overhead with Personal Automations and running shortcuts, the actual time between triggers ranges from 15 seconds to 100 seconds.

Trigger Method

Set how you want Background Automations to be triggered between Low Power Mode or Do Not Disturb.

Note: If you have an iPad, you must choose Do Not Disturb since iPadOS does not support Low Power Mode.

Setting the trigger method

Reset

Clears out the current action, time trigger, and active app settings for Background Automations. If the trigger is fired (because it was running in the background), nothing ultimately will happen.

More

Tapping More will reveal the following menu options:

Open MFC Deck

Displays a list of decks in MFC Deck. Choosing one will open the deck in MFC Deck.

Get Apps and Shortcuts

Links to the MFC Deck app and the various helper shortcuts required for use by Background Automations.

Shortcut Notification Settings

Instructions on how to adjust the notification settings for the Shortcuts application. Because the Low Power Mode or Do Not Disturb trigger will constantly be firing as part of the Background trigger, you may want to suppress banner notifications from Shortcuts.

Note: Disabling notifications here will suppress all banner notifications from the Shortcuts app created using the Show Notification action.

Personal Automation Instructions

Display a web page with information on setting up the Personal Automation triggers for Low Power Mode and Do Not Disturb.

Help

Opens this web page.

Quit

Exits the shortcut gracefully.


Set Up Automations

Here are instructions for setting up the Low Power Mode and Do Not Disturb Personal Automation triggers.

Note: iPadOS cannot use the Low Power Mode trigger because iPads do not currently support Low Power Mode. Configure Background Automations to use the Do Not Disturb trigger on iPadOS.

Low Power Mode Automation

To run Background Automations using the Low Power Mode trigger, perform the following steps:

  1. Open Shortcuts.
  2. Tap Automations.
  3. Tap the + button.
  4. Tap Create Personal Automation.
  5. Tap Low Power Mode.
  6. Enable both Is Turned On and Is Turned Off.
  7. Tap Next.
  8. Add a Text action and enter RUN.
  9. Add a Run Shortcut action immediately below the Text action. Set the shortcut to the Background Automations shortcut.
  10. Tap Next.
  11. Disable Ask Before Running.
  12. Tap Don’t Ask when prompted.
  13. Tap Done.

Low Power Mode automation setup


Do Not Disturb Automation

To run Background Automations using the Do Not Disturb trigger, you will need to create two automations:

The difference between the two automations is that we are saving the Do Not Disturb state in MFC Deck so the Background Automations shortcut can preserve the status of Do Not Disturb when running the Background trigger event.

Do Not Disturb On
  1. Open Shortcuts.
  2. Tap Automations.
  3. Tap the + button.
  4. Tap Create Personal Automation.
  5. Tap Do Not Disturb.
  6. Enable Is Turned On and disable Is Turned Off.
  7. Tap Next.
  8. Add a Background Automations action.
  9. Tap Command.
  10. Choose Set Do Not Disturb State.
  11. Set the value to true.
  12. Add a Text action and enter RUN.
  13. Add a Run Shortcut action immediately below the Text action. Set the shortcut to the Background Automations shortcut.
  14. Tap Next.
  15. Disable Ask Before Running.
  16. Tap Don’t Ask when prompted.
  17. Tap Done.

Do Not Disturb On automation setup

Do Not Disturb Off
  1. Open Shortcuts.
  2. Tap Automations.
  3. Tap the + button.
  4. Tap Create Personal Automation.
  5. Tap Do Not Disturb.
  6. Enable Is Turned Off and disable Is Turned On.
  7. Tap Next.
  8. Add a Background Automations action.
  9. Tap Command.
  10. Choose Set Do Not Disturb State.
  11. Set the value to false.
  12. Add a Text action and enter RUN.
  13. Add a Run Shortcut action immediately below the Text action. Set the shortcut to the Background Automations shortcut.
  14. Tap Next.
  15. Disable Ask Before Running.
  16. Tap Don’t Ask when prompted.
  17. Tap Done.

Do Not Disturb Off automation setup


Using Background Automations

Once your Low Power Mode or Do Not Disturb automations have been created, you are now ready to try out Background Automations. Follow these steps to run a simple shortcut from your Shortcuts library.

  1. Open Shortcuts.
  2. Tap Background Automations.
  3. Tap Set Action.
  4. Tap Run Shortcut.
  5. Select a folder where your shortcut is located.
  6. Select a shortcut. Choose a shortcut that performs an action without asking for user input. Examples include speaking the time, flashing the flashlight three times
  7. Set the Trigger Interval to how often you want the shortcut to run. Enter a value from 10 to 90.
  8. Set the Trigger Method. Remember, the Low Power Mode trigger only works on iPhones and iPod touch devices.
  9. Tap Start Background Automations.
  10. Tap OK.

Either Low Power Mode or Do Not Disturb will be quickly toggled twice, which will trigger the Background trigger. Your shortcut will run soon afterwards. Then, the system will wait the number of seconds specified by the Trigger Interval and repeat the whole process.

Here is a workflow diagram of the logic behind Background Automations:

Background Automations flowchart

You are free to switch to other apps and use your device as you normally would. As long as you do not lock your device and iOS/iPadOS does not terminate the Shortcuts process or the automation triggers, the Background trigger should continue to operate.


Advanced

This section covers advanced topics with Background Automations:


Active App Variable

MFC Deck’s Background Automations custom action allows you to progammatically set an Active App variable, which you can use to determine what application is running on your device when Background Automations is active.

You can use this variable to do different things depending on what app is currently active.

The Active App variable is frequently set and cleared in the Open App and Close App triggers. Here’s how you set them up.

Open App Trigger

  1. Open Shortcuts.
  2. Tap Automations.
  3. Tap the + button.
  4. Tap Create Personal Automation.
  5. Tap App.
  6. Tap Choose and select one or multiple apps that you want to trigger the Running App Automation.
  7. Make sure Is Opened is enabled and Is Closed is disabled.
  8. Tap Next.
  9. Add a Background Automations action.
  10. Tap Command in the action.
  11. Tap Set Active App.
  12. Enter the name of the app you are opening.
  13. Tap Next.
  14. Disable Ask Before Running.
  15. Tap Don’t Ask when prompted.
  16. Tap Done.
  17. Repeat steps 3-14 for additional apps you want to track.

Open App automation setup #1

Open App automation setup #2


Close App Trigger

Next, we will create a single Close App automation for all of the apps that you will be using with Background Automations. When this automation runs, it will clear the Active App variable in MFC Deck.

  1. Open Shortcuts.
  2. Tap Automations.
  3. Tap the + button.
  4. Tap Create Personal Automation.
  5. Tap App.
  6. Tap Choose and select all the apps that you added in the Open App Trigger section.
  7. Make sure Is Closed is enabled and Is Open is disabled.
  8. Tap Next.
  9. Add a Background Automations action.
  10. Tap Command in the action.
  11. Tap Set Active App.
  12. Leave the rest of the action blank.
  13. Tap Next.
  14. Disable Ask Before Running.
  15. Tap Don’t Ask when prompted.
  16. Tap Done.

Close App automation setup #1

Close App automation setup #2

Using Active App in Your Shortcuts

In shortcuts that run in the background, you can query the value of the Active App by performing the following steps:

  1. Add a Background Automations action to your shortcut.
  2. Tap Command.
  3. Choose Get Active App.
  4. Add an If action.
  5. Apply your conditional logic for the If action (e.g. Active App is Notes or Active App is Safari).

Note: An empty string will be returned if no Active App has been defined.

By using the Active App variable in your shortcuts and automations, you can do different things depending on which application is currently running.

iPadOS and Active App Variable

Currently, only a single text string can be set to the Active App variable. Keep this in mind if you are using iPadOS with Split View or Slideover.


Using Decks and Cards From MFC Deck

Setting the action to run a deck or card from MFC Deck provides a number of benefits:

Information on creating decks and cards can be found in the MFC Deck documentation.

Setting the Schedule of Shortcuts Using MFC Deck

When using the Run Deck or Run Card action, you can configure the Availability settings for each card in MFC Deck to control how often your shortcuts run.

This is useful when you do not want your shortcuts to run every single time your Running App automation runs. The following schedule options are available:

Configuring the schedule

Configuring the rate limiting settings

NOTE: Being able to set the Availability settings for cards is an MFC Deck Premium feature.


Adjust Shortcut Notification Settings

You will notice that when toggling Low Power Mode and Do Not Disturb mode twice or when setting the active app via an Open App and Close App automations, Shortcuts will display numerous notification messages which can quickly add up and prevent you from tapping on UI controls at the top of the screen.

A workaround is to disable banner notifications in the Shortcuts app. To do this, follow these steps:

  1. Open Settings.
  2. Tap Screen Time.
  3. Tap See All Activity.
  4. Scroll down to the Notifications section.
  5. Tap on one of the red bars denoting a day’s notifications.
  6. Scroll to the Notifications section in the day view.
  7. Tap Shortcuts. If it does not appear in the list, tap Show More.
  8. Tap Notifications.
  9. Disable Banners and any other notification types.

NOTE: This setting is remembered until your iOS device is restarted.

This technique disables all notification banners from any of your shortcuts that use the Show Notification action. If you rely on displaying notifications from your shortcuts, consider using the Show Notification action from Toolbox Pro or Pushcut.

Navigating to Shortcuts notification settings

Disabling banner notifications in Shortcuts #2


Shortcut Design When Using Background Automations

The actions in the shortcuts you use with Background Automations should follow these tips and guidelines:

  1. Use actions that can run in the background.
  2. Limit your use of asking for user input.
  3. Menus should offer a quit option that calls the Exit Shortcut action. Dismissing a menu by tapping outside of the menu may stop the Background Automation shortcut from continuing.
  4. Handle errors gracefully without displaying alerts.
  5. Watch out for actions that display error alerts that stop shortcut execution.

Background Automations Watcher With Pushcut

Sometimes the Background Automations process stops for whatever reason. In those cases, you may want to be notified when this happens. If you have Pushcut installed, you can create a Watcher process that notifies you when Background Automations may have stopped working.

Installation

  1. Download the Background Automations Watcher shortcut.
  2. Download the Background Automations Restart shortcut.
  3. Get Pushcut if you don’t have it already.
  4. Open Pushcut.
  5. Tap the + button.
  6. Enter Background Automations as the new notification name.
  7. Enter your own title and body for the notification message.
  8. Tap Default Action.
  9. Tap Shortcut.
  10. Choose Background Automations Restart from the list of shortcuts. If it doesn’t appear, tap Update Shortcuts.
  11. Tap Done.
  12. Tap Done.

Background Automations Watcher with Pushcut

Making the Watcher Run Every Time Background Automations Runs

In order for the Watcher to work, you need to run it every time the Background Automations process runs its action. You can accomplish in several ways depending on the action you’ve chosen for Background Automations:

  1. Shortcut: Have a Run Shortcut action at the top of your shortcut that calls the Background Automations Watcher shortcut.
  2. Deck: Include a card in your deck that runs the Background Automations Watcher shortcut. It’s recommended to place it at the top of the deck so that it’s called first.

Background Automations Watcher

When the notification appears, you can tap on the notification to run the Background Automations Restart shortcut, which will restart the Background Automations process.

Changing the Default Notification Time

3 minutes is the default time that you will be notified if Background Automations are not running.

  1. Open Shortcuts.
  2. Tap Background Automations Watcher.
  3. Adjust the number of minutes to wait before notifying you about the Background Automations process.
  4. Tap Done. ***

API and Custom Actions

MFC Deck offers two custom actions for controlling Background Automations that you can add to your shortcuts. In addition, you can pass certain input to the Background Automations shortcut to control its operation.

Background Automations Action

This action gets and sets various preferences for Background Automations.

Get Action

Returns the action that will be run when the automation is triggered.

Set Action

Sets the action that will be run when the automation runs. Possible values include:

Shortcut Name The name of the shortcut to run.

e.g. Toggle Flashlight

This will cause the Toggle Flashlight shortcut to run repeatedly in the background.

Deck

The name of a deck in MFC Deck. The format is >>>Deck Name where Deck Name is the name of the deck.

e.g. >>>Automatic

This will cause all the cards in the Automatic deck to be evaluated on a repeating basis. Any cards that are available and not hidden will be run.

Card

A specific card to run in a deck. The format is >>>Deck Name>>>Card Name where Deck Name is the name of the deck and Card Name is the name of the card to be run.

e.g. >>>Automatic>>>Speak Time Hourly

This will run the card named Speak Time Hourly in the Automatic deck on a repeating basis.

Get Trigger Time

Returns the last time the trigger method was triggered.

Set Trigger Time

Sets the trigger time. Make sure the date has seconds defined. This setting is used internally by the Background Automations shortcut and isn’t designed to be used by end users.

NOTE: The Get Trigger Time and Set Trigger Time settings are used internally by the Background Automations shortcut and aren’t designed to be used by end users.

Get Trigger Interval

Returns the trigger interval in seconds. The default interval time is 30 seconds.

Set Trigger Interval

Sets the interval between 5 and 60 seconds. This determines how often the automation runs.

Get Trigger Method

Returns the Background automation trigger method.

Set Trigger Method

Sets the method by which the Background automation will be triggered. Currently only Low Power Mode is supported.

Reset

Clears out the action and trigger time values. Use this action if you want to stop Background Automations. If you call this action while the shortcut is operating in the background, you may see an additional quick toggle of the Trigger Method. Because the action has been cleared out, nothing will run and no further quick toggling of Low Power Mode or Do Not Disturb should happen.

Get Active App

Returns the active app string.

Set Active App

Sets the active app variable.

Get Do Not Disturb State

Returns a boolean value for the Do Not Disturb state. Note that this value is not set automatically. You will have to create an automation for Do Not Disturb that sets this state programmatically.

Set Do Not Disturb State

Sets the current state of Do Not Disturb.


Background Automation Details Action

This action returns a dictionary containing all of the settings from Background Automations:

Use this method if you want to get all the settings from Background Automations at once.


Background Automations Shortcut Input Commands

Text can be passed to the Background Automations shortcut, which will be interpreted in the following manner:

Each command is case-sensitive.

REPEAT

Checks that an action is defined before waiting for the duration of the Trigger Interval and quick toggling the Trigger Method. If no action is defined, nothing will happen.

RESTART

Checks that an action is defined before quick toggling the Trigger Method. This command does not wait. If no action is defined, nothing will happen.

RUN

Evaluates the action and runs the shortcut, deck, or card. Afterwards, it waits for the duration of the Trigger Interval before quick toggling the Trigger Method. If no action is defined, nothing will happen.

Arbitrary Text

This will set the Action for Background Automations. If not empty, the Trigger Method will be quick toggled and Background Automations will start.

You can use these input parameters if you want to programmatically control Background Automations in your own shortcuts.


Limitations

Here are a list of things to remember when using this technique:

  1. If a menu is being displayed from a shortcut when the Background Automations is triggered, the menu will be dismissed, your shortcut will stop running, and the Background Automations action will subsequently run.
  2. The Shortcuts app may become temporarily unresponsive after running a lot of background shortcuts.
  3. Enabling Low Power Mode reduces or affects the following features:
    • Display brightness
    • Email fetch
    • Background app refresh
    • Automatic downloads
    • Some visual effects
    • Auto-Lock (defaults to 30 seconds)
    • iCloud Photos (temporarily paused)
    • 5G (except for video streaming)
  4. If you do not suppress notifications from the Shortcuts app, you’ll be receiving a lot of banner notifications as Low Power Mode is toggled on and off.
  5. Sometimes the state of Do Not Disturb variable in MFC Deck does not match the actual state of Do Not Disturb in iOS or iPadOS. This can cause Do Not Disturb to accidentally be turned on or off.
  6. Locking the screen will disable Background Automations from running. You may have to quick toggle Low Power Mode or Do Not Disturb to have it start working again.
  7. iOS or iPadOS sometimes terminates the Shortcuts process running the Background Automation shortcut. You’ll have to restart the shortcut in order to resume Background Automations.
  8. Sometimes Personal Automations stop being triggered. A restart of your device usually fixes this.

Troubleshooting

  1. The Shortcuts app has become unresponsive. When running a lot of background personal automations, the Shortcuts app can get unresponsive. Wait and it will fix itself or crash after some time. You can also force quit Shortcuts to resolve the problem.
  2. I am seeing a ton of notifications when Low Power Mode is enabled and disabled. Suppress Shortcut notifications using the technique described here.
  3. Shortcuts don’t run exactly on time based on their Availability card setting in MFC Deck. Because of the overhead in running the automation and relevant shortcuts, there may be a few extra seconds between shortcut runs (e.g. if you set a shortcut to run every 30 seconds, it might actually run every 35-40 seconds).
  4. The Low Power Mode or Do Not Disturb triggers no longer work. Restart your iOS device. This usually clears up the problem when your personal automations no longer get triggered properly.
  5. My iOS device goes to sleep and Background Automations stop working. Resume Background Automations by going into the shortcut and choosing Start Background Automations or quickly toggling between Low Power Mode or Do Not Disturb (depending on your Trigger Method setting)
  6. I am using Background Automations on iPadOS in Split View or Slideover and I can only set one active app. This is currently by design. Implement how Active App works using Data Jar or Toolbox Pro to use lists if you want to handle multiple apps open at the same time.
  7. Background Automations stop after running for awhile. iOS may have terminated the process controlling the Background Automations shortcut. Restart it again to resume.
  8. Sometimes I see multiple Low Power Mode or Do Not Disturb notifications appear but the action does not run multiple times. This could be a bug in how notifications are delivered to the device. Or it could be the result of multiple instances of the Background Automations shortcut running in the background.
  9. I use the Low Power Mode trigger and it seems to stop background processes, including Background Automations, in an app until I leave the app. If this happens, try using the Do Not Disturb trigger method instead.

Localization

The Background Automations shortcut is ready to be localized in your language.

Native Translations

Machine Translations

Help localize the Background Automations shortcut in your language. Click on the links below to review the file, make your changes, and submit a pull request. Use the English translation as your primary guide.


MFC Deck Shortcuts Gallery