Make AI Agents
AI agent use case
Step 3. Create a scenario to send tasks to the AI agent
1min
in this final step, we create the {{scenario singular lowercase}} to communicate with our agent we will equip the agent with {{scenario plural lowercase}} as tools to perform the agent's tasks list our shop inventory and order more items we will use slack to send tasks to our agent click the create a new scenario button in your organization dashboard or in the list of {{scenario plural lowercase}} add the slack > watch new events module to the {{scenario singular lowercase}} set up the module in the webhook field, select a slack event webhook or click add to create a new one in the event type drop down, select new channel message in the connection field, select your slack connection in the channel field, select a channel you can use for testing the ai agent set the {{scenario singular lowercase}} scheduling to immediately when data arrives click save to confirm the module settings click the module placeholder to add a new module to your {{scenario singular lowercase}} search "ai agent" to get the make ai agent > run an agent module and add it to your {{scenario singular lowercase}} in the agent field, select the agent you created in the ai agent use case docid donhkuw79hf58ddybakv in the additional tools , click add tool add the {{scenario plural lowercase}} to the ai agent's tools click the empty drop down under select scenario the list of {{scenario plural lowercase}} in your team rolls down select the "list shop inventory" {{scenario singular lowercase}} we created in the ai agent use case docid donhkuw79hf58ddybakv use the search row at the top of the selection list to find the {{scenario singular lowercase}} note the {{scenario singular lowercase}} description that appears under the name of the {{scenario singular lowercase}} and the name of the {{scenario singular lowercase}} folder click ok to confirm the selection add the "create buy stock order" {{scenario singular lowercase}} created in the ai agent use case docid donhkuw79hf58ddybakv in the same way click save finish setting up the run an agent module in the thread id field, map a unique identifier to keep the same thread for all communication with the agent this optimizes the context sent to the agent with each module run and allows the agent to keep the history of previous conversations in the message 1 field, map the text from the watch new events module click save to confirm changes add the ignore error handler to the run an agent module sometimes, the agent can take time to respond if the response time gets longer than 180 seconds, the module outputs the moduletimeouterror and {{product name}} stops the {{scenario singular lowercase}} there are more sophisticated options to prevent the moduletimeouterror , but they are not part of this use case if you want to learn more, check the module settings reference add the slack > create a message module after the run an agent module set up the module in the connection field, select your connection in the enter a channel id or name and channel type fields, select values relevant for the channel where you want to send agent's replies and pick the channel in the next field in the text field, map the response from the ai agent click save to confirm changes update the name of your {{scenario singular lowercase}} save the {{scenario singular lowercase}} you should now test your agent send a message to the channel that is watched by the watch new events module that contains the intent for the agent to either send the inventory information or order new stock for example, request the agent to list the current shop inventory check the channel where is the create a message module sending agent's replies you should see a reply from the agent listing the same data as we defined in the data store when we were setting up the {{scenario plural lowercase}} available to the agent