Those who've seen the first screenshots of Editorial probably have a rough idea of how its workflow system is set up, but I'd like to explain this in a bit more detail with this article.
Like in Automator, an Editorial workflow consists of a series of configurable actions that are executed one after the other. Each action passes its output (a piece of text) to the next action, which then usually does something with it.1
So what do these actions do? Well, the app comes with a library of almost 50 different ones, ranging from very simple to pretty complex – so here are just a few examples: You can insert or replace text in the editor, select a range, or move the cursor. There are actions for showing email sheets, modal dialogs, or custom HTML in a web view. Various text filters can convert Markdown to HTML, remove whitespace, search for regular expressions, URL-escape characters, do math, and much more.
And then there's the powerful Run Python Script action – you can basically think of this as an embedded version of Pythonista. If you know Python, you know that it has very powerful modules for processing text in the standard library, but you don't have to stop there: Editorial includes Python modules for processing images (including photos in your camera roll), RSS feeds, or even data from web APIs.
If you're not into Python, don't worry, you can do quite a lot with just the standard actions. It's not one or the other either – you can easily combine regular actions with little snippets of Python code where you need them.
In addition to these "basic" actions, there are two types of control flow blocks: If... and Repeat.... An If block can be used to execute some other actions only if a certain condition is met. As a simple example, you might want to make a workflow that inserts a Markdown link with a URL in the clipboard. Before you insert the link, you could check that the text in the clipboard starts with "http:" or "https:".
A Repeat block works similarly, but instead of checking a condition, it repeats the actions it contains – either once for every line in the input, or for every match of a given regular expression. You could use this for example to create a numbered list.
And finally, there are workflow variables. You can see an example of a variable in the screenshot above: the "Clipboard" placeholder is expanded to the actual contents of the clipboard when the workflow is run. A textual parameter can contain any number of variables, combined with regular text, just like a template. The Clipboard variable is built-in, but you can also define your own variables in a workflow to store intermediate results. Clipboard is not the only built-in variable either, there are also various ways to format the current date, the name of the loaded document, selected text in the editor, etc.
To make your workflows more readable, you can assign a custom title to any action, which is especially helpful if you use complex regular expressions or Python scripts, so that you can see at a glance what they do. Any action can be saved as a preset that you can then insert into any of your workflows without having to set up all the parameters again. For example, you could save the entire If block in the first screenshot as a single action, and set its name to "Insert Link".
I've talked a lot about what you can do with a workflow, but how do you actually trigger it? – There are four ways actually:
The most straightforward method is to just select it from the popover that lists all of your workflows. If you have a lot of them, there's also a search field, and you can assign custom icons to make them quickly recognizable.
You can add workflows to the bookmarks bar for one-tap access.2
And finally, you can use Editorial's URL scheme to trigger a workflow from a different app – x-callback-url is also supported for error and completion callbacks.
Using all the possibilities of this system probably won't be for everyone. If you're a tinkerer, you'll have a lot to play with, but if you just want to write, that's fine too. You don't have to use workflows to get anything done with the app, but if you want to, you can open the hood. Maybe you'll just want to change the default subject of the Email action, or you want a separate action to send emails to a specific person. Because it's built as a workflow, you can just change it.
I cannot announce a release date just yet, but if you'd like to learn more soon, you can follow me on Twitter.
Some actions don't use their input or don't produce output of their own, e.g. Play Sound Effect or Set Clipboard Contents. Those actions usually just pass their input through to the next action. ↩
Bookmarks are really just URLs, but because Editorial's URL scheme is so flexible, they can also be used to trigger workflows or to open documents in the editor. ↩
Editorial also has its own snippet system, so you don't have to create a workflow just to insert some piece of text that you often use. ↩