Rich Martin • 00:06
We’re going to start right here in ServiceNow Flow Designer. If you’re familiar with the Itential platform and you’ve built automations in our platform, you’re probably familiar with Automation Studio. We’re going to take a look at that in a minute when we look at some workflows but by context, if you’re a designer or developer in the ServiceNow platform and you’re building their version of workflows which are just called Flows, you’re going to be spending a lot of time in Flow Designer. It’s similar in concept to Automation Studio in the Itential platform. What we’re looking at is a very small flow here, just as for a demonstration to walk you through the actions and what a flow looks like. At the very top, we have a trigger. A trigger is required and it determines when this particular flow is going to actually get executed in the ServiceNow platform.
Rich Martin • 01:00
We won’t go into all the details, but you can basically trigger a flow to occur when a new request is created and based off of the request, certain fields of the request if they’re set, so in this case, the short description as I potential test and then other things like state, in this case, approval is approved, so that you can be very direct and specific on when a flow should run. In this case, since we’re just testing these, we need a trigger, so we have created a trigger. When we do our testing, we’re really not going to use this particular trigger to run the automation or run this flow. We’ll bypass that in testing mode, but it’s important to understand that and know how these things interact together. But what’s really critical here are the actions that comprise this flow. You’ll see we have three actions right now. The first two are itential actions.
Rich Martin • 01:54
This is what you get when you install the ServiceNow app. You get a series of itential actions that can be used. Now, I’ve already built out the first two, but we’ll add another action here in a moment. The first step here, this first itential action is authentication. In order to authenticate to a server, we need to get a token. The authentication method here we’re using is name and password. This is defined in another part of the application.
Rich Martin • 02:20
So when you install the itential app for ServiceNow, there is a admin portal that allows you to define the itential platforms you’d like to connect to, as well as the authentication method. So that’s already pre-configured for this. That’s already defined somewhere else. I’m just selecting which service I want and the authentication method I want to use here. And this is going to return a token when this is run. Of course, that token is now going to be used for any subsequential actions into the platform that we use. More specifically here for this next step, step two.
Rich Martin • 02:51
Action 2 is another Itential action, which is automation start endpoint. What this is, is it allows us to run an automation that’s been published on the Itential platform. A couple of things to look at here. Again, I’m choosing the IAP that I want to run this on. Of course, that’s very important. Make a note of this. This is the trigger name. This is what’s defined as the API endpoint when I publish this in the ITential platform.
Rich Martin • 03:18
This has to match and I’ll show you where that exists in the Itential platform. Here is the token. We need the token that we used from step 1. You’ll see it’s numbered step 1 here. That’s simply dragged in and dropped into the token field, makes it really easy. Now we have all of the elements we need to start an automation, to run the automation from this flow. Our next step is part of the flow logic that’s built into service now. This is just a wait for 10 seconds.
Rich Martin • 03:46
This is certainly not the optimal way to do things, and I’ll show you the more optimal way in the next flow. But just for simplicity sake, we’re going to wait 10 seconds for this automation to complete. Then once it’s complete, we want to be able to get the results of the automation itself. But before we get to that and add that step here after the wait, let’s flip over to the Itential platform into Automation Studio and take a look at the automation that we’ll be running. Here’s Automation Studio. Again, Flow Designer is like the Automation Studio of the ServiceNow world. In the Itential world, Automation Studio is where we build workflows.
Rich Martin • 04:23
Step-by-step boxes here, we call these tasks. In this case, I’ve made it very simple. Remember, the concept here is I want to flow to be able to get some real-time network data because I want to use that later on in the ServiceNow flow as part of an overall IT process that I’m automating. This particular workflow right here is basically just going to return a set of inventory that we understand and we’ve learned about in the Itential platforms. The Itential platform has the ability to federate inventory from a number of sources. If you’re familiar with our platform, those sources can be physical inventory, individual routers that can be onboarded through part of our solution called Automation Gateway. We can get inventory like SD-WAN devices from a controller, we can query a controller and grab inventory and then federate that into our environment, or it can even be Cloud-based assets like VPCs and VNets can be federated into the Itential platform.
Rich Martin • 05:24
What’s useful here is the ability to now ask the Itential platform for a set of inventory that could be useful for, like I said, something in a flow to show to a user or a customer. that’s filling out a form in the ServiceNow environment. Being able to pull this network data in real-time and then give it back to ServiceNow so that it can be used in those instances, that’s what we’re looking at here. Of course, we are one source, we federate a source of inventory, but if you’ve got other inventory, if you’re doing something like a single source of truth, or even want to query multiple sources of truth of inventory, or even if ServiceNow is your inventory because that’s where you’ve decided to put it, you can query all of those sources from an Itential workflow using integrations and adapters. So we don’t limit you to only certain things, we want to expose as much of your environment into our platform for automation where it makes sense. And so that’s what’s going on here, we’re just simply using a built-in call. So this get devices filtered, calls the configuration manager app, which is part of our platform to get a list of devices, and I’m limiting it to 10 devices just for the sake of simplicity.
Rich Martin • 06:32
But there’s a lot of extraneous data that comes with it. So this query is just going to extract the list itself, because I want to simplify the data that we return back to the ServiceNow flow as much as possible, so they don’t have to query out a bunch of things. So I’m going to query just for this list, and that’s what’s going on here. So I’m saying, the previous task, all of the variables that it returns to me under devices, just give me under that JSON, just give me that list variable. Then the most interesting thing here is I’m going to create a new variable, and this variable is going to be called device list. I want to present this variable as a job variable so that it can stand alone as a device list by its name in a JSON or the key in the JSON, so that when the ServiceNow data flow gets the return data from us from the ServiceNow flow, and we’ll take a look at that in a minute, it’s very clear what this is.
Rich Martin • 07:29
So I’m defining a unique variable that just holds the list of the devices that we just queried for as part of the inventory. So that’s why I’m creating this new variable here. Okay, so once you’ve created an automation or a workflow within the Itential platform, in order to publish it, it’s a very simple process. If I go into operations manager, this is where we can do job control or we can publish automations. I’ll show you how I’ve published this. So if I search for ServiceNow, this is the particular webinar. All we have to do is from a dropdown, identify the workflow.
Rich Martin • 08:05
So this is the workflow we just looked at. And then under triggers, I can define a different types of triggers. In this case, I’ve defined an API trigger and I’ve called it API and I’ve given it an endpoint name. So snow app UC1, that’s the endpoint name. And this is when we go back to the ServiceNow flow. and we take a look at the automation start endpoint, you can see the trigger names, snow app UC1, that’s where it comes from. This is how we will execute that automation from the flow.
Rich Martin • 08:38
We’re missing one piece though. Just because I run the application, I don’t get the results of the data that I want from the automation. The last step that we’ll add in here to show how to add an action in is to get the results from that particular automation. We’ll add an action. If we do a search for Itential, it will bring up the Itential automation services. When you install the app, you’ll get all this. You’ll notice that there are authentication actions.
Rich Martin • 09:13
We support different types. We can get tokens through user names, passwords, or use API keys through OAuth. We also see a series of actions for job control, like canceling or getting metrics. We also support direct and mid-servers as well. So you’ll see different actions for mid-servers or direct, if we want direct. In this case, in our test environment where we’ve got direct connectivity. But you also see the ability to get results.
Rich Martin • 09:42
And that’s what we’re looking at here, as well as starting an automation, getting the status automation, which we’ll use here shortly, and also getting a list of the applications that have been published. So all of these are available to you for use. In this case, we want to get the results of an automation that’s run. So that’s the action we’ve chosen. The automation ID is going to come from the response from step two, when we start the automation. That’s a unique ID. So if we look over here on step two, we get this job ID.
Rich Martin • 10:12
If I drag that straight in, that will give us the data we need. And then I’m going to select the itential platform that we’re running the automation on. And the last part is the token that comes from step one, the itential action for authentication. And I can drag that there. And now that data is populated. And then click done here. And now we’ve got authenticate, run the automation, wait 10 seconds for the automation to finish, and then we’ll get the results.
Rich Martin • 10:45
So we can save it. And then from Flow Designer, I can test. This is what I was talking about. We can bypass the trigger for this. I need to have a record selected that’s part of the table that I’ve picked for the trigger. But in this case, we’re not actually waiting for those trigger conditions to run, we can run them directly. Now it’s going to run this test flow and give us the results in a minute.
Rich Martin • 11:10
Once that’s done, we’ll take a look at the details. It says it’s finished running. It hasn’t completely finished running yet because it’s waiting on this timer, but you can see step 1 is completed, step 2 is completed. So we got our token. So we can see the details here. We got our authentication token. Then we ran the action to start the automation based off of the endpoint.
Rich Martin • 11:33
And so we can see here from the response, the information that was returned from the IAP as it was running it. So this is not the result, right? This is just the status of as it was running it along with all the details for that. So if I hit refresh here. This should tell us that now our wait is complete and the results is what we’re looking for here. If I click on ”Get Results”, we’ve referenced, so we made another API call through this action into the platform. We’ve given it the automation ID, so this was the ID that was started here when we ran this job.
Rich Martin • 12:09
We got the action status, which was at least the API call was successful. But now if I click on the results, this is the data that was passed back in that very specific device list. Remember, I defined a variable called deviceList, and I passed back, and I know this isn’t formatted in JSON, so maybe eventually ServiceNow will have a field here where we can look at it in JSON format. But you’ll see that this is a JSON object with the very first key here is deviceList, that’s the variable we created that we passed back in, and you can see by this open bracket that this is an array and there’s 10 devices in here as well. This is how we can return operational data from the network through an Itential automation, requested and run from a ServiceNow flow using these Itential actions.