One way to take advantage of the actions available in Workflow is by using the device details you’re able to gather. Whether you’re on cellular or Wi-Fi, have full battery or are on low power, and what specific network you’re connected to can all have an impact on how you’ll get something done.
Located in the Scripting category of actions, these allow you to identify information like the current battery life, network connection, brightness, and screen dimensions.
Using these device details lets Workflow tap into your current context and make your automation tools dynamic depending on how you use them.
Using the state of your device
For starters, it’s possible to view and copy the information about your current device using this workflow. You’ll see the name you’ve given it, the device model and version of the operating system, plus the screen dimensions based on how you’re holding it.
Another handy tool is this workflow: Brightness by Battery. It lets you set the screen brightness based on your current battery life. That way, the lower your battery, the dimmer your screen will be.
This one is particularly useful when using the Run Workflow action, which lets you call it and run it within the course of another workflow. That way, in any of your other workflows where you might want to start saving power (i.e., Get Directions Home), you can have the device dim accordingly.
Another handy tool (that can also be used with Run Workflow) is this workflow: Vibrate Device. It checks which device you’re using to determine whether to vibrate or not. Since iPads don’t have Taptic feedback, the Vibrate Device action won’t work and errors during a workflow running on the tablet.
To get around this, the workflow checks for the device model, and if it isn’t an iPad, it will use Vibrate Device, otherwise it skips past the action.
Use this in your other workflows using Run Workflow, acting as a pre-saved set of actions so you don’t have to add the logic in every time if you want the right devices to vibrate.
Switching depending on your network
The last two examples of device details being useful in your workflows comes from the network connection. You can check the names of the Wi-Fi/Cellular network or the IP address for your device, then change the behavior accordingly using the If action.
The Print or Save workflow is helpful for taking advantage of a printer that might be on your work network. If you’re on your home IP address, it will upload the file to Box so you can store it for later, but if you’re at work it will open up Print so you can get a physical copy immediately.
This second workflow, Now or Later Network, determines whether or not you should download a file, using a similar method to our input check detailed in a previous workflow post on how to make a workflow run from both the widget and the share sheet. The workflow tries to retrieve the Wi-Fi network name and counts the number of items. If there is one, you’re on Wi-Fi, and if there are no names, then you’re on Cellular.
If you’re not on Wi-Fi, it will prompt you to save the link later so you don’t accidentally use up your data cap while out of the house. If you’re on your specially-named Wi-Fi network at home, it will proceed with the download (using the Download File workflow from the Gallery).
These are just a few examples you can use to switch up your workflows depending on specific conditions. Federico Viticci of MacStories also has a great article on controlling the HomePod volume from your phone using the Set Volume action to relay the playback level through AirPlay.
Let us know if you come up with any workflows that use device details in a clever way, or if you have any questions!