logo

NJP

How should I structure my flows? - Top 5 Tips

Import · Apr 18, 2024 · video

hi there my name is Jin fchen I'm the product manager of flow designer within service now I'm here to answer some of the frequently asked questions that I receive from customers and one of the question is how should I structure my flow in order to create a flow you need to know the four main types of component on Flow designer and that and they are Trigger action flow logic and subflow let's actually learn them using an example so trigger means the condition that determines the flow should run in the first place or not so if you think about it as if this and that trigger is the first if statement if trigger satisfy your flow will run otherwise your flow will not run in this example right here I'm showing on the screen trigger is incident created or updated so that means any Incident That's created or updated will have this flow run as a result of that that triggering condition being set satisfied action is the smallest unit of automation that does not make sense to break it down any further so an example I'm showing on the screen is look up isent task records where parent is the triggering incident this isn't one example of action action can be um sometimes provided out of box those are core service Now actions such as look up records create record delete update record these are are core actions sometimes they're application specific so you will have actions about change management uh or get change approval or um retrieve jira tickets those are application specific you can also have thirdparty actions um Jura ticket or get information from a Jura ticket that's actually one example from third party actions where the action not only stay within service now it actually go out to a third party system and then retrieve information back flow logic flow logic controls complex execution of the flow so for example maybe you don't want a part of the flow to run every single time you want that part to run only conditionally once a condition is satisfied if that's the case you can put that part of the flow into a if statement so if is one example of flow logic you can there are a lot of flow Logics you can go really creative with that you can have if you can have Loop so that's for each you can you know do the following actions while a condition exists or while a condition satisfi so that's do while and then you can go parallel you can do the following in parallel you can make a decision and depends on the decision result you can run certain part of the flow um you can go back to an earlier part of the flow you can um you can get very creative you can wait for condition wait for duration of time all these things are possible with flow logic so your flow can get it's not going to be uh only linear you can really make complex logic within the same flow finally subf flow sub flows are reusable subset of the flow so in this example I'm showing on the screen is actually called business process approval flow so this is a subflow that you can say oh this subflow is not only used in this one flow I'm sure showing on the screen it can be reused by other flows the reason why you want to use subflow is to make sure you are packaging a reusable chunk of the flow into a subflow so that they can be uh leveraged consistently by multiple flows there's no limit on how many or subflow you can refer in a flow you can also refer a subflow within another subflow so you can so if something will be reused and you want to ensure everybody reuse the same piece of cod or same piece of flow you want then package that in a sub flow I hope that clears or I hope that makes sense and uh thank you

View original source

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