How to Make a Workflow Run From Both the Widget and the Share Sheet ➝

A great tip from my buddy Matthew Cassinelli, writing for The Sweet Setup:

Sharing from another app using the action extension sends content as input into the workflow, whereas workflows run from the widget don’t have an input. Instead, you can create your own input point by using the clipboard. This way, you can copy something, open the widget, and run the workflow to accept the contents of the clipboard.

Instead of setting up two different workflows for each point of entry, you can also use an input check method that makes a single workflow more dynamic. With this, you use the Count and If actions to count whether there’s an input (1+ items) and, if so, use the Workflow Input coming from the action extension. Or, when there’s no input (0 items), it can use the Clipboard instead so you can run it from the widget as well.

This is one of those neat little Workflow tips that I take for granted when building my own, but I bet there are a lot of users who are completely unaware of it. If you want to build more dynamic workflows that can be run from a variety of locations in the system, this trick is worth learning.

Previous:
Next: