How to create a make custom app that requires a long time to run on its main endpoint?

Hi all, we are working on an app to make it very easy to create high quality AI generated images via api at 88stacks . We have most of the parts working, but not sure how to complete it.

With our api, we submit a request to /api/v1/invokes/create with the parameter prompt=“an engineer tinkering on his projects in the factory” . That endpoint returns a unique key for later lookup. That is because a job can take 1-20 minutes to process a job depending on the size of the job.
We can use the unique key to then check another endpoint (/api/v1/invokes/results ) to see if the results are ready.
We also have the ability to pass a webhook url that gets notified when the job completes.
I have the integration working so that make.com makes a call and I get back the key and I can use that key. What I am confused about is how to properly use webhooks.
Can I have make create the webhook dynamically when the request is made so that the user get notified? I see there are webhook make.com apis, but I dont see how to tie it together.

Or is the right way to do this to just do some kind of polling to the ready endpoint?
I have read the docs but I am confused as to what is the right way to do this. Any pointers would be appreciated.

Allthough you could create webhooks dynamically for your own apps on make.com, I would just have one webhook set up to receive all the “job is done” notifications and use that as a trigger for the following steps. Collecting the results, sending them out to your user etc. (Assuming you have an emailadress or similar so you can contact your user)

1 Like

I was reading in the docs that a catchall webhook is not recommended. So the user needs to pass in the user/apikey into the webhook ? Wouldn’t that be too hard for make.com users? Im fine doing it, but I think too hard for non-programmers?

Sorry, my bad, I think I get you now: You are creating a make.com app for 88stacks.

That’s above my league I’m afraid – but when I made my only app on make.com (sort of hacked together), my questions got answered through support very quickly. Since you’ll want to release it probably and not just have it as a private app, you’ll have to go through an audit with the make devs anyway.

Most other Apps that use webhook based triggers create them once the make.com user sets up the connection. That’s all I can say :smiley:

1 Like

I think you should create two separate modules- one for sending image and one for checking results. This method is used for example by Eden.Ai for their modules.

1 Like

yes, exactly, its a make.app for 88stacks. I’ll ask them about it.

Hi @88ronn,

I haven’t fully checked the 88stacks API document but since I have created multiple custom apps on Make, What I can suggest is the following,

  1. Your Usual Create API Endpoint, Which will take user input and then return the results with a unique Lookup Key/ID. Since The Job Can take 1-20 minutes, I recommend if possible on your end to pass how long will it take for the job to be completed. Users can then choose on their own to store the lookup key in either Datastore, Online Databases, or Spreadsheet as per their liking.

  2. Fetch Result Module, That user will then pass the lookup keys based on the output of the first Module

  3. Search Results Module, With JOB status and date as filter parameters, this will provide the user with another Module to fetch completed JOB. This will be basically a Search Module, enabling users to search the completed/pending jobs

  4. Webhooks, Basically there will be two ways to do this if your platform supports it,

    • Webhook Modules aka Instant Watch Trigger Modules, If this is supported on the API(which I don’t see), it will allow the user to register a dynamic URL each time a Watch Module is set up. This will then listen to any new job completion and then trigger the APIs. Something like this. When Watch Module is configured, Make will generate unique Webhooks, that will then be registered in your platform, and you can push any updates back the registered URL.

    • Callback URL : IMO, This will be the best way to do it without adding any changes on your API end, Just have a proper message in the module instructing the user to create a new scenario with a new webhook and pass the generated URL to this field, which then can be passed to 88stacks during create module.

hi @Runcorn thanks for the detailed feedback.
I have created the usual create endpoint which then fetchs the result. is it supposed to be in 2 modules as you mentioned?

I do have a search result api, but have not added it as a search result module. I will add this as you suggested.

For webhooks, this is where I want to ask more. I was trying to create an instant watch trigger module so a user can register a dynamic url each time. From what I understand, this is the easiest way for an end user of make to use the platform, is that correct? What code is needed to do this on my backend? I can’t really tell what to do from reading the docs. The callback url is what I have now. For this method, is it correct that a make user would first create the webhook, and setup a scenario with the create endpoint?

And finally, one possible solution I am thinking about is to just release first with callback url and finally do it with instant watch trigger modules, I want to make it as easy as possible for make users to work with 88stacks for api image generation .

Thanks for the help!