iOS 15 Compatibility: There is a bug in Shortcuts on iOS 15 that prevents syncing of your shortcut library from the Shortcuts to MFC Deck. Until this bug is resolved by Apple (FB9585913), MFC Deck will be unavailable to download from the App Store.
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:
- Action: The action to perform on a recurring basis. Can be a shortcut or an MFC Deck card or deck.
- Interval: Time to wait between triggers. Can be between 10 and 90 seconds.
- Active App: A variable describing the app currently in-use. Set in a shortcut or automation.
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
- Quick Setup
- Using Background Automations
- Advanced
- API and Custom Actions
- Limitations
- Troubleshooting
- Localization
System Requirements
The Running App automation requires the following apps and shortcuts on iOS 14:
Required
- Personal Automations
- MFC Deck 1.1.0 or higher
- Background Automations shortcut
- MFC Deck Helper shortcut
Optional
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
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.
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:
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:
- Run Shortcut: Runs a shortcut.
- Run Deck: Runs all available cards in a given deck in MFC Deck.
- Run Card: Runs a card in a given deck in MFC Deck.
- 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.
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.
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
- Get Apps and Shortcuts
- Shortcut Notification Settings
- Personal Automation Instructions
- Help
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:
- Open Shortcuts.
- Tap Automations.
- Tap the + button.
- Tap Create Personal Automation.
- Tap Low Power Mode.
- Enable both Is Turned On and Is Turned Off.
- Tap Next.
- Add a Text action and enter
RUN
. - Add a Run Shortcut action immediately below the Text action. Set the shortcut to the
Background Automations
shortcut. - Tap Next.
- Disable Ask Before Running.
- Tap Don’t Ask when prompted.
- Tap Done.
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
- Open Shortcuts.
- Tap Automations.
- Tap the + button.
- Tap Create Personal Automation.
- Tap Do Not Disturb.
- Enable Is Turned On and disable Is Turned Off.
- Tap Next.
- Add a Background Automations action.
- Tap Command.
- Choose Set Do Not Disturb State.
- Set the value to true.
- Add a Text action and enter
RUN
. - Add a Run Shortcut action immediately below the Text action. Set the shortcut to the
Background Automations
shortcut. - Tap Next.
- Disable Ask Before Running.
- Tap Don’t Ask when prompted.
- Tap Done.
Do Not Disturb Off
- Open Shortcuts.
- Tap Automations.
- Tap the + button.
- Tap Create Personal Automation.
- Tap Do Not Disturb.
- Enable Is Turned Off and disable Is Turned On.
- Tap Next.
- Add a Background Automations action.
- Tap Command.
- Choose Set Do Not Disturb State.
- Set the value to false.
- Add a Text action and enter
RUN
. - Add a Run Shortcut action immediately below the Text action. Set the shortcut to the Background Automations shortcut.
- Tap Next.
- Disable Ask Before Running.
- Tap Don’t Ask when prompted.
- Tap Done.
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.
- Open Shortcuts.
- Tap Background Automations.
- Tap Set Action.
- Tap Run Shortcut.
- Select a folder where your shortcut is located.
- 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
- Set the Trigger Interval to how often you want the shortcut to run. Enter a value from 10 to 90.
- Set the Trigger Method. Remember, the Low Power Mode trigger only works on iPhones and iPod touch devices.
- Tap Start Background Automations.
- 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:
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
- Using Decks and Cards from MFC Deck
- Setting the Schedule of Shortcuts Using MFC Deck
- Adjust Shortcut Notification Settings
- Shortcut Design When Using Background Automations
- Background Automations Watcher With Pushcut
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
- Open Shortcuts.
- Tap Automations.
- Tap the + button.
- Tap Create Personal Automation.
- Tap App.
- Tap Choose and select one or multiple apps that you want to trigger the Running App Automation.
- Make sure Is Opened is enabled and Is Closed is disabled.
- Tap Next.
- Add a Background Automations action.
- Tap Command in the action.
- Tap Set Active App.
- Enter the name of the app you are opening.
- Tap Next.
- Disable Ask Before Running.
- Tap Don’t Ask when prompted.
- Tap Done.
- Repeat steps 3-14 for additional apps you want to track.
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.
- Open Shortcuts.
- Tap Automations.
- Tap the + button.
- Tap Create Personal Automation.
- Tap App.
- Tap Choose and select all the apps that you added in the Open App Trigger section.
- Make sure Is Closed is enabled and Is Open is disabled.
- Tap Next.
- Add a Background Automations action.
- Tap Command in the action.
- Tap Set Active App.
- Leave the rest of the action blank.
- Tap Next.
- Disable Ask Before Running.
- Tap Don’t Ask when prompted.
- Tap Done.
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:
- Add a Background Automations action to your shortcut.
- Tap Command.
- Choose Get Active App.
- Add an If action.
- Apply your conditional logic for the If action (e.g. Active App is
Notes
or Active App isSafari
).
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:
- Multiple: Multiple shortcuts can be run at once, each with their own input.
- Display: Shortcuts can return output that can be displayed in MFC Deck, in a Home Screen widget, on Apple Watch, or in a Siri voice response.
- Schedule: A schedule can be set for a shortcut, so you can limit how often the shortcut runs within Background Automations.
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:
- Schedule: The days on which the card can run. Specify:
- Every Day: The card will run every day of the week.
- Weekdays: The card will run Monday through Friday.
- Weekends: The card will run on Saturdays and Sundays.
- Custom: Choose the days the card will run.
- Time: What time during the day the card can run. Choose from:
- All-day: The card action can run anytime during the scheduled days.
- Time Frame: Choose a starting and end time. The card action will only run between those times.
- Rate Limiter: Choose how often a card can run. You can choose to delay runs in days, hours, minutes, or seconds. If you try to run a card before the timer has elapsed, nothing will happen.
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:
- Open Settings.
- Tap Screen Time.
- Tap See All Activity.
- Scroll down to the Notifications section.
- Tap on one of the red bars denoting a day’s notifications.
- Scroll to the Notifications section in the day view.
- Tap Shortcuts. If it does not appear in the list, tap Show More.
- Tap Notifications.
- 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.
Shortcut Design When Using Background Automations
The actions in the shortcuts you use with Background Automations should follow these tips and guidelines:
- Use actions that can run in the background.
- Limit your use of asking for user input.
- 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.
- Handle errors gracefully without displaying alerts.
- 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
- Download the Background Automations Watcher shortcut.
- Download the Background Automations Restart shortcut.
- Get Pushcut if you don’t have it already.
- Open Pushcut.
- Tap the + button.
- Enter
Background Automations
as the new notification name. - Enter your own title and body for the notification message.
- Tap Default Action.
- Tap Shortcut.
- Choose Background Automations Restart from the list of shortcuts. If it doesn’t appear, tap Update Shortcuts.
- Tap Done.
- Tap Done.
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:
- Shortcut: Have a Run Shortcut action at the top of your shortcut that calls the Background Automations Watcher shortcut.
- 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.
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.
- Open Shortcuts.
- Tap Background Automations Watcher.
- Adjust the number of minutes to wait before notifying you about the Background Automations process.
- 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
- Background Automations Details
- Background Automations Shortcut Input Commands
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:
- Action (default)
- Trigger Method
- Trigger Interval
- Active App
- Trigger Time
- Do Not Disturb
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:
- 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.
- The Shortcuts app may become temporarily unresponsive after running a lot of background shortcuts.
- 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)
- 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.
- 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.
- 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.
- 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.
- Sometimes Personal Automations stop being triggered. A restart of your device usually fixes this.
Troubleshooting
- 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.
- I am seeing a ton of notifications when Low Power Mode is enabled and disabled. Suppress Shortcut notifications using the technique described here.
- 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).
- 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.
- 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)
- 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.
- Background Automations stop after running for awhile. iOS may have terminated the process controlling the Background Automations shortcut. Restart it again to resume.
- 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.
- 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
- en-US - English
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.
- ar-SA - Arabic
- cs-CZ - Czech
- da-DK - Danish
- de-DE - Deutsch
- el-GR - Ελληνικά
- es-MX - Español
- fi-FI - Finnish
- fr-FR - Français
- he-IL - Hebrew
- hi-IN - Hindi
- hu-HU - Hungarian
- id-ID - Indonesian
- it-IT - Italiano
- ja-JP - 日本語
- ko-KR - 한국어
- nb-NO - Norwegian
- nl-NL - Dutch
- pl-PL - Polish
- pt-BR - Portuguese
- ro-RO - Romanian
- ru-RU - Русский
- sk-SK - Slovak
- sv-SE - Svensk
- th-TH - Thai
- tr-TR - Turkish
- zn-CH - Chinese (Simplified)
- zn-HK - Chinese (Traditional)