Building out your workflow
The trick when building out a workflow is arranging actions in the right order so that they properly accomplish the task at hand. As you play around with Workflow, you’ll start to notice many workflows follow a similar pattern in how the actions are arranged:
- The first actions in a workflow are focused on getting content into the workflow,
- The middle group focuses on transforming the content into a different format,
- And the last actions often share data out to a service or open it in another app.
These aren’t hard and fast rules, of course; many workflows omit one or more of these steps. But keeping this pattern in mind can get you thinking in the right chronology when assembling a workflow.
Get actions are all about retrieving content and bringing it into the workflow. These are characterized by keywords like “Get”, “Search”, “Find”, and “Select”. Actions like Get Latest Photos, Search Local Businesses, and Find Music look into their respective apps, get content, and then send it to the next action.
Additionally, there are actions that store content directly in the workflow: Date, Street Address, Phone Number, Text, Contact, Email Address, Dictionary, List, and URL. Using these actions lets you pass a specific type of content into another action in your workflow, with the data entered into the action manually or set using variables.
When gathering actions at the beginning of your workflow, try and ask yourself, “What information does my workflow need to retrieve each time it’s run?”. The answer to this question will help you determine which “get” actions you might need. Perhaps your workflow needs to grab photos, music, videos, or Health data stored on your device, fetch content from the Internet, or ask you to enter text with the Ask for Input action.
The next question to ask yourself is, “What do I want to do with the content I’ve retrieved?”. You may need to add transform actions to alter the content as it heads towards your end goal.
As we mentioned in How workflows work, you’ll need pay attention to the lines between actions to help identify the flow of content. In many situations, Workflow will transform your data on its own, as the Content Graph can automatically handle conversions between inputs and outputs. If Workflow doesn’t change the content how you want, however, you can explicity tell workflow to convert the data to another format using transform actions.
Transform actions are often found using keywords like make, filter, convert, and adjust. You might want to use Make PDF on a file in your workflow, change the way a date is formatted with Format Date, use Filter Images by Orientation to separate out portrait shots, or use Make Rich Text from HTML when you’ve gotten a link from Safari.
Other helpful transform actions include Combine Text, Combine Images, Translate Text, Detect Language, Filter Event Attendees, and Filter Files.
Once you’ve gotten and transformed your content, it’s time to utilize sharing actions to send your content to a new place. This is the largest group of actions, including a variety of integrations with other apps and services that widen the capabilities of your workflows. These actions are commonly used towards the end of a workflow, as they often pass the content out and into another app as the final step in accomplishing your goal.
The most straightforward sharing actions are Share and Share with Extensions, which let you bring up the standard iOS share sheet and export your content to another app on your device.
Other sharing actions use keywords like add, create, post, and log for making new items, save and append for working with files, and open for launching other apps.
Adding new items
Many sharing actions are about adding new items, including Add New Reminder, Add New Event, Add to Playlist, Add to Reading List, Add to Instapaper, Add Trello Card, Add OmniFocus Item, Add Due Reminder, and many more.
Other actions create new items in their respective apps, such as Create Playlist, Create Note (in Notes), Create New Note (in Evernote), Create Trello List, and Create Folder in Dropbox.
Some share actions are used for posting content, including Tweet, Post to Facebook, Post on Instagram, Post to Tumblr, Post to WordPress, and Post to Slack.
And a couple share actions are used for logging data, including Log Health Sample and Log Workout.
Actions that work with files use the save keyword, such as Save File, Save to Photo Album, Save to Dropbox, and Save with Transmit. In some cases, it’s also possible to append to existing files, namely with the Append to Note (in Evernote), Append to Dropbox File, Add to Bear Note, and Add to Ulysses Sheet actions.
Sharing actions with the open keyword launch content inside another app, like Open URLs, Open App, Open In…, Open Ulysses, Open Bear Note, and Open Draft.
For example, Open URLs takes any links passed as input and opens them in Safari. Open URLs also supports URL schemes provided by other apps you have installed. Learn more in Using the Workflow URL scheme.
Open App programmatically opens any app supported by Workflow. This could be useful for jumping into an app to copy information, previewing what you just saved, or just easily launching your favorite app.
The Open In… action sends a copy of your work to another app that supports documents. Perhaps you want your workflow to fetch a webpage, convert it from HTML to Rich Text, and then send it to Pages or Word. Open in iBooks is similarly useful for saving PDFs or eBooks in iBooks.
Organizing actions in a thoughtful sequence is key in building workflows that successfully solve your needs. Sometimes along the way of building your workflow, it won’t work as you expect, or you’ll end up with a final output that’s not the content you wanted. Other times, your actions may not accept the output of the previous actions, showing errors.
Figuring out the right sequence for your goal may require experimentation, so it can be helpful to test workflows frequently as you build them out. A good tip for debugging workflows comes from Workflow aficionado, Federico Viticci of MacStories:
While you’re creating a workflow, use the Show Alert and Quick Look actions to debug what is going on – they’re good ways to preview that the correct text or image is being passed to the next action without having to wait until the end for the final output.
Once you’ve tried building out a few workflows and have experimented with the Get-Transform-Share pattern, you may want to learn about the different types of workflows you can create: Today Widget, Action Extension, and Apple Watch.
- Using workflows from the Today Widget
- Using workflows from the Action Extension
- Using workflows from the Apple Watch
Or, if you’re ready, you can skip to more advanced workflow topics, beginning with Using variables.