Description Transcript
Retool Workflows let you automate your workflows, connect to dozens of databases, third-party services and APIs, and ship it all in a single click.
Ready to learn how to build automations with Retool Workflows? We'll explore the Workflow IDE, add logic blocks, set triggers, and create end-to-end sequences that connect to your data and run on schedules or webhooks.
Our Developer Advocate Angelik Laboy Torres will demonstrate how to build automated workflows in Retool using triggers, loops, resource queries, and AI Actions. By the end of this video, you'll have the knowledge you need to create your first workflow and publish it for use across your apps.
In addition, we will:
Look at the Workflows interface in Retool
Demonstrate how to build an automated email workflow
Show you the ins and outs of Retool, from Agents to AI
How to Build Automations with Retool Workflows
00:00 - What are Retool Workflows? Automation Basics
00:49 - Tour of the Workflow IDE & Canvas
02:01 - Understanding the Start Trigger
02:25 - Left Panel Essentials: Libraries, Functions, & Code
03:49 - Building a Resource Query (Retool Database)
05:22 - Exploring Blocks: AI Actions, Agents, & Custom Code
08:05 - Using Loop Blocks for Email Automation
10:34 - Setting Triggers: Schedules, Webhooks, Kafka & SQS
11:50 - Running, Debugging & Viewing Logs
12:21 - Publishing & Deploying Workflow Versions
Useful Resources:
Read more 0:02 Hi, my name is Angelik Laboy Torres, I'm a Developer Advocate here at Retool and today 0:07 we'll get started with building workflows. 0:11 Many times we have repeated or background processes like publishing content, handling 0:17 onboarding of our teammates, or doing customer requests, tasks that happen regularly in the 0:23 same order. 0:24 A workflow is simply a series of steps that happen the same way from start to end. 0:28 It's like a checklist that delivers consistent outcomes every single time. 0:34 Now, Retool Workflows allows you to build complex automation that interacts with any data source, 0:39 transforms data, uses AI, or is able to do what it help triggers as well as custom scheduling. 0:49 Okay, so what we have right here is our Retool space. 0:52 And if we go into the Navigation Bar, you can see Workflows up in there. 0:55 So we'll click on it. 0:56 And this is where all of your organization's workflows will assist. 0:59 The best thing is that you can duplicate or reuse them across other apps as you build them in your 1:04 organization space. Now let's go and click on create new and then click on Workflows. 1:11 This is now going to open up our workflow IDE, which is a visual canvas to build automations. 1:17 And it has four main stages. Firstly, of the canvas, which is where you would arrange your 1:23 blogs in order to build your workflows. Then you have the left panel. And as you can see, 1:27 there's many different tabs in here. Some of them include blocks, triggers, as well as configuration 1:33 options. From there, you also have the toolbar, which is where you can rename your workflow. You 1:38 can either run them or publish them, do different versions of them as well. And then lastly, you 1:43 have the status bar, which is where you would do the version control of your environments, 1:47 whether you want to work on staging or production. It's really cool. You can even add more. You can 1:52 You can also see the version and then how many times this workflow has run and what were the results of them. 1:58 Cool. 1:59 So let's close this over here. 2:01 Now, one thing about Workflows is that they always start with a start trigger. 2:05 And this is actually going to define how your workflow runs. 2:08 So you can notice here actually from this interaction, how blocks are connected to one another. 2:13 There is support and you can drag from there to create another block in order to create the next step of your automation sequence. 2:22 Now, let's go back to the left panel over here. 2:25 And let's start talking about the essential tabs 2:28 that you can see in order to configure your workflow. 2:31 So in the plus icon, you have all the blocks available to you. 2:34 We'll cover them in a second. 2:36 So you can add them into your canvas, right? 2:39 The same way that you can vote an agent, et cetera, et cetera. 2:43 From there, you have the outline, 2:45 which is allowing you to see all the different blocks 2:48 in your workflow. 2:49 This is particularly helpful as you start creating huge connections to one another and 2:53 you have a lot of branches and you just kind of want to see like a drop down of everything 2:57 in the canvas itself. 2:59 Then you have functions, which allow you to create reusable logic that can be called by 3:05 other blocks. 3:07 Then you have triggers. 3:08 This can be there to configure a webhook or schedule it at a very specific time. 3:15 Then you have, well, the code search, right? 3:18 Searching anything particularly. 3:19 Then you have libraries, and this is where you can import any custom JavaScript or Python 3:25 libraries. 3:26 Right? 3:26 Then you have the different releases, which I mean, and you know what releases are, as 3:33 well as the setting, which allow you to either deploy or configure your environment. 3:38 So now that we have a better understanding of what our workflow IDE looks like, then let's 3:44 start building our first automation. 3:49 So let's build a simple automated email workflow. 3:52 So for that reason, I've started off like cleaning up all this canvas and I've deleted 3:56 the default code. 3:58 And from there in the start trigger, I'm actually going to pull from the port and add a resource 4:03 query. 4:03 If you're actually questioning what this is, we covered it in the last few videos of the 4:07 getting started. 4:08 So just go and check out that playlist. 4:10 Now from there, I'm going to click on retail database. 4:13 And the reason being is that I already have this table over here that has like 11 users 4:18 that in contain information like first name, last name, company, email, I'm just going 4:22 to use that in order to send out this weekly update that I want to do. 4:27 So from there, I actually just going to make sure that it runs and like all this is fine. 4:32 I'm going to do select all posts, all from top users as the name of it. 4:40 Their email is not NULL and this actually needs to be in quotation because otherwise it won't 4:47 detect it. 4:49 There we go. 4:50 And click on the play button and then wow you have a preview of your data. 4:55 Now I just, I don't want all the information so I'm going to do first name, last name, 5:02 I'm going to do email and I'm going to do company. 5:07 Awesome.
and I'm gonna rename this get users. 5:11 That works for me. 5:12 Click on the play. 5:14 We have this array now. 5:15 Awesome. 5:16 So what I wanna do now is actually start adding 5:19 some other logic to this workbook. 5:22 If I pull from the port, 5:24 you can see all the other blocks that are accessible to you. 5:26 So I'll give you a little bit of a breakdown here. 5:28 First you have the research query, 5:29 which allow you to connect to your resources 5:32 and any sort of like query information. 5:35 stuff that we've been working on in our app IDE. So if I go back here, actually, you can set up 5:41 your resources by clicking on the resources tab and then from there create new and click on resources 5:46 and you have I mean, so many of them. Yeah, Google Sheets, GraphQL, MongoDB, Firebase, 5:53 Retool Storage, I don't know, like OpenAI, OpenAPI, RestAPI, so many, right? Even like Notion. 6:00 So once you set this up one time, you don't need to do them all the time. 6:04 And that is what this is for. Then you have code. So this could be like anything like 6:09 adding a JavaScript or Python. I will make a note here, but you could because it's really 6:13 helpful for so many people. You can add a block of code whenever you want. Like you don't have to 6:17 like use any of these blocks if you don't want like go code it. I think it's no problem. 6:24 In the same way that like in the libraries, you can also add any sort of like custom 6:28 libraries like from NPM. Keep that in mind. Then you have workflows which allow you to connect to 6:36 other workflows. Pretty meta. Then you have the AI actions. And to show you a little bit of this, 6:43 this is the Retool AI. And here you can generate like so many different types of actions from there. 6:50 You have stuff like generate tags, summarize tags, classified tags, generate image, 6:54 track entity from an image. You also have all these different types of models, 6:58 all these different types of versions, as well as controlling the temperature, 7:02 even adding a Retool vector. Okay, so close this down. And then let's move on into the next one, 7:09 which is invoking Agents. The agents that you have generated over here, let me go and show you 7:15 the agents tab. You can actually access them inside of your workflow. So you'll click over here, 7:21 and whatever agent you have you can click on in the habit run and like execute as actions. 7:27 I'll close this down and then I'll cover now a little bit of the other ones that you see over 7:32 here you have filters filter out any sort of values brand child you know brand child into 7:38 different areas loops specific logic or add a delay to your workflow which would be wait. 7:45 The last one actually is response which allows you to return a response within your workflow. 7:50 This could be helpful, especially when you're having your workflows be used inside an app and 7:54 like see like if there's any like errors that are happening in the back end, you can receive a 7:58 blog of them. And yeah, this is pretty helpful when it comes to what hooks. So I'm going to be adding 8:04 a loop. And from there, you can actually see that because it was already attached to the previous 8:09 block, it already knows that this is the one that is going to be using the information from 8:14 hence the sequence, right? 8:16 If there are any sort of branches created, 8:18 then you can start selecting which one you want specifically 8:22 that's looked to run from. 8:23 Now, in terms of execution modes, 8:25 you have parallel, which runs all at the same time. 8:27 It's more for speed. 8:28 You also have sequential, 8:30 which allows you to do one at a time, 8:32 as well as batch, like batching by group sizes. 8:35 And then also have a delay between these groups. 8:39 Now, I wanna do parallel. 8:41 And what I want to do is actually select a Retool email inside of it. 8:44 I'm going to call this email schedule. 8:47 Cool. 8:48 And I mean, you know what an email composition looks like. 8:51 So let's do value.email. 8:56 There you go. 8:56 This information is all coming from this array over here, which is pretty awesome. 9:00 The, this is called weekly update. 9:03 And I'm going to say hi value first name. 9:07 (upbeat music) 9:10 value last name. 9:15 - You are 24, value of 20. 9:17 (laughing) 9:18 - We have received some. 9:19 We have received some news. 9:21 - Leave it at that. 9:22 And then I can include a signature. 9:23 I'm just gonna uncheck this, 9:26 do an attachment or even add a reply to, 9:29 or even like CC, whatever you want. 9:32 It's just a normal EVA, right? 9:34 So what I actually wanna check before, 9:37 or I want to show you before I actually click on the play button, is that when you refresh, 9:46 if this block hasn't been executed, then this one is going to give you an error. 9:51 There you go. So you always have to, like if you're testing them out, you have to do the previous one 9:57 before you continue with the sequential block. Just the stuff when you're doing trial and error, 10:04 I see a lot of people like mis-stepping on this. 10:07 Cool. 10:07 Oh, I'm having some issues here. 10:11 Value. 10:13 Donate email. 10:14 Cool.
It wasn't capitalized from this. 10:19 Amazing. 10:19 Let's see if this works 'cause I put myself there. 10:22 Voila. 10:23 There you have it. 10:25 I have my name, my last name as well as the company 10:28 and obviously the email because I received it. 10:30 So that is how the looping area works. 10:34 I do want to set up now a trigger. 10:38 So let's go over here in the left panel, 10:40 and then from there you can click on the lightning. 10:42 And right now we have it set it up as a webhook. 10:45 I don't want that, let's do a scheduling. 10:47 So I mean, the same old does click over here. 10:50 And let's do like once a week, 10:53 let's do UTC on Monday and at nine AM. 10:59 Cool, awesome. 11:00 And you can even select like which environments 11:02 that come in from. 11:04 For dope, I'll save this. 11:06 And then also another way to access this 11:08 would be on the start trigger. 11:09 You can click on edit trigger 11:11 and then you can enable with risk through a Webhook 11:13 or a custom schedule. 11:15 I guess something to keep in mind is that 11:18 when we're dealing with more advanced event driven processes, 11:22 Retool also supports Kafka and Amazon SQS 11:28 in terms of integration's workflow triggers. 11:31 This allows you to pull messages 11:33 from existing message queues 11:36 and automatically trigger workflows 11:38 that run when message are received, 11:40 which is really perfect for real time event processing 11:46 without maintaining separate infrastructure. 11:49 Now that this is all done, 11:51 let's actually just like run this. 11:54 Let's click over here. 11:55 And then it would open up a log window 11:58 there you can actually see how long it takes. This is important, especially with that the loop that you have running if you're running them parallel. 12:06 Obviously, we're talking about scale right now is only 11 users, but keep that in mind. We got the green. 12:10 Oh, you can even see more information like the JSON input data and everything close this. 12:15 And I'm going to keep click publish and I'm going to do a major version release. 12:21 And it's something really important, 12:22 even though it auto saves in the canvas itself, 12:25 if I were to make a modification, 12:27 like adding, I don't know, 12:28 block of code or something like that 12:30 and have this executed and then do a response 12:34 and then this be okay, 12:38 like this be fine, cool, save in, all good. 12:43 You have to republish it again 12:45 and you can do this whether it is as a major, minor, 12:48 or patch and that is because when you're using them 12:51 the app, it would only have the last official release, not whatever has been worked on on 12:57 the canvas. So really important to keep that in mind. And so that brings us to the end of 13:03 our video. Thank you so much for watching. This was really interesting. Just getting to 13:07 teach you about like a walkthrough of the workflow. In the next few videos, we're going 13:12 to be covering more about, you know, forms and inputs. And I really want to challenge 13:18 you to go into our community forums and actually just create a fun workflow. Like send it over to me 13:24 tag me I want to see what you create and so uh thank you so much this was really fun and I'll see you 13:30 next time!