Make AI Agents (New)
Create AI agents for different...
Webhook-triggered AI agent
5 min
this webhook triggered ai agent {{scenario singular lowercase}} watches for new data sent to a docid 6npti6yvzkftbszmdl9ey and the agent sends a reply back to the webhook it is ideal for sending data from third party services to {{product name}} prerequisites a https //www postman com/ step 1 add a custom webhook the webhooks > custom webhook module allows the agent to automatically receive new data from any third party service to add the custom webhook module in the {{scenario singular}} builder, click the giant plus in the app search, search for and click webhooks click the custom webhook module in webhook , click add to create a new one in the create a webhook dialog, in webhook name , name your webhook to identify it later optionally, in api keys , create an api key that consists of characters of your choice for additional security copy the webhook url to your clipboard you've now added a webhooks > custom webhook module to your {{scenario singular lowercase}} step 2 test the webhook in postman to check that your webhook works, send a sample request to it from postman this action mimics a real request from a third party service to send the request in postman paste your webhook url and select post in body , add the following configuration { "request" "test", "conversationid" "333333" } in authorization , if you have an api key in key , enter x make apikey in value , enter your api key click send to send the request to the webhook go back to your webhook {{scenario singular lowercase}} to check if you have a successfully determined status below the webhook url this means that the webhook works click save you've now tested your webhook url in postman step 3 add a run an agent module to add a make ai agents (new) > run an agent module in the {{scenario singular}} builder, click the plus icon next to the webhooks > custom webhook module in the app search, search for and click make ai agents (new) click the run an agent module in connection , select an existing ai provider connection or click add to create a new one if you don't want to set up an account with an ai provider, select make's ai provider in model , select a model from your chosen ai provider in instructions , describe who the agent is and what it does for example, "you are a helpful agent who answers questions " in input , map the request value from the webhooks > custom webhook module in conversation id , map the conversationid value from the webhooks > custom webhook module the agent uses this id to remember previous exchanges in the conversation, allowing it to provide contextual responses when the user asks follow up questions the agent treats each new value as a new conversation in postman, you set a random conversation id value click save click save on the {{scenario singular}} toolbar you've now added a make ai agents (new) > run an agent module to your scenario step 4 add a webhook response module the webhooks > webhook response module allows the agent to reply to the webhook request to add the webhooks > webhook response module in the {{scenario singular}} builder, click the plus icon next to the make ai agents (new) > run an agent module in the app search, click webhooks click webhook response in body , enter a simple json response { "response" "\<response>" } to replace the \<response> placeholder, map the response value from the make ai agents (new) > run an agent module toggle advanced settings in custom headers , click add item to define the type of data returned in key , enter content type in value , enter application/json click save click save on the {{scenario singular}} toolbar toggle immediately as data arrives to activate the {{scenario singular lowercase}} , so it's ready to receive incoming data as soon as it comes click save you've now built a webhook triggered {{scenario singular lowercase}} , so any third party service can send data to the webhook and pass it into the agent