Flow Designer: Multi Sequential Tasks

In the ServiceNow Community, I came across an interesting scenario and wanted to share my solution as well here with this blog audience. The scenario was like this:

  1. We have a RITM that gets created from a catalog item.
  2. There will be 8 SCTASKs created.
  3. After the 8 SCTASKs are closed the next 2 SCTASKs should be created (but only if all 8 SCTASKs before are closed.

My first idea was to create or use some kind of Look Up action/script that runs until all tasks are closed, but there are limitations with Look Up Actions, Loops, and how many times a loop can run in flows. So I wanted to come up with a simple solution in Flow Designer that supports the scenario.

And it is simple after some testing. You can just create a “Do the following in Parallel” flow logic and have each of the 8 SCTASKs created in parallel. All of them have the flag “Wait” set so whatever happens to the tasks in whatever constellation, the flow will wait until the task gets inactive and proceed with the next steps.

And the cool thing about this is, that you can even trigger additional actions after each of these tasks and not interrupting anything of the other parallel workflows. You can e.g. close one of the tasks and then update a Configuration Item that is within the SCTASK or you can trigger an API call after a task is closed, etc. And only after all of these steps are completed the flow will proceed further.

Leave a Comment