My wishlist for Flows

Prompted by this other discussion on whether or not Flows should be deprecated in favour of better extension development experience, and @Beth ‘s request for my feedback on Flows, I thought I’d do a separate post rather than derail that one.

So here’s my shopping list of the biggest wins my team and I would love to see in Flows to really make them truly 100% awesome:

Manual Flow Trigger buttons in Item page.

Far and away the biggest win for us would be to have the ability to place manual Flow trigger buttons within the layout of an Item page rather than in the right-hand sidebar.

There is a Flow Trigger Bundle extension that attempts to solve this problem, but it’s not currently fit for purpose for the reasons I’ve stated (and others have also found) in this ignored bug report.

Basically, we really need to have the current page refresh itself after the Flow has run (as it already does when triggered from a normal button in the right hand sidebar.)

This one feature alone would have a truly massive benefit on the experience for our users.

Some of our Collections have many manually triggered Flows available and the fact that they are all just in a randomly-ordered list in the side bar is really annoying. Plus you can only really have so many before they disappear off the bottom of the screen.

We would seriously love to be able to put them in the main Item page and have them behave the same way as the normal Flow buttons in the side bar. Please please please can we have this? :folded_hands::folded_hands::folded_hands:

Ability to set the order of the Manual Flow Buttons in the right hand sidebar.

The order that the Flow trigger buttons appear in the sidebar appears to be random. It would be nice to be able to set the order. Not so important if we could put them into the main page instead, but would still be nice. I made a feature request for this.

Character limit in Flow Trigger Buttons

Another niggle with the current Flow trigger buttons is the fact that you’re very limited by the length of the label you can give them. When they do something quite complex, it’s often very hard to think of a short-enough name that will fit on the button and effectively describe what it does to the user. This is realy another argument for being able to put them in the main page view where you’d be free to stick a helpful text notice to the user next to them.

Inconsistant trigger data format.

When you have a Flow that listens to both item.create and item.update, and you want to get the key of the item/s in question, it’s annoying that you have to include logic to handle the fact that $trigger in item.update has the keys in an array as {{$trigger.keys}}, whereas item.create just has a single value as {{$trigger.key}}. I understand the logic behind this (you can’t create more than one item at the same time), but it’s still annoying and would be easier if the key was always in an array, whether it’s a single value or not.

Also, to get the keys in a manually triggered Flow, it’s {{$trigger.body.keys}}. All a bit confusing for new users.

Management of Flows is near impossible without the Flow Manager extension.

In order to effectively manage Flows once you’ve got more than a handful of them in your project, the excellent Flow Manager extension by Bagus Andreanto is indispensable. In my opinion, the ability to group Flows into folders, duplicate existing ones, see a count of logs, and have an overview of how each flow is triggered should all be core features. It makes me nervous that if the Flow Manager extension stopped being maintained for whatever reason, I honestly don’t know how we would cope.

The logs panel needs a “Refresh” button and a “Clear logs” button.

When developing a Flow, the Flows logs are really useful, and I often find myself with one window open on an Item page, and another with the Flow open so that I can make changes on the Item, then check the logs on the Flow.
However, every time you make a change on the item, you then have to refresh the whole Flow window in order to see updated logs which is a pain in the bum. It gets a bit easier when you’ve run it more than ten times, as this paginates the Flow logs, and you can then press next page, previous page to cause the logs to refresh. But having a refresh button would be a huge UX improvement and make debugging a lot quicker and easier. I was sure I’d made a feature request for this but can’t find it now for some reason.

Also, I know we can set the retention period of Flow logs using an environment variable, but that’s a bit of a hidden feature, and a simple button to clear all the logs of a flow would also be very handy.

Documentation examples

When I was starting out with Flows, a few in-depth cookbook-style examples would have been really helpful to have had. Things like how to pass an array of keys to a second Flow and have it run them as a loop, or how to properly use a filter(blocking) flow, modify the payload and leverage the Response Body options, display effective errors etc would be really great for people new to using Flows.

7 Likes

@Burvs firstly, thank you very much for this taking the time to put together this thorough runthrough of your thoughts about Flows. We’ll be adding it to our feedback (alongside the feature request you’ve already opened :folded_hands:t2:) and I’ve also passed along your docs feedback.

2 Likes

Thanks @Beth ! I appreciate this.

1 Like

Can’t agree more on those suggestions :clap:t2:
Nicely done @Burvs

1 Like

I wonder if the current flow ui could be replaced by a library like Drawflow.

Or maybe even go a step further and replace the whole flow system with a block editor like Blockly which could basically serve as online extension editor. When provided with prebuilt blocks and events I think it would still be useable for semi-technical users.

1 Like

All these suggestions are excellent.

I’d love to see more operations available — such as:

  • a Loop operation, that can loop through the items in an array, passing one item on each iteration.
  • a Text Transform operation, that can do simple string transforms like title case, uppercase and lowercase, as well as (regex-based) find-and-replace operations. Can be done with Javascript, but it’s a chore.
  • a Date Transform operation, that can ‘extract’ date components (like ‘year’ or ‘month’), as well as do date operations (like adding or subtracting days/months/years). Can be done with Javascript, but it’s a chore.
  • Read File and Write File operations, that read/write data directly from/to the file system — because sometimes Directus has to interact with/receive data from external systems that cannot/won’t use its API, but can download/upload files directly to the server instead (via FTP, SSH, etc.).
1 Like

You may know this already, but you can do loops by passing an array to a secondary Flow, and it will iterate over them either in serial, parallel or in batches. It’s not my favourite thing to do as it can get hard to manage if you have many flows like this, but it does work.

Having a single operation does this with the same options, would be much easier than having a whole flow for it.

2 Likes