Custom events are really cool, but they lack the ability to return values (like a custom state on an element)
CONTEXT
I am manually authenticating API requests to an API workflow in the backend. What I would like to do is create a custom event called “Authenticate” which would return a “yes” or “no” value depending on if the API request meets the authentication requirements I have defined. Based on the result of the event, I want to either reject the workflow or to run the rest of the actions.
THE PROBLEM
there is no way to return values from custom events. Instead, you must do the following:
- API workflow runs custom event (let’s called it custom_event_1)
- Inside custom_event_1 you run the authentication process, then if everything works out you then run a new custom event (custom_event_2)
- Inside custom_event_2 you run the actual actions you wanted to take in the original API workflow
A BETTER WAY (REDUCE REUSE RECYCLE)
A way better way of doing this executing actions depending on the returned values from the custom event. This would let users reuse their custom events (in my case, authentication process) for all of their front and backend workflows by leveraging parameters and return values.
Right now I can’t reuse this custom event, because I had to hard code custom_event_2 inside custom_event_1
I want to run the same authentication workflow for ALL my webhooks. Now, I need to create several custom events that all do the same thing …
Let me know what you guys think