Mastering OpenAI Function Calling in Make.com (Formerly Integromat)

First of all, here’s the templates we use throughout this demo (it’s free, of course).
Function calling is a way to ask for a JSON formatted text that follows the structure you provide your Assistant with. I always thought it wasn’t possible in Make.com because you generally have do some coding to make it happen.
But then, I found this:
https://make.com/en/app-improvement-ideas/p/openai-assistants-function-calling-tool
After many requests from the users, Make finally introduced function calling in the Message Assistant module!
Hi all, we just released a new version of the “Message an Assistant” module that enables function calling in the following way. The module loads the input parameters for your function where you could post a URL to which we will make a POST request. It is particularly handy to for example call another Make scenario via webhook, but we are sure you will be able to find more use cases. Let us know what you think!
Everything seems to be in place… until you see these comments.

And I think they are absolutely right. The functionality is there, but it’s pretty confusing because we can’t find a well-documented guide or anything. But I guess that’s exactly why you are reading this post, and I’m going to walk you through the entire process and try my best to help you understand how to do function calling in Make.
Setting up an Assistant
First and foremost, we need to set up an Assistant on OpenAI Platform. Let’s create one from here if you have’t yet.

For this demo, I’m going to create an Assistant that writes a summary of all the webpages provided by the user in bulk. Here’s how it works in a nutshell:
- User sends a list of URLs
- Assistant reads through all of them
- Assistant writes the summary
As you read through this post, some parts might not make sense, but I promise it all makes sense once you reach the end.
Now, back to the Assistant set up.

Here, we need to write a JSON schema. This JSON schema is basically the structure of the JSON that the LLM will use to extract some information from the user input and organize it in the specified format.

In my case, I’m expecting a user input like this:
https://hideyuki-shibata.medium.com/how-to-do-polling-with-make-com-formerly-integromat-7f2b23657e4a
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-essential-functions-to-level-up-your-game-formerly-integromat-73bea3160233
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-a-secret-hack-that-reduces-scraping-time-significantly-advanced-59ec8dacd896
It’d be nice if the user input is always clean like that, but there will be cases where things like this happen:
https://hideyuki-shibata.medium.com/how-to-do-polling-with-make-com-formerly-integromat-7f2b23657e4a
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-essential-functions-to-level-up-your-game-formerly-integromat-73bea3160233
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-a-secret-hack-that-reduces-scraping-time-significantly-advanced-59ec8dacd896
https://hideyuki-shibata.medium.com/how-to-do-polling-with-make-com-formerly-integromat-7f2b23657e4a
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-essential-functions-to-level-up-your-game-formerly-integromat-73bea3160233
https://hideyuki-shibata.medium.com/web-scraping-with-make-com-a-secret-hack-that-reduces-scraping-time-significantly-advanced-59ec8dacd896
Your users can be very unpredictable, and you can’t assume your users will behave the way you want. So, we need a way to organize the input into a structured format. Something like this in my case:
{
"links": [
"https://hideyuki-shibata.medium.com/how-to-do-polling-with-make-com-formerly-integromat-7f2b23657e4a",
"https://hideyuki-shibata.medium.com/web-scraping-with-make-com-essential-functions-to-level-up-your-game-formerly-integromat-73bea3160233",
"https://hideyuki-shibata.medium.com/web-scraping-with-make-com-a-secret-hack-that-reduces-scraping-time-significantly-advanced-59ec8dacd896"
]
}
Organizing the user input into an array will let me beautifully iterate through each link in a later step.
The question is, how do we create a JSON schema out of this JSON sample that we have just created? If you know how, there’s no problem. If you don’t know how, there’s no problem.
Let’s ask OpenAI for help:

Now we have this JSON schema:

Hit Save and we’re done!
Setting up two Make scenarios (Yes, not one)
Now, let’s move onto Make. The most important thing here is that we are creating two scenarios.
- A scenario that talks to the Assistant
- A scenario that takes the JSON created by the Assistant and perform some actions using the data.

First scenario: A scenario that talks to the Assistant

How you take the user input depends on your use case. What we all have in common is how we set up the Message Assistant module. If you select the Assistant you have just created in the module pane, the function field pops out and you are asked for a URL.
I know. What URL?
Second scenario: Webhook-based scenario
If you are trying to do function calling using Make, I think you are proficient enough in Make to know how to use webhooks.

This webhook URL is what we are after! We’re going to be building our second scenario now, but first of all, copy this webhook URL and paste it into the Message Assistant module of the first scenario.

The first scenario is going to send this webhook URL to the Assistant so that the Assistant can post the JSON it generates to this webhook URL.
My second scenario looks like this:

It expects the input to be in the following format:
{
"url": [
"https://...",
"https://...",
"https://...",
"htt...
]
}
Notice how this is exactly the format I created earlier in this post. The Assistant will try to generate a JSON that follows this format first. Then, it posts the JSON to the second scenario, waits for the response, and finally creates a message based on the response returned by the second scenario.
Let’s take a look at the first scenario I’ve built. It’s just a demo so it’s very primitive, but it does the job.

I have a weirdly unstructured userMessage
here, but we’ll let the Assistant take care of the unstructuredness.

Let’s see it in action
Let’s turn on the second scenario, and then run the first scenario. Notice how the second scenario magically starts running once you run the first scenario. It’s your Assistant triggering the second scenario!


That’s a wrap!
I hope that was detailed enough. Function calling is not necessary in many cases as far as I know, but is useful in some cases. I hope this guide helps you step up your automation skill 👋 Do let me know if you have a question.