Function calling webhooks

Here’s what I’ve successfully build:

  • an openAI assistant that has 2 functions
  • function 1 triggers webhook X in scenario A
  • function 2 triggers webhook Y in scenario B
    (these run sequentially, function 2 returns data fetched in function 1)

What I’m trying to build but doesn’t work:

  • openAI assistant that has 2 functions (same)
  • function 1 triggers webhook X in scenario A using query parameter and router
  • function 2 triggers webhook X in scenario A using query parameter and router

Can someone explain why the second setup is not working?

Hey there,

could you please explain what you mean by a webhook with a query parameter and a router? Maybe share some screenshots and/or code blocks of the current webhooks you are sending and what you are trying to send?

I’m referring to solution where you couple 2 functions to same webhook address but add a custom query parameter so to detect which function triggered the webhook. (this works fine if you only need one of two functions to run once, but not if you need both functions to run in succession), for some reason it can’t trigger the same webhook / run the same scenario a second time (maybe because a webhook response was already fired?)

That’s how webhooks work.

Each request to a webhook runs the scenario in a separate “execution”.

To store data in different webhook runs, you’ll need to use a persistent storage like Google Sheets or a Data Store (instead of Set Variable).

To do this, you can try using the Data store “Add/replace a record” module —

Adds or replaces a record in the data store.

For more information, see https://www.make.com/en/integrations/datastore, and https://www.make.com/en/help/app/datastore in the help centre.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Thanks you for your reply, It looks like the intent of my original question got diluted by screenshot I provided, showing variable setting. Let me give a simplified example that I’ve build to support original question:

Imagine an openAI Assistant called “Search Assistant” with 3 functions:

  • search_subject_data
  • search_subject_images
  • return_subject_search_results

and instructions to search the web for given subject and return search results in json format containing:

  • Subject name
  • Subject description
  • Subject Photo
  • Subject category

in Make scenario called “Search Assistant Trigger”, we add module to call openAI assistant and configure it so each of assistant’s functions is assigned a unique webhook/scenario per function.

  • Function search_subject_data triggers triggers webhook in scenario “SerpApi Google
  • Function search_subject_images triggers webhook in scenario “SerpApi Google Images
  • Function return_subject_search_results triggers webhook in scenario “Search Assistant Results

Then we we call the agent and give it a search subject (let’s say subject = “cat”)
what then happens is that Agent calls both serpApi scenarios and finally calls the results scenario’s to successfully come up with search results.

scenario “SerpApi Google”

So far so good and I could be happy with this solution, However, in my attempt to improve this solution, I attempted to combine the 2 search webhooks/scenario’s into 1.
So imagine the same solution but instead:

  • Function search_subject_data triggers triggers webhook in scenario “SerpApi Search” with query parameter “Google Search”
  • Function search_subject_images triggers webhook in scenario “SerpApi Search” with query parameter “Google Image Search”

What I would expect to happen is that assistant cycles through “SerpApi Search” scenario twice, (1 cycle per function)
But in reality, it calls the “SerpApi Search” scenario only once and seems to return results only based on function search_subject_data (only based on organic results called by search_subject_data function, not based on image results based on search_subject_images function)

So a long way of asking, why is the combined search scenario only called once instead of twice (once per function)?

If you clicked “Run Once”, you can only see it handle the first request.

Try leaving your webhook turned on, and exit the scenario.

Refresh the scenario execution logs tab to update the run history.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

2 Likes

@samliew yes that was exactly it :raising_hands:
I already had a suspicion that I was overlooking something obvious but just couldn’t figure it out: I was using “Run Once”, on all my (turned off) scenarios which literally only let’s them run once :grinning_face:. If I turn on the SerpApi Search ” scenario and run the trigger scenario manually once, the search scenario is indeed called twice.
Thank you for finding the solution

1 Like