Create our own API quotas + genrate key in front-end

I want to expose a lot of Workflow API for external cutomers, but I’m facing 2 limitations:

  • I can’t generate dynamically API keys
  • I can’t apply quota for these API calls

So I tried to achieve this:

Basically, the Endpoint API immediately triggers the VERIF custom event which verifies the key, quota,… If everything is alright, the process continues up to the first workflow which returns data.
But I can’t make my workflow stop if the key is invalid because using “Terminate this workflow” in a custom event seems to stop the custom event instead of all workflow. Same for the “Return data from API”

What will you do?
And if possible in a way that keeps the workflow pretty light because it needs to not drain the performance :frowning_face:

This will be a perfect gift for my Chrismas :grin:
Merry Christmas!

nearest i’ve seen would be this The BEN Stack - Bubble, Express, Node by @brentsum

hey @vnihoul77 - let me know if you’re still needing help with this. It involves code, but my recommendation as @Bubbleboy mentioned would be to use Express + Node to put your Workflow API in a custom API wrapper. That way you can use your own key system and quota system that can pull from the DATA API to get values and return only what you’d want.

1 Like

@Bubbleboy @brentsum

Thanks, I took a look, and it seems the perfect solution to the issue.
However, I don’t have any skills in Express and Node …

In the meantime, this is how I achieved it using only workflows:

It works very very well and offers a lot of “easy customization” but I think it’s definitely not the best idea for performance and speed…

1 Like