Workflow: Automation for Everyone

By now you don't need an introduction to Workflow, the app that brings a mouthful of possibilities to automation for iOS. If you still don't feel 100% confident after reading the review on MacStories, this article will show new tricks, workflows and review the coolest actions that popped up on Twitter.


At first I'll show actions derived from workflows you may have stumbled upon the web. Seth Clifford built a workflow to annotate, share and then delete screenshots. His action sends the annotated screenshot to the clipboard before prompting for the share sheet. Removing that and making another improvement to use variables and you have my version.

Spinoff from Seth Clifford's action.

In his review, Viticci created an action to Google the current song for its lyrics. I know he's a big fan of MusiXmatch, so I built a workflow that searches for the current song in the MusiXmatch app so you can sing Taylor Swift out loud1.

Baby, I'm just gonna shake, shake, shake, shake, shake. I shake it off, I shake it off.

This spinoff is pure nitpicking, Vic Hudson built this outstanding workflow to share the podcast you're listening from Overcast. It downloads the artwork and everything and I think it is the smartest Workflow action this week. I modified one thing: a last call for the Get Variable action to pick the Tweet Items variable. Get it here.

Sharing the podcast you're listening

I'm raising attention to this because several actions I've seen fail to comprehend how the cascade works in Workflow: the input is whatever came before. If you set Add to Variable, the input for the next action will be that variable. Whenever you're in doubt, use the View Content Graph to find out your input and what you can do with it.

While on nitpicking, we're back to Viticci and his workflow to Save to Evernote and Share, notice that the workflow uses the Ask for Input to prompt for the title of the note. You don't need that. Workflow fields are flexible and accept some specific parameters, if you set its value to "Ask When Run", you still get a prompt in context. You can get my version of Viticci's workflow here.

Workflow fields can have prompts for input built-in.

Bonus Actions and APIs

Enough with the nitpick, I created two simple actions I want to share with you so we can warm things up a little. The first one sends the current clipboard to the first device using Command-C. Sounds silly, but until Command-C gets its own share extension, this is a great way to send the clipboard from any app and you can install it here.

Building extensions to apps that miss them.

The other is based on Screeny, an iPhone app that lets you triage through your screenshots. It doesn't work on the iPad and since that's where I take most of my screenshots, I had to do something about it. The action is not as smart as the original app, but gets the job done and you can get it here.

Cleaning up the screenshot bloat.

Next, we're replacing bookmarklets. The one I built to open a Twitter profile on Tweetbot was recreated by Flo Gehring. Notice that once again, the first action to Get URLs from Input is unnecessary when you run it from Safari and you can safely remove it if you only intend to use it that way.

Up next, the Evernote Webclipper. The challenge was to run this action without ever leaving Safari, so I couldn't appeal to Drafts or even Evernote. The core is still the same, grab the current URL and process it through Brett Terpstra service Marky the Markidownifier, sending the output to Evernote.

This action has its flaws, but is much better than a bookmarklet.

There's one issue to this new Webclipper since Workflow can't pass HTML to Evernote, the HTML will be parsed as plain text. Also, Workflow lacks a Markdown to HTML2 action, but since it wouldn't work in our case, we use Make Rich Text from Markdown instead. Rich text scraps code tags from the content and outputs them as regular text, therefore, this workflow won't result in the same output as the original bookmarklets. You're probably scrolling through the page looking for a link, so here we go, you can download the Workflow-Evernote Webclipper here.

The Challenge

Reader Alessandro Rodolico made a request to replace one of his Pythonista scripts for Workflow. The script he mentions converts private links to Evernote notes into links to open the note in the official app instead. One of the rules is that it had to do everything without leaving the app he's at.

Creating a new note and getting its link takes two actions, however, Workflow gives you a short link and you can't convert it to a direct url in the app. I could use Clean Links to expand the url, but that would leave the app and break the rule, so I found an API that plays nice with Workflow to do the work for me.

Before we move along, I need your help with something. Links to the Evernote app require a code from your private links, unfortunately, I can't get it for you. Open any note in the Evernote app, tap for More, then Share and Copy Link. Choose Private Link in the prompt and paste it in a text editor, you'll get something like this:

You're looking for that 8-digit bit, 12345678 in my example. Set the Text action that sets the privateCode variable to the value you got and we're ready to go.

Follow these steps to get your private code

The longer URL requires some editing and we run a regular expression with the Replace Text action to get what we want. Workflow allows you to reference strings matched in the expression into the outcome, you create a group by wrapping a part of the regex in parenthesis, then you can set this value in the replacement anywhere you want with dollar sign followed by the index of the group, $1 collects the first group, $2 the second and so on.

Afterwards, we trigger the Share with Extensions action, so Alessandro can create a new Omnifocus task and set the Evernote link as a note to keep up with his studies. You can install this action here.

List of Actions

Making actions cool again

Automation for iOS is not the most popular category for apps, mostly because of the difficulty to build actions, challenge developers battle release after release to minimize. Workflow's wide adoption and warm reception3 makes its biggest merit.

Workflow is an achievement when it comes down to make iOS automation accessible to more users. I'm certain we'll have more improvements in the future and that Apple will loose its leash to let us take control of our most personal devices.

  1. Tom Hepelis pointed out that you can open the current song in MusiXmatch much easier using mxm://view:nowplaying. I think this renders the action in this article useless, but I'll let you decide that. 

  2. You can convert Markdown to HTML by applying the Make Rich Text from Markdown and then Make HTML from Rich Text. The results are good. 

  3. For everyone but Apple.