Custom Playbook Activities - Workflow Academy #04 (April 11th, 2024)
[Music] hello and welcome to the workflow Academy in this comprehensive platform Academy video series we'll delve into the transformative world of workflow automation empowering you to build Monitor and optimize efficient workflows with ease join us as we explore the core tools of service now's workflow automation Suite to build flows and subflows playbooks and decision tables on the now platform my name is Lisa holenstein and I work as an outbound product manager for the now platform my area of expertise is worth Automation and I create enablement content videos articles and blogs on the now Community I have been with service now for 5 years and I've been part of the service now ecosystem since 2016 before joining service now I was a platform owner admin and developer at a customer in today's video I'll outline how to create custom activity definitions for your playbooks and how to get started editing activity UI layouts in UI Builder quick reminder I may mention upcoming releases or product features that are still in development all timelines and features may be subject to change so please don't make any purchasing decisions based on anything I say today and here's our agenda for today first let's look at the bigger picture about playbooks and Playbook experience next I'll give an overview of the different parts needed for Playbook activities then we'll look at the steps to create a custom activity followed by a quick demo and resources and with that we'll get right into things our vision for building playbooks on the now platform is that we want to enable our service now developers and business owners to build and manage endtoend workflows on the now platform you can imagine playbooks as an extension of floats as it adds a UI layer to your business logic allowing agents and requesters to visualize and interact with a defined business process through a simple task oriented view the Playbook component is available in workspaces or on any next experience page the now mobile app and new in the Washington DC release servers portal pages with the release of workflow Studio we're unifying the Builder experience for flows decision tables and playbooks so you'll find us no longer referring to pad or process automation designer but we're building playbooks in workflow Studio instead when you build playbooks you can toggle back and forth freely between working in the canand style board view or the new more visual diagram view building playbooks in workflow studio is just one side of the coin the other side is the Playbook experience agents process workers and requesters can interact with each step through the customizable Playbook component choose between different layouts for the Playbook and Stage Pickers as well as focused and stacked activity views playbooks and Playbook experience as well as the experience demo and additional content are being distributed through the service now store allowing ing us to ship updates and new features on a quarterly basis these apps are generally being updated with each family release however that's usually in the latest previous version and there will be a new version available on the store we recommend checking the application manager regularly and updating the store apps to get access to the latest features and fixes now that we have a high level understanding of what playbooks are let's look at the smallest piece and activity definition we ship a range of activ ities with the Playbook product for the most common use cases like create or update tasks instructions wait for condition show a list show KB Etc more activities are included in the store app process automation content like request manager approval or create child task and many more depending on your product entitlement you will also have access to activities that ship without of the Box playbooks created by our different product teams like customer or field service management or it service management new in the Washington release you can now also check the box to include all automation assets and this allows you to pick any published subflow flow or flow action directly if you don't need an activity experience to be shown on the Playbook component during runtime now what are Playbook activities made up of on a high level there are four different aspects to keep track of and we'll look at each of them first we'll need automation to drive the activity execution and status and this means means a flow or flow action we recommend using an action or subflow over a triggered flow for the automation plan because this allows us to more easily Define the activity inputs and outputs as they will be inherited if you need to collect temporary data at runtime you can use a flow data definition with flow data variables all of these components will be included in the demo as well second an activity experience to determine the way the activity is represented on the Playbook component this part is completely optional so an activity definition does not even need an activity experience attached if the process step does not need to be surfaced to the end user prior to the addition of automation assets creating an activity without an experience attached was the way to define an automation only step now we can just run flows and actions directly third you might want to add activity actions to let the user interact with the underlying automation complete the step update records or simply skip over a step to the next one activity actions can be defined through various means and I encourage you to look at the product documentation for a Playbook experience and next experience to understand when to use which lastly you may have the need to have an activity definition present itself differently to different people or in the context of different Playbook experiences the way to achieve this is by adding an activity override record allowing you to specify conditions and roles for different UI layouts and with that we'll get into some practical tips when building custom activities in the demo for today I'll walk you through these steps create a data definition to collect data create the subflow to process the data create an activity definition add an activity action then test the activity in the Playbook next I'll create a custom UI layout by cloning an existing one and give it a light edit in UI builder then optionally Define an activity override and create an activity definition with the new UI layout and lastly we will'll test the new activity in a Playbook execution with the Washington release we've added a menu item for you to find the flow data definitions more easily if you are on an earlier release you might need to navigate to the table manually with the mentioned table name here you can Define variables similar to variables on a catalog item which we will surface in our Playbook later make note of the column names we'll need that when we build the subflow next we'll build a subflow to collect and process the flow data record based on the data definition we just created unfortunately there's currently no way to natively access the variables on a flow data record like we would with the get catalog variables action so for now we're using inline scripting to get to them assigning them to flow variables makes it easier to use them in multiple subsequent steps for this use case today I've also built a small decision table and I use the variables as an input and I will map the decision output to my subflow output this allows me me to use a decision table to determine which path my playbook takes or run subsequent actions conditionally next we'll create a new activity definition and choose the subflow we buil for the automation plan the subflow inputs will show up as activity inputs and if we're creating a flow data record in our flow it is recommended to have the associated record info and experience status be driven by that another common setting is to map the title and description to the activity instance dat label and description to ensure that the flow data variables show in the Playbook set the form fields to vars as advertised earlier we'll need a way to tell our activity to save whatever input we enter for our variables this can be done with an action assignment from the related list in the activity definition the demo will show you all the steps taken here as well after we have tested our first draft for the custom activity we now want to create a custom activity layout we highly recommend you clone from an existing activity to spare you the effort to set up all the necessary experience properties simply choose the layout that fits your use case best then customize it from there once you hit the button edit in UI Builder a new browser tab will open with your activity UI in UI Builder you can also get to it directly from UI Builder and the experience overview you can use any features data resources events that are available here to learn more about UI Builder I want to recommend my colleagues content in the next next experience Center of Excellence Brad and Maria Gabriella are not only publishing articles with guidance and FAQ on the service now Community but also run the next experience Academy and the UN Andi Builder live live stream on YouTube I highly recommend you check that out it's awesome content lastly if you create a custom UI for an existing activity that should only show under specific conditions Playbook activity overrides are the way to go when everything is set up and done you cannot use your custom activity in your playbook and with that let's dive into the demo if you've been watching my Academy videos or read my articles you'll know that decision tables are my favorite thing on the now platform now we'll never get tired of advertising their versatility thus it should not be a surprise that I'm using one in today's demo as well we have recently added a decision activity to Playbooks which will support using a decision table in a future release until then we can call a decision table from within a custom activity and output the decision results from the underlying subflow to use that result for conditional branching and Stage conditions in our playbooks for my example today I'm using a decision table to determine the academy type based on the title and length of a plan session I will surface the decision result in a subsequent instruction activity but it can just as easily be used to drive conditional branches as mentioned earlier if we are looking to collect data from The Playbook worker at run run time but don't want to write it to a record just yet we can utilize flow data with predefined variables prior to washingt release this table was not exposed in the application navigator so we'll have to use the table name. list shortcut to create a data definition in my instance I navigate to Playbook experience then data definitions I will create a new record that I name new Academy after saving I can add two variables one for the Academy Title which is and one for the session length I'll use the integer field type for this take note of the column name we will need that in the subflow later next I open workflow studio and create a new subflow one of the ways to limit right access to the flow data record is by setting the assignment group and or assigned to user if I want to be able to determine those when building my playbook I can add two subflow inputs which are then available as activity inputs I already know I want to access the decision result the academy type later so I'm adding a subflow output for this I can reuse an existing Choice list from my Academy workflow task the first flow action is create flow data where I'm referencing the data definition I have just created I map the assignment group and assign to user from the subflow inputs the white for user input checkbox ensures that the flow will not continue until the record has been updated with input for the variables I mentioned earlier that we don't yet have an outof the boox action to retrieve the flow data variables and we need to use inline scripting to access system we try to use inline scripting as sply as possible so if we need a variable more than once in a flow it is best to use a flow variable to store its content and ensure we only need to update in one place in case something needs to be changed therefore I am creating two flow variables to store both flow data variables I can do walk to the vars object and pick the variable with the column name we noted earlier as the next step I use the make a decision flow logic and call the decision table I showed at the start of the demo I want to get the first decision that matches and I don't need branches the flow variables serve as inputs for the decision lastly I will map the decision output to the subflow output so I can work with it later in my playbook as I realized just now I also want the Academy Title to be available and I can add and map another subflow output than publish and test it when testing a subflow with flow data I can manually simulate a process worker supplying the necessary input by navigating to the record and updating the variables and the status as you can see the flow updates and completes successfully I also get the decision result as expected after building all this groundwork we can now finally put the pieces together and create an activity definition for this I navigated to process automation process automation Administration and then activity definitions in my main service now tab I give my activity a speaking name then choose the subflow I just created for a first step I'll use one of the existing activity layouts record to test if my Activity Works before I start creating a custom UI layout after saving I can see a whole page full of settings that go with the record UI layout the settings that you want to do is mapping the associated record and experience status record to the flow data step record of the subflow additionally we can preset the activity title and description from the activity info when building the Playbook then I set the form fields to vars to surface them to the user working the Playbook and because they will also need a button to save the data and complete the activity I am adding an action to do just that now we can finally return to workflow studio and create a new playbook it's not really relevant to this demo which trigger I am using this will depend on your use case I choose to run the Playbook when a new workflow task gets created I create a first stage then add my custom activity to determine the academy type I add an instruction activity next just to surface the first activity's outputs now I can test this Playbook and look at it with the Playbook preview option I enter a session length and title then Mark the activity as complete and Tada my test was successful next we'll proceed to creating a custom activity layout I navigate to Playbook experience activity uis and layouts and open the record layout from here I can clone it and then give the cloned layout and default activity UI a more useful name we recommend to always clone from an existing layout to save you the hassle of setting up all the experienced properties and other connecting entities once you have renamed both parts click on edit in the UI Builder there are virtually Endless Options of what you can do in your activity UI and I won't be able to cover all of them and still provide a comprehensive demo so I'll limit myself to adding a stylized text component so it's obvious when we see the custom UI in the Playbook preview save the UI and navigate back to the activity definition I am creating a copy of my activity definition then change the UI layout to my custom one I'll have to redo the configuration but they're the same Fields as earlier so let's speed up this part a bit now I refresh workflow studio so the new activity definition becomes available I'll add it and the instruction activity just like earlier and then I test this Playbook as you can see from the big custom header text we have successfully added a custom UI layout to our custom Playbook activity this concludes the demo for this Academy video I hope this was helpful in lowering the barrier of Entry so you can start building your own custom activities with the activity UI layouts if you like this set please upload this video and whether you liked it or not this survey is your chance to provide feedback or comments about this Academy I'm looking for forward to reading your feedback you can find the link in the video description or use the QR code shown on the screen if you're interested in other topics Beyond workflows let me recommend my colleagues Academy series each of them covers a different part of the nap platform we have content about conversational interfaces including virtual Agent mobile apps analytics next experience workflow core platform and of course artificial intelligence while on the topic of more content if you prefer to read up on topics at your own pace check out the workflow automation Center of Excellence on the G Community I've collected resources and links and I'm regularly publishing new articles with best practices FAQ and guidance around flows playbooks and decision tables thank you for choosing to spend some time today to learn about workflow automation on the na platform thank you for providing your feedback and questions to help us make these sessions better for you until next time bye
https://www.youtube.com/watch?v=Jv2sjbWTez8