How can I create an RITM inside an RITM Flow?

symonflores_23
Tera Guru

I have a business requirement:

 

I will create a Service Request catalog item that allows customers to add their order numbers.

In the MRVS table, it would look like this:

 

Order01
Order02
Order03

 

Our fulfiller wants to update the details per order number, so I created one SCTASK per order number and added variables that are only visible to the SCTASKs.

 

However, I encountered an issue because the variables are created through the RITM. As a result, the variable values are shared across all SCTASKs. 

 

Another option I considered was creating the variables directly on the SCTASK table. However, I was advised not to add more custom variables directly to our tables, especially since I would be adding 10+ new variables for the fulfiller.

 

As a workaround, I plan to create a child RITM per order number and then create an SCTASK for each child RITM.

 

image.jpg
How can I implement this in Flow Designer?

 

If I duplicate the flow, how can I limit the RITM creation to prevent an infinite loop of child RITMs?

Is there a more efficient way to create the RITM and attach it as a child RITM to the parent?

8 REPLIES 8

@symonflores_23 

since you are creating new REQ and RITM for particular catalog item -> that catalog item should be having some flow right?

You want main RITM to wait till all child RITMs are closed?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Yes. I want to add the condition if sctask of child ritm is closed, then child ritm is closed (this could be done using wait for state condition), I also want to wait for all the child ritms to close before closing the parent RITM.

 

In this image,

I have successfully done the creation of child RITMs using for each item loop, however, if I add wait condition inside the for each item loop, it would not create the 3 child RITMs in parallel.

maheshkhatal
Giga Sage

@symonflores_23  What Ankur has suggested follow that.
For each Item in MRVS -using flow designer For Each create a RITM and for Each RITM create
respective SC Tasks(I think no need to use Submit Catalog Action). This should solve your use case.
The challenge would be closing the child RITMs and based on that Parent RITM Request.
For this create a subflow which will check if all the child RITMs are closed based on that Parent
RITM & Request would be closed.

If my answer helped resolve your doubt mark this as helpful.

Thank you,

Mahesh.

Hi maeshkhatal,

 

Ah yes I have created the first part of creating RITM for each MRVS using the for each item in MRVS condition in Flow Designer.

 

However,

If I need to create wait condition for each RITM, the wait condition checks the SCTASK state, any changes from the sctask state also changes the RITM state.

 

Where do I insert this wait condition? Inside the For each item loop?