Retool AI Actions for workflows quickstart
Learn how to use AI Actions in workflows to interact with AI models.
With Retool AI, you can build AI-powered workflows. AI actions enable you to interact with AI models using your data and perform a range of actions, such as:
- Generate, classify, and summarize text.
- Generate images.
- Generate chat responses.
AI actions are available to in both apps and workflows. The following guide explains how to create a workflow that is triggered by a webhook whenever a customer submits a returns request. It uses AI to determine if the customer is requesting a refund or replacement, then responds to the customer with relevant information using Retool Email.
For the purposes of this guide, you can trigger the workflow manually or using a curl
command to simulate the receipt of a message.
To get started, sign in to your Retool organization, navigate to the Workflows tab, then click Create new > Workflow.
1. Configure the trigger
You can configure a workflow to trigger automatically whenever it receives a webhook notification. The workflow can use the data from the event's payload and perform actions with it.
For testing purposes, you can specify a sample payload in the Test JSON Parameters of the Start block. When run manually, the workflow uses this information as an event payload.
- Replacement
- Refund
{
"message": "Subject: Issue with Certain Keys on VelocityX Pro Keyboard Support Ticket: 6000989 Customer Name: John Doe Email Address: john.doe99@notreal.com Shipping Address: 4127 Pine Street, Springfield, MA, 01101 Order Number: 345678-VXP Contact Number: (123) 456-7890 Issue: I received my brand new VelocityX Pro keyboard (Order Number: 345678-VXP) two days ago and I've started noticing that a few keys are intermittently not working while using. The keys R, T, Y, and Enter key are the problematic ones specifically. This is causing me a lot of disruption during my work as I use the keyboard extensively. Troubleshooting done so far: I attempted reinstalling the keyboard drivers and also tried plugging it into a different computer but the issue persists. I request your assistance in resolving this problem. I don't know whether I received a defective piece or this is a more widespread problem with this model. I’m happy to provide you with more information if necessary. Looking forward to hearing from you soon. Regards, John Doe.",
"test": true
}
{
"message": "Subject: Refund Request for Malfunctioning VelocityX Pro Keyboard Dear Support Team, I am writing to you with an urgent issue I am experiencing with the VelocityX Pro Keyboard that I recently purchased from your website. Some keys are not functioning as expected which is highly inconvenient and considerably impacts my usage. Order Details: Order Number: #VX456320 Item: VelocityX Pro Keyboard Delivery Date: June 15th, 2022 The problem began soon after the first few uses. The keys 'Q', 'E', 'J', and 'Space Bar' have stopped working completely, and some others occasionally miss keystrokes. I have tried unplugging and re-plugging as well as checking for drivers update, but nothing has worked. Given the above issue, I can't continue using this keyboard as needed for my daily work. Therefore, I would like to return it and request a refund as per your product return policy. Customer Information: Name: Jane Doe Email: JaneDoe@example.com Phone: (202) 555-0176 Please advise on the return process at your earliest convenience. I would appreciate a timely resolution to this matter, as it is causing significant disruption to my work. Thank you, and I am looking forward to your swift response on this matter. Best regards, Jane Doe.",
"test": true
}
These examples include test=true
to indicate that it's a test payload. This is used to control the recipient email address during testing.