logo

NJP

IntegrationHub (IH) in ServiceNow | Share the Wealth

Import · Oct 23, 2020 · video

my name is shaq kamara i'm a senior technical consultant here at gladfast today i will be talking about integration hub with you a little bit about myself i've been working with servicenow for about eight years now and for probably about the past four or five years i've been doing mostly integrations and i've just always been fascinated with how technology talks to each other so the first obvious question here is what is it what is the integration hub i really like to answer this question by starting with what it's not what it's not is the flow designer this was confusing to me at first so the flow designer is a feature for automating processes like approvals tasks notifications and it's using a natural language coding environment like you can see on the right it's pretty much like action one two three and using lookup recommendation records just natural language that you can understand in a workflow type setting flow designer consists of flows subflows actions action steps and spokes and the thing to note here is the integration hub actually uses the bottom three it's pretty much a bunch of spokes but again it is not the flow designer it actually lives inside of the flow designer which is so if you're familiar with orchestration orchestration in the workflow editor work in the same way whereas you have your workflow editor that's available to everybody like the flow designer but out of box it is not really a way for you to communicate externally so for workflow you would activate orchestration that will give you a bunch of activities you can use with flow designer it's integration hub you would integrate you would activate integration hub and that would give you extra spokes that you can use to communicate externally and you'll hear that word a lot spokes and we'll talk about what exactly those are what they look like so we know what it's not let's talk about what it is the integration hub is a feature for automating integration tasks using custom or servicenow built components those components are the spokes that i'm talking about we mentioned it lives inside the flow designer so to get to it and i'll show you this into the instance you really go through the flow designer to get to the actions and the spokes that come with integration hub it really works as a part of the flow to execute communication external systems so any integration with something that isn't servicenow basically could be facilitated using integration hub and as i mentioned each integration is called a spoke which is really a collection of actions and action steps actions have steps inside of them and i'll show you this because it's a bit confusing if i'm just saying it in words but i'll show you what it looks like but each spoke is really just broken down into actions and action steps designed for a specific integration they can be predefined or they can be custom built there are a ton of predefined ones and probably more coming when this first started out they're just a handful like slack and the evon example and now it's exploded got a bunch of google spokes a bunch of amazon spokes and we'll take a look at the list so you can see exactly what i'm talking about the thing about these spokes that makes them special is each one of them is a separate scoped application so what that means is they're all contained in their own little world basically and that makes them highly reusable you can share them across instances you can share them with other developers who have instances not connected to yours you can put it on the store you can put them in servicenow share so they're they're very reusable it's a really good tool to use another powerful thing about the the integration hub is that it uses connection aliases so servicenow has an application called connection and credentials and the integration hub utilizes that to help you with exactly what it sounds like connection and credentials so if you've ever built an integration especially with web services or something that uses credentials you know that if you're connecting to more than one instance for instance you know servicenow has dev test and prod so if you're doing a service now to servicenow instance the connection details the url for example and the username and the password those might change every time you promote to test or promote the pride and in the old days you would really just have to go and manually update those every time you move and that could be a pain because if you forgot things would break down there might be chaos so what this seeks to do is really get it all set up in dev you can set up all your connections in dev in a connection alias and i will show you this of course and you can set which one is supposed to be active so really all you have to do once all your connections are set up you just set one to active it only allows one to be active at a time and at runtime servicenow determines which credentials or which connection to use so you don't really have to go and change it every time you promote it you just activate the correct one and then we've talked about this it extends on flow designers use of natural language coding and i'll show you that there's some integrations you can build without even writing a single piece of code which is really cool it can save a lot of time so let's take a look at these spokes that i've been talking about so much servicenow has been cranking them out since this came out i think it was in the kingston release that creation hub came out anyone can check me on that but they've been cranking them out they've got different levels so in the starter slash standard you've got cisco webex microsoft teams servicenow ebond slack zoom github jira twitter and there there are a couple more and we'll take a look at the full list in professional some examples remedy dropbox there are several google like google calendar google mail a bunch of google ones microsoft ad and azure ad sccm usage enterprise i think you get the whole sccm sharepoint at octa to finish up professional and then you see an enterprise you get amazon amazon web services there are a couple of those there's more google cloud chronos and sccm dealing with discovery type things so they're they're expanding pretty much trying to get us folk out there for everything possible but there are times plenty of times where you'll still need to do a custom integration because there are plenty of legacy systems out there that are still being talked to and need some special attention so when that is the case servicenow has provided custom action steps so if you remember i said earlier spokes are just a bunch of action and action steps so each action has a series of steps and servicenow has provided these steps to help you build your integration so they've got a jdbc step that allows you to send sql commands to a relational database they got a payload builder this is a big help you've ever had to deal with a soap integration that deals with xml it can get really ugly trying to build the payload or parse the payload so this payload builder step and that xml parser step you see there those in my eyes are huge additions because that saves developers a lot of headaches saves them time which in the end saves the project time this is all good things for everybody so hopefully you won't have to deal with a lot of soap integrations but if you do servicenow's definitely included stuff in the integration hub that really helps in terms of parsing or building your payloads and i touched on rest and soap web services personal favorite of mine for integrations and i'll show you an example custom rest integration where it really it helps you cut down on the coding you know you you get to instead of having write out lines to to actually make the connection and receive the response parse the response really do a lot of dragging and dropping and then you do some coding when you really need to and you also see ssh and powershell there powershells used in ad ssh used to really tunnel into other systems those other steps that you're allowed i think also when i peeked in there earlier there's an sf tp though if you're using a file server just exchanging files back and forth in excel file or csv or something like that there is also a step for that so servicenow is really trying to cover all their bases with these so we know what it is why would you use it the last i heard i believe orchestration is no longer available for newer clients i don't think servicenow is going to be going down that path anymore so really integration hub is is the way of the future flow designer is as well i they haven't replaced workflow as far as i know but the way things are going it looks like that is on the horizon so getting familiar with flow designer and integration hub is definitely something you would like to do now sooner than later because it looks like servicenow is pushing down that path and there are good reasons the natural language environment it makes it a lot easier for people who don't know you know necessarily what a rest integration is but just the the way you can put together the trigger and the actions you can build out the shell of what you want and maybe let more technical people fill in the blanks but if there's a spoke to do exactly what you need to do you may not even need somebody technical to do it for you so that's a big bonus there kind of bleeds into the predefined spokes at cutting down on time as i mentioned earlier each integration has to be created in its own scope and that that protects your data that makes it more reusable you know once you build something you don't have to go build it multiple times you know you set it forget it and any updates you can make really easily transferable to not just you but everybody else who's downloaded a version of it another really critical thing is that it places everything in a single interface so as i mentioned i like web services rest and so but traditionally in servicenow you're hopping between web service record and transform map and maybe business rule and some client scripts you're hopping all over the place this really tries to cut that down and you'll see what i'm talking about here in a second so let me actually just go ahead and hop into the instance so if you look in the left nav i've got the integration hub application start now i when i first started digging around in this thing a couple years ago it was hard for me to figure out what the integration hub actually was so you'll see there are a bunch of modules here that feed into it but it's not actually the integration of at least not to me so if you're ever in here and you want to start playing around and seeing what it actually is pay attention to this action designer module here this will take you into the heart of things other things to note are under connections and credentials but we'll come back to this here in a second so if i open up the action designer you'll see up top here actually we're in the flow designer because as i said integration hub lives in here but it took us straight to the actions tab because these actions not all of them but a lot of them are integration hub specific some could be custom made like i made this one here i'll show you that in a second and other ones come out of the box so if we go over here first thing i want to show you i made a test flow there's nothing in it this is the flow designer screen this is what a blank flow looks like and i'll talk more about this screen in a second but what i really want to show you is if if i want to go here and add an action this to me is where the integration hub lives so you of course have spokes by the way these are all spokes you have spokes that come with flow designer out of box these are not ones that are meant to speak outside of servicenow talk externally like servicenow core i can create records these are things that help you with the flow this is a spoke that i created and then down here you have all the integration hub spokes so like i was talking about you have microsoft ad and when you click on it you'll see all the actions that you get that come with it and when you hover over them you get a description of them so these are the pre-defined spokes that you get with whatever subscription you have to to integration hub so i think for instance there's a slack one i think this comes with the lower starter pack you get and we all use slack so you can post a message post your change details post incident details if you're working on something and you maybe with a client and you use slack but they use servicenow incidents to tell you what kind of work you can quickly throw together in a slack integration and get those details posted to a place you're comfortable with and i'll actually build one here in front of you just to show you how quickly it goes but i also want to point out all these spokes that i don't have installed so you see it's a pretty long list there's a bunch of aws spokes adobe more amazon azure if i'll scroll down a little more you'll see a whole host of google spokes so servicenow is really trying to build out these spokes trying to get a lot of these pre-defined integrations for you to just to make it easier to cut down on time so you don't have to spend countless hours trying to get things connected if you've ever done an integration you know up front it takes a lot of time just to get the two things simply talking to each other let alone exchanging data in a way you want to so a lot of this cuts down on that so let me show you an example of a predefined flow that came this user onboarding you can see it's in the microsoft ad spoke application so this flow itself is not the ad spoke but the actions within it so you see every time you see these this icon here down here with all these actions these little circles are actions these are pieces of the microsoft ad spoke these are pieces of the integration hub here so if we actually click on this action actually let me back up here for a second what you're looking at is the flow designer screen fully fleshed out so starting from the left you see there's a trigger it's really easy to see what triggers this flow whenever a user is updated and the active field changes from false to true these actions will kick off so that's how a flow starts off you define a trigger and if i click on it and expand it you'll see it's it's really straightforward if you've ever done a condition on a business rule or anything like that very similar you define your trigger which could be a record is created updated or both and you can run it on a schedule as if it were a report or something like that or you could define it based on the application right now it's inbound email service catalog or an sla task i personally expect this list to grow as servicenow fleshes this out but right now these are the triggers that you have available and once you define that trigger you define what table you want to use and the conditions and boom you have your trigger when that trigger is hit and service now when any user record is updated and this condition is satisfied all of these actions will start very first one being create the user in a d so if i open this up when you're building the flow and you're using the action you really don't see any of the details or the coding that goes behind it this is what you're presented with you get the action name and then the inputs that you need to put to get outputs for for the rest of the flow so as an end user this is really straightforward you don't even have to type in the first name you could come over here to this data box this is where all the data lives and so a little explanation here if i close these up all of these are pretty much the outputs from the steps so if you look here this is the output from the trigger being updated you have access to that user record any field in that user record and it even actually dot walks for you if there's a reference so if you want to get the user's company contact information you can just come in here and click these arrows and drag and drop that information over here into the appropriate box it's really as simple as that you don't have to hard type the the name or anything it's dynamic so whatever record is updated it's going to fill in this data pill is what it's called and all that information you can just drag and drop and it's going to fill in first name last name display name and you're done integrations aren't typically that easy ads pretty defined so maybe it is if for any reason you need to do something unique with any of these fields if you click this function button you can actually script what's going to go into this input and you have full access to the data pool data pills through fd data so because this is the first action you're really only going to have access to the trigger data but as actions are completed and outputs are created so you get the user guide status and error message out of this create user i create user action these outputs are now available to your next steps so if you need this information and later when you need to go look up this user maybe you need their good you can pull that data pill into the inputs for this next action and keep the flow going like that so really it really limits the coding in here you really don't have to do any coding and if you're not really a fan of dragging things from all the way over here to here you can click this data pill picker and pretty much do the same thing since this is the first section all i have access to is the trigger i can go into the user record and select my field from there and it will populate it and you see it's building that that string as i go so this is really user-friendly intuitive natural language set up if we take a little peek behind the hood come over here and open the the action in the action designer so this is the action designer it's really just a view of the action in the flow designer this is all read only because this is predefined but this is just just so we can take a look at how it's built behind the scenes you have the inputs that you define so this is what we see as an end user that we drag and drop when someone's creating that action they define what we define as inputs you can take those inputs into your next step so you see one two three here these are those action steps i was talking about the entire thing is the action and it's built out of inputs outputs and these action steps and you can take these actions bundle them up and put them into a flow and a whole group of these actions is what you would call a spoke assuming they're aimed at the same application or integration so what i really want to call attention to here is this this powershell step these other two script steps i think they come out of box the script step for flow designer but this powershell step this is integration hub all the way so if you need to define a custom powershell integration this is a step that you would use and so the predefined ones they're using the same thing this is read only because you can't change it if you need to you would copy it and then modify it as needed but it's designed to work out of box so up here we have our connection details this is using the connection alias that i talked about and we're going to go take a peek at that shortly but really here when you're defining this step you don't have to put in those connection details so you don't have to worry about updating this particular step or action every time this is promoted to test or or prod the connection alias is really its own separate record and we'll take a look at that but you set up your connection details and then you set up your script details and how this looks for each step depends on the step itself so i'll show you this is powershell i'll show you what a rest one looks like but these are powershell specific fields that you fill in the script type the script itself mid server script the script path and then the variables that you want to to input into that script and as you can see the data that was parsed out of here in the first step is available to the second step so it's the same thing as in the flow designer you can drag and drop that data and use it dynamically like that so there's no fat fingering there's no coding here it's really drag and drop and you're good to go so with that said i want to actually build an integration here can you guys see this slack channel i have here yeah general general so you see it's empty this is just a development slack i created yesterday as it's saying it's empty here what i'm going to do is i'm going to create a quick integration that takes an incident and pushes it into this slack channel simple so i'm going to come over here and i'm going to create new i'm going to create a new flow i'm going to name this wealth and so i've created a flow the first thing i want to do is give it a trigger it's pretty simple anytime a record is created or updated on the incident table and the assignment group changes to hardware let's add that filter changes to hardware then i want to trigger this flow once so i'm not going to get into the differences here but this is how you can really change how the trigger operates you have options of once for each unique change only if currently not running for every update so if your flows is complicated or maybe there are multiple flows running at a time maybe there are multiple updates you're expecting for any reason you can kind of tailor the way that this flow runs in my experience once usually does the trick but i haven't built a lot of complex flows here so that's my trigger pretty simple i've defined it now i want to add an action all i really want to do is once this incident changes the hardware i want to push those details over to the slack channel so if i click on actions and i look at slack there's a slack spoke and a slack web hooks spoke web hooks really they're just what are called listeners it's kind of an open channel saying anytime you've got something new for me i'm listening and i'll take it and put it in my channel these are a lot simpler to set up than an actual full slack integration like you could here so i'm just going to do a simple web hook and i want to post incident details again this is a predefined spoke provided by servicenow all i have to do is provide these inputs so in terms of web hook url i'm gonna go ahead and grab that i've already set that up in my development arena so i grabbed the webhook url you could grab that from any slack administrator or what have you if you need to set up this integration and then you determine what incident you want to run on this is dynamic i want it to run on any incident that fits this criteria so all i have to do is come over here and drag and drop it's that simple now that that is filled in if i want to put an additional message this incident has been assigned to you give my username give it the channel and we're done there's no connection details i need to figure out here there's no formatting of the data that i really need to do honestly this is it so i'm going to save it i'm going to activate it i could test it but i want to do a live run so let's go ahead and confirm and let's test it out and hope it works so i don't make a fool of myself here so let's go to incidents and choose an open one let's see here there's no assignment group so if i change this to hardware and i update it note this is incident nine zero zero nine i'm just going to save it so we stay here i save it i'm going to give it a second we can check actually if it's been executed so yep it looks like it's complete so let's pull up slack and there it is this incident has been assigned to you there's a link back to that incident and it pulled over the short description category priority state assignment group all of that did all the formatting and all that stuff i didn't even have to tell it what fields to do or anything like that so integration hub can be as simple as that that took five minutes to set up that's that's really the power of integration hub that whole low code no code mantra that servicenow is pushing is really expressed here because you see i didn't write a single piece of code but if you're like me and you do actually like to write long hard pieces of code you can still do that so let me go over here and pull up this hospital query flow and actually back up into here a second so what i did was i created my own custom spoke and the first step in doing so is creating a scoped application in the studio i won't go into detail on how to do that but that is pretty much the first step you should do when you're creating your own spoke is get your scope set up so i did that and also i built out a little bit of the back end stuff really what i aim to do here is i built a sculpt application that's going to reach out to this api that i found that wasn't necessarily built for cover 19 but has some valuable data on hospital bed availability so i found this free api if you actually go search code 19 apis there are a ton of them out there but i found this one and i thought it was interesting so what i did is a rest api pretty much i can go out and give a zip code and a radius and it will give me all the hospitals within that radius of that zip code and give me their information their location and how many beds are available so i built out this table to house that data so if i show you there is no data in this right now so we go back over to the flow which i built after i created that scoped application and again i started with the trigger now i have this just an arbitrary running every four hours and one second trigger honestly you could do anything like you could have this run on demand basically if some type of record is updated and have this run whenever you needed to i just did this for simplicity's sake in terms of that the real thing i want you to see here is this query bed count action that i created this is a custom action for my custom spoke so if i open it up just like with the ad spoke all you really see are the inputs that you need to put in so as an end user if i'm not the developer and i just needed this so i could create my flow all i would have to do is to add this action to my flow and give it the inputs and i could expect an output of records generated specific to my inputs in this table now as a developer behind the scenes at what it took to actually build out this action so the first step was to define your input so i know that the api in order to to work means a zip code a radius and my api key i don't want to have to hard code any of that so you just give them the variable names and in the flow well i did hard code it here but in a better setup you would just drag and drop this from some type of user record or user input or something like that but i have defined my inputs that the end user is going to put in to get to the outputs and then i have two steps here i have my rest step which is part of the integration hub and i have the script step which is really what i use to to deal with the output of the rest step so if we look at this rest step it looks different than the powershell step because it takes you know different a different setup to to get this running and i'm not realizing actually i didn't go back and look at the connection and credential aliases for the ad but i'll i'll do that in a second so this connection is different because i don't have necessarily a username and password in multiple environments i don't have to use the connection alias here i can just define the connection right here if i needed to use it i still could but this one is pretty simple so while we're talking about connection let me actually pop out here quickly and let's take a look at what these actually are so using the ad example if you have a dev environment and a test environment in a broad environment you would in the in the spoke we saw earlier it identified in the connection and credential aliases at this id to use this to look up connection details so what servicenow is going to do whenever that integration is set to run or that action is set to run it's going to come look here and it's going to look at all the connections listed under here this is blank out of the box because these are details that you at the end user would need to fill out for your specific ad environment but basically you would have your your dev your test whatever environments you have you create a new connection you would give it a name you would create a credential for it and servicenow does have predefined types of credentials so you've got anything from basic auth which is username and password to jdbc specific jms specific azure specific api key credentials so servicenow kind of has different setups based on that you choose the correct one provide your credentials there and then you'd have that record here and save here so if if maybe you have different host urls but the credentials are going to stay the same you can use that same credential record for different connections so it's kind of flexible in that manner but you would just outline all those details for the specific connection so the host is what would uh what is typically different from dev to prod or dev to test the product or what have you so you would identify all your different hosts and the credentials for them if you need a mid server you can use that and that's really it it's pretty straightforward once you get it set up but one thing to remember is out of all the connections only one needs to be active at a time because only the active one or probably the first active it sees it's going to use that for a connection now servicenow seems to be building support for multiple active connections but that's deeper than this conversation right now so going back over here to the action that i created i'm not using an alias so really i just define everything here i give it the base url this is the api that i was using that i found online it could be any rest api or what have you put here then i have the request built manually you have the option of building it from an open api specification that's a different conversation manually typically the way to go unless you know what this is and have that ready you want to build it manually the resource path typically this is something you can just type in so resource path i don't have it up actually but the entire url entire endpoint that you use to reach and retrieve data from you have a backslash and then i think it's hospitals slash radius and then there's some information that has to be dynamic so instead of just typing that out here i use this function key and i'm actually able to use again the data pills over here but access them through code to build out my resource path so if you ever come to something where it's not as simple as typing it in or dragging and dropping you still have the option of coding it in and making this as flexible as you need and with all the integrations that i've seen a lot of times you're going to need somewhere down the line to do something special to get it to work so in this case i'm taking that input that i gather from the end user the zip code that they use and i'm attaching it to this resource path to help build out the url and then to finish that up i'm sending the method which is get we're pulling information and then here's my api key which is entered from the inputs and then the radius again entered from the input so i'm taking all that user data and i'm building out my endpoint and the output as you can see here from the rest step i'm going to get an error message i'm going to get the response an error code i'm going to get any headers and a status code so normally all of this is done through code you have to use servicenow apis in the backend to get extract the status code extract the response body and do all that but here this step is going to do all that for you it's going to parse out the response and status code and give it to you a nice little outputs so then you can just add on your additional steps and use that data like i did here to get it where you want so basically what i'm doing in this step is i'm taking that status code and i'm taking the response body really simple if this were a production ready thing it'd be a lot more fleshed out but for simplicity's sake i'm checking if we get an ok status back which is what 200 is probably should put 201 in there because sometimes you could get that but by the way you're checking for an okay status and then i'm getting the response so i have this variable inputs i can access my status and my response through this so i'm getting my response which is a json body i'm parsing it and then i'm getting the specific hospital data and this step here is pretty much stepping through each hospital and parsing it out again through this function this create hospital function and it's either creating the hospital record or updating it so it's a pretty simple piece of code but the time it took to do this as opposed to doing it strictly through code this could easily with errors and back and forth could take a whole day trying to get something like this set up through code with this i did it in probably an hour given any mistakes that i made and such so this is pretty cool in my eyes and it cuts down tremendously on time so i'm gonna go ahead and exit out of here i don't know what change i made but i don't want to save it and i'm just going to go ahead and test this and it's going to run automatically because the trigger is a timing trigger and if i click here i test it i can see that the test run was completed there are no errors so if i come back over here to my table and i refresh now i've got data this was pulled straight from the api that area code that i provided if we look or zip codes all right so this is 23226 this is local i'm based in richmond virginia this is local to where we are so if you look here you'll see a bunch of richmond or hanover county richmond city so this is all within a 10 mile radius of that zip code these are all the medical centers that you have and then if you see here these are all the available beds so from here now you have the data and service now you can run reports i can do a map report because i am pulling in latitude and longitude so i can even put this into a location record in servicenow and i could do a map report with it i could do a heat map you could do all types of things with data like this any of the code apis the thing about it is building something like this now takes a lot less time if you have integration hub with you because other than that you'd have to build it the regular way and i'm not saying can't be done but it's a lot easier with integration hub do we have any questions was there an indication it seemed like you knew that it thought you had made a change to your flow was there some kind of indicator that showed you that or you're just being cautious kind of like a business rule or anything like that if you start messing with it it's gonna show you that little red star okay so yeah what i was talking about is if you start editing in here um you're not gonna see that star up here or you're not gonna see this flash green but as soon as i click out there you see it and there you see this flash screen so that's how i knew something was edited okay perfect thank you yep no problem feel free to reach out to me with any questions or anything if anything pops up thank you guys for listening [Music] you

View original source

https://www.youtube.com/watch?v=BLBssdOU7Vs