Jump to content

Add ways to combine workflows (get results in default search or add a way to pass items between workflows)

Recommended Posts




*************** Please see new thread ******************










Alfred already has the ability to search in many different contexts due to the versatility of workflows, and this is great.


The downside is that the more workflows that you have, the more Alfred starts to lose part of its initial appeal as being a quick way to search everything in one placeFor example, I'd like my pinboard bookmarks to always show up in my default results since they have equal importance to me as the files on my computer. This is just one example of many.


Two possible features that could help:

  1. Allow workflow results to be included in the default search.
  2. Allow items be passed between workflows, to easily combine them into "meta-workflows" and reduce the total number of searches you have.


I understand this is a performance risk, but I don't have the technical knowledge yet to understand exactly how to solve that. I'm grateful that a conversation has already been started in another thread about this, and I think we should continue it here and work together to find the best solution.


In response to one part of that conversation, @Andrew said:


You can already create a workflow and attach it to an input filter (such as a file filter, script filter etc). At this point, it's a 1 to 1 mapping for hotkey to input filter. If there was interest, I'd look at enhancing this so that one hotkey could connect to multiple input filters, and results from all filters would be shown. This would essentially allow you to build a workflow which shows a custom version of Alfred with the specific, highly customised results you'd like.


And @deanishe responded:



Connecting a Hotkey to multiple inputs isn't a bad idea, but it would make more sense, imo, to implement multiple inputs at a lower level, ideally allowing workflows to fetch results (or better yet, arbitrary data) from other workflows.


At the very least, combined inputs should work with a keyword, too.




Now that I think on it, Alfred doesn't actually give you any way to pass around its most important (from a workflow's point of view) data structure — the item.


That's unusual, to say the least.



I think @deanishe is on to something important.


Thank you for considering. :)

Edited by matthew16
Link to comment
Share on other sites

To be honest, I see these as separate things.


If you want to plug a workflow into defaults, say to include Chrome or Pinboard bookmarks instead of Safari ones, I think what you need is a caching layer. Most workflows are far too slow to run side-by-side with Alfred's defaults otherwise.


Perhaps an extra option after Alfred filters results like …and caches them for X seconds?


The more I think about fetching results from other workflows, the more I think it's easier to just call their scripts directly as you would any other external program. You have more control over the environment and input that way. I guess it depends how your write your workflows.


Link to comment
Share on other sites

Regarding caching, perhaps you could create a hidden folder with a custom file type that contains the item json from a result from a workflow. This folder could be added to the Alfred scope and the file type (possibly .item or something similar) could also be added. Actioning the item could trigger the workflow it came from and figure out what to actually do on runtime. The only part not handled is expiration of items as the workflows wouldn't actually run to check if items need to be flushed until an item is called. Ideally you'd want the ability to have these files self delete after some time even if the workflow hasn't been recently called.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...