directus icon indicating copy to clipboard operation
directus copied to clipboard

Flows with manual triggers show a success message even when they failed

Open errnesto opened this issue 2 years ago • 10 comments
trafficstars

Describe the Bug

When I manually trigger a flow. And then that flow fails. Directus will show a "Flow {flow_name} ran succesfully" message.

To Reproduce

  • Create a flow with manual trigger
  • add a condition that always fails e.g.
{
    "$trigger": {
        "method": {
            "_eq": "NOT_A_HTTP_METHOD"
        }
    }
}
  • Run the flow via the ui

Hosting Strategy

Self-Hosted (Docker Image)

errnesto avatar Mar 27 '23 17:03 errnesto

Currently the flows only return information that was part of the flow and no meta information if it succeeded. So this would be an enhancement to flows and the text is meant that it ran at all.

Nitwel avatar Mar 30 '23 15:03 Nitwel

Thank you yes that makes sense. So it is not technically a bug, but for a user triggering a flow I think this is missleading. In the context of a flow it ran, but for the user let's say this is a flow named "Publish" what I care about is that the publication was succesfull.

So as an enhancement, maybe it is possible to add a way to dispay a message to the user? (Maybe this is already possible? And I don't know how…)

errnesto avatar Apr 04 '23 13:04 errnesto

Throwing an emoji on this one. I have a few flows that throw errors in specific circumstances (i.e. trying to update status without publish date set, etc).

At the moment, besides sending an email, I don't think there is a way to help the user understand why the flow failed.

Suggestion:

  1. A 'flow failed' notification can be show to user instead of the default "flow ran successfully" notification
  2. Notification has different colour and either does not auto close, or has much longer lifespan
  3. If error message is throw by the flow, message is shown in notification
  4. User can click a 'details' link to view error log

d3v1an7 avatar Jul 27 '23 13:07 d3v1an7

@d3v1an7 I think ideally there's a "format error" operation that'll return an error in the shape the Directus app expects, which it can then in turn render in a proper dialog 🤔

rijkvanzanten avatar Jul 27 '23 15:07 rijkvanzanten

@rijkvanzanten Ah yep, that is even better!! That way there is no change to existing/default behaviour, and given it is an operation, the user can choose when it should be sent. Love it.

d3v1an7 avatar Jul 28 '23 01:07 d3v1an7

Semi-related discussion threads that seem to support the need here, although I can see this one has already made it to the backlog :)

  • https://github.com/directus/directus/discussions/16342
  • https://github.com/directus/directus/discussions/18634

d3v1an7 avatar Aug 16 '23 12:08 d3v1an7

https://github.com/directus/directus/issues/19612 is related, which I considered a bug but I think it's just not supported yet.

ched-dev avatar Sep 12 '23 23:09 ched-dev

Being able to customize the title, message, icon, and color of the toast would be great for user experience.

JonL1 avatar Oct 20 '23 23:10 JonL1