 Hey folks, my name is Max Katz, welcome. In this video I'm going to show you how to add a reporting capability to an existing enterprise app and not be using Actile Workflows to do that. And Actile Workflows is a no-code identity automation platform. You're looking at a blog post that has all the steps, all the details on how to build this automation, how to get the application, how to launch it, and then again, step by step how to build the automation in Actile Workflows. So I'll be referring to this as I build the automation in this video. Let me show you how the enterprise application looks. Now, let me, I'm just going to refresh and I'm going to sign in. Now, you'll see this is a straightforward to-do app. You know, that's the enterprise app and we like it, it works well. You can add new items, you can mark them completed and then you can also delete items. But it's missing one capability and that's a reporting. I would like to get an email, maybe even daily or weekly or as, however often you want, with a report of all the tasks that have been completed and then what still needs to be done, right? Again, I can send the email to me, to my manager or to anyone else. So that's what we are going to do. Let me go back here. Let me go to the table of content here. In this blog post, the application does need a new API endpoint, which is enhancing the application with a new API. So when you download the application, you need to add the API endpoint and the API endpoint returns all the to-do items for a particular organization. So there is a security built in, so not, you don't want anyone to be able to call the API. You'll see, so the steps are, you know, the steps are here. Now I'm going to skip on this part, just to save time and to focus more on the Octa workflow side. But again, the steps are right here. I've got the application running locally. And also, I have this tunnel, local tunnel that I'm running. Now I go back and so there's the steps are here as well and how to set up and launch the title. Now, why do you need this? So Octa Workforce is running in the cloud. And now the application from this workshop is running locally on my computer. And so for Octa Workforce to access the API, it needs the local tunnel. Now this is only for demonstration purposes, just to make it straightforward for you to actually complete this workshop. So you don't need to deploy the application somewhere in the cloud. Of course, in the real world, the application will be running somewhere in the cloud and you don't need this local tunnel, right? So that's kind of it. That's the story. Let's go to Octa Workforce. And also, before we go to Octa Workforce, if you have access to Octa Workforce, great, you can use that access. If you don't have access, no worries. There is a section right here getting access to Octa Workforce that you can get a trial and then to Octa Workforce and then complete this workshop. So again, if you don't have access, no worries. Sign up for trial and you'll be able to finish this tutorial. So let's get started. Now I'm in Octa Workforce. I'm in the flows tab. Now on the left-hand side, I've got some folders. If this is your first time looking at Octa Workforce, then you're only going to have the default folder and that's totally fine. To start, I'm going to create a new flow and I'm going to create a new, click this button. And I'm going to give this a name, so to do report. And it's usually a good idea to give a description, so list all the to do flow. I'm going to also turn this option and this saves data between different flow runs. And this is very handy when we are testing the flow. I'm going to come back, you're going to see how this capability works in just a few minutes. I'm going to click save, all right? Got a new flow and I've saved the flow, I give the flow a name. So usually the first thing to consider is how do you trigger a flow? And you can see it says here, when this happens, and then add an event. So there are two main ways, I mean there are other ways, but the two main ones. So the first one is a schedule. And as I mentioned, we want to send an email on daily or weekly. And so that's what we're going to do here. So to run this flow on schedule, I'm going to click add event. And then I'm going to click schedule. And then right away it's asking me, so how often do you want to run this? Now I can run it as often as every five minutes. I want to do this right now. So I'm going to switch to weekly. And I'm going to say that I want to run this, let's say every Friday at 9 AM. And I'm going to click save. If you ever need to go back, you can click this little clock icon and reconfigure, all right? Now the other option to trigger a flow is based on an event. An event happens in your organization. So for example, when, let's say, user is activated, you can trigger a flow. Or users deactivate it, or their password is changed. Or a new application was assigned to a user. So all these events, and there's a long list of events, you can trigger a flow based on those events. Now a third option, we're also going to use it here, is a helper flow, right? Is that when one flow calls another flow. There are other ways, but that's not important for this workshop. So we're done, well, we sort of took care of how do we trigger the flow. So the next step is we want to get all the items from the enterprise application. And as I said, there are steps to add an API endpoint. I've already done that, but now I want to load those API endpoints. Or sorry, not load API points, but load those to do items. And so for that, I'm going to use a function. Let me open this menu, this option here. And you can see there are a lot of different categories. Like branching, error handling, like flow control. And I can actually click here, like this does. This for example, call flow will call another flow. There is branching, like if else, you can work with text, numbers, true, false, date, and time, objects, files, lists. But the one we want is the API connector, step or a card. And we're going to use the get one. Now, this allows me to call a third party API, which we're going to do in our case. Now, before I do that, let me go back and show you what action is. Now a function again allows you to manipulate data. An action on the other hand is a connection to an existing service. So these are out of the box connectors for which you can create connections. And then every connector supports different actions that you can call. And we're going to use the Gmail one in just at a later step. Let's go back to function. And we're going to go to connector. And then I'm going to use the get card or a step. And then so this is called a card. And then the card will have inputs at the top here. And then outputs at the bottom here. And for inputs, it says the URL query and headers. So for the URL, we need to go to our tunnel. Let me do this. So copy. All right, this is the host. Now for the actual endpoint, I'm going to refer to the blog post. And I'm going to go, let's see here, launching in local funnel. So I'm going to jump into the section. And again, there are steps I have to do that. And so right here, let me do this here. All right, cool. Now, once you set the URL, you can test the card. Now every card you can test. And if I look at the bottom here, there is a test this card, but icon or button, I'm going to click it. And I'm going to say test. But now what's going to happen, actually, I'm going in there, not authorized, which makes sense. I mentioned that this is a secure API, but I haven't provided any sort of authentication information. Because of course, if someone had this URL, then anyone will be able to call it if there was no API key. So what I'm going to do is I'm going to set up a connection. And I'm going to go right here. And I'm going to set a new connection. And now the connection is a custom. And I'm going to specify a header name and a value. And for that, I'm going to go back to my blog post. And right here, I'm going to copy. And so this is the header value. This is the name is fine, or we can do to do connector. Give it a name, click create. And we can see the connector is set right here. And if I test this again, now we actually get back the to do items. So we've got four to do items here. And they are the same as here. So the API endpoint working. And we're able to get all the to do items. And then the next step is we want to take the to do items and send them in an email. So we're going to do this in two steps. The first step, we're not going to really format it. We're just going to send it kind of in this raw JSON format. And the next step, we're going to format it. So but this body here, this is the response. Now really quickly, if you there's some other outputs here, if you ever need to like you decide, I don't want to see them here, then there is a little gear. And then you can say choose fields. And then you can decide which fields you want to show or not. So for example, we only need the URL so we can uncheck query and headers. And then just becomes more compact this way. All right. But the next step is we want to have a card that will create text for us. And I'm going to add function. And then in the text category, I'm going to select compose, which writes to write any text. Okay. And I'm going to say to do items. And now I'm going to take this body here. And notice what I'm going to do is I'm going to drag and drop it. So this is my favorite capability in ActiveWorld. This is how you pass data or from card to card or connect data. Let me show you one more time. I take this and all right. Now that I've got two cards, you can of course test this card, but then you need to enter some simple data here. So just say hello and this is the output. But now, how do you test this entire flow now, right? So there is a run button and it will test the entire flow. So you can test individual cards or you can also test the entire flow. So I'm going to click run and it's going to switch to this different view. And it's going to run. And now we can see this is the result, right? The to do items label and then the text, the JSON from the API endpoint. And if I run this again, right? And again, you can see how data is passed from card to card. And so this is the first run and this is the second run. And so if you remember this option here, right? So this option will save each run so I can see what data was used in a particular run. So this is what this option is for. Now, so the last step is we need to send this via email. And for that, I'm going to use an action because we're going to be using a Gmail action. So I'm going to use action. And so these are already connected apps, but for Gmail, it's not connected. And then every connector will show you the action that it supports. Now behind the scenes, these are API calls, but you don't need to worry about setting up the API call. And I'm going to use send email. And it's telling me, well, you need to create a connection because no connection exists in Gmail. So I'm going to click new connection and the name is fine. I'm going to click create. And I'm going to use this account. And I'm going to say allow. And it creates a connection to Gmail. We can see that this card has, these are the inputs. And then this is the output. Now for the email, so I'm going to use this test email service. I'm going to paste the email. Now for this object, I'm going to call this to do report. And now for the body, I'm going to take this and map it like this. All right. And again, if I don't want to see this from CC and VCC, I can click with gear, choose fields, and just uncheck the stuff that I want. Looks good. Now, if you wanted to test this card, you can. So clicking and we can just enter test email for the body and click test. Let's close. And let's go to this email service. And usually refreshes, but we can also click refresh. All right. And we see this is the email that we just received. All right. All right. We can delete it. All right. Let's test the entire flow. So I'm going to click run. And this is the third run. And we can see that this is the body, right? So this is the first step, second step, third step. Let's go to the email. I think this is the one. Yeah. Right. So we just received. This is the JSON response. And then this is the label. All right. We just built an automation. It will run again every Friday. It's actually right here. It's showing you right here at the time. It's showing you when it's going to run next. We are getting the to-do items from an external endpoint. We are just doing some basic formatting here. And then we're using the Gmail send email card to send the email. And we were able to also test the flow. Now, of course, one thing we need to do is we need to format this body a little bit better because it doesn't look very user friendly when we send the JSON. Right. So we're going to do that next. And for that, we're going to use a helper flow. So I'm going to exit back to this folder, to the folder. And I'm going to create a new flow. And I'm going to call this to-do report helper. And then we call this format to-do items flow. And as before, I'm going to enable this option. Okay. Now, for the helper flow, for us to become a helper flow, we use a card called helper flow card. And now we need to define inputs for the helper flow. So the first one is, let's see what I call it here, just to match item. Right. So we're going to create this input into the helper flow. So let's call this item. Now, this is going to be an object. And then right here, every field, if you click the little a, we can again make this an object. And then it has two items, task, it's a string, and then completed, which is also a string. Right. Now, one more field we need is called memo or memo. But I'm going to cover this in just a second. All right. And again, this is just, sorry, going back to the tutorial. This is the structure is defined right here. All right. I'm going to be using what's called a reduce card. And then what it does is that it takes a list of values and reduces it to a single value. Right. That's what we need. So we have a list of items and want to build the message out of those items. So we have four. We're going to reduce it to just a single text value that we can send in an email. Okay. So for that, I'm going to click function here and I'm going to use the compose. And I'm going to take the, put it right here. And again, I'm going to explain this and then add a little arrow and I'm going to put the task. And then I'm going to open a parentheses and put the completed value. Right. So this is going to build the message for me. It's going to take the first item, then append the second item and the third item. And again, I'll explain how this works. But the last step is we need to return the value back to the main flow. And I'm going to search. So there are these categories, but I usually just search so we can do return and let this. All right. So this is our helper flow and let's save. And we'll come back there again in just a second. I'm going to go back to the folder and open the main flow. Okay. So now we need to call a special reduce card that will call the helper flow. And then we're going to pass the list of items to it. I'm going to click, select this plus here. Now notice that you can add steps in between cards as well. I'm going to use the yellow is a function and then this is an action. And I'm going to search for reduce. It says convert to list to a single object. And so that that's what we need. Okay. And then this is how it looks. Okay. Now there are a few things I need to do before we can connect data. So the first thing, if you remember, I go back to that what I need is, I need this array, like this to do array. That's what I actually need to pass to the reduce card. So what I'm going to do, I'm going to define, if I go back, I'm going to say to do's. And I'm going to make this to be an object and it's going to be a list. Okay. So what it's asking me to do is to take, I'm going to take the to do field and map it to the list. Okay. So again, taking the to do and mapping it to the list. All right. Next, I need to select a helper flow. What I can also do is let me just delete this text. So it's not in the way. So I'm going to click this and delete it. Okay. I'm going to choose helper flow and this is the helper flow that I created. Okay. And now once I select the helper flow, it actually creates the input fields here. Okay. So once you select, it reads the helper flow information and then it tells, sort of prompts you to provide values for the helper flow. Now the first one is this memo or memo and I'm going to first make a text. So this is the initial value. I'm going to call this to do items. And now here, this is the value from the list. So I'm passing each item at a time. First item, second item, and this is the initial value. One last thing I need to do, because we're going to be getting back a text, I'm going to change this to text as well. And then I'm going to take this item and this is our new message. Okay. If you also want to, if you wanted to give it more context and you would prefer just to be called something else, you can click the arrow, click customize and email message. And then it changes here as well. Let's run this and I'm going to open the helper flow. So you can open it by this icon here. It will open the helper flow. Okay. Now we need to turn on the flow. And so for that, you can also, you can go here. Flow is off. I'm going to turn it on and notice the save data is optioned available here as well. If you need to turn it on, we're going to keep it on. All right. So this is the helper flow. And now this is the main flow and let's give this a run. So I'm going to click run and see it kind of moves step by step. Now we can see right here that this is the message that was sent. Right. And these are the four items. Let's go to our email service. And that's what we get. And this is now the updated format. Right. So we can see the task name and the parentheses. It says whether it was completed or not. Okay. Now the main flow runs once, but then the helper flow, we should have four executions, one for each item. All right. So as I said, this is very, very handy. So let me show you, let's see how this works here. So again, we're passing to the reduce cart. We're passing all the items on the list. And then it will process them one at a time. So like a for each type loop. But look at the first one. The first run is that looking right here where the item, this is the first item that's being passed. Try a workflow tutorial. And then the memo value is to do items. That's the initial value. Now what we're doing later, we're sort of combining them two. And then the result is to do items and then the first item. And then we're returning it back to the main flow. Right. So we took the initial value, appended the first item, and then returning it back to the main flow. Now let's look at the second run. Now notice that this is the second item from the list, but notice that the memo value is, has what we returned from the previous run. It has the original and then plus the item. And now we're appending another item, the second one, and we're returning it back. Now the third run, notice that now we have the two items. That's from the previous, right? And we're adding the third item in returning it. And now on the final run, we're passing in the three items, sort of the label plus three items. And we're adding one last item and returning it. And now we processed all four. And that's when the reduced card is done running. And we now step to the next card, which is to send email. And we send the email. Okay. We can run this again on my time. And if I go to the helper flow, we should have, we should see, sometimes we need to go back like this. We see four more runs. So one, two, three, four. And if I go to my email service, we have this report. All right. That's what I wanted to show you. One little thing we can try is if I click, let's say we completed this one. And let's do one more run. All right. And you can see already here that this is false. This is false, but this is true and this is true. And let's see. So now we have two that are completed and two that are not completed yet. Now as for the schedule, again, it's going to run, you know, on Friday. So that's why it's showing the time it's going to run next. But that's what I wanted to show you. So again, we started with the enterprise application. We enhanced the application with a secure API endpoint where it turns all the to-do items. And then we built an automation that runs on schedule and sends a report about the to-do items once a week. Right. So we get the to-do items. We first just sent the raw message, which was fine. But then we added the helper flow to format the email message using this reduce card. We format the message and then we send the email. So that's what we wanted to build and that's what we have. And again, this blog post has all the details, everything you need step by step. If you have any questions, you know, don't hesitate to reach out to me. What I'm going to do is I'm going to do it in a world-close way and I'm going to put my email right here if you need to reach out to me with any questions. So that's my email. Thank you for watching. I'll see you next time. Bye-bye.