The CreatorCon Call for Content is officially open! Get started here.

Playbook Order Guide Sequencing - Possible to trigger fulfillment of ALL items with a single action?

Rob M1
Tera Contributor

Hello Community!

 

I am in the process of building a Playbook to sequence the Order Guide we use for Onboarding at my company.

 

Our requirement is to wait for the account to be created, then once the Account Creation RITM enters a certain stage, all of the other items included in the Order Guide should trigger based on the Order Guide rules we have configured.

 

The issue I am running into is that we have over 90 rules for items in our Order Guide. It doesn't seem feasible to add every single item to the sequence individually using the 'Fulfill Order Guide' action, and the requirement to maintain this going forward for every new catalog item we build is not making me feel warm and fuzzy.

 

SO, I am wondering: is there a way to trigger Order Guide Fulfillment for ALL items that have rules associated with the order guide? I've tried creating a custom action that calls the 'Fulfill Order Guide' in a loop for all RITMs associated with the parent REQ, but this doesn't prevent the items from being fulfilled before the Account Creation RITM enters the designated stage.

 

Has anyone else dealt with anything like this before?

 

 

Thanks a ton!

 

Rob

1 ACCEPTED SOLUTION

SasiChanthati
Giga Guru

Use Flow Logic to Defer All RITMs Except Account Creation

Let the Order Guide generate all RITMs normally, but:

  • Immediately set all RITMs (except Account Creation) to a custom “Hold” state

  • Once Account Creation reaches the required stage (e.g., "Completed" or "Provisioned"), remove the hold and allow other RITMs to move forward

How To:Flow in Catalog Item Flow Designer (or Playbook step):

  • On REQ submission, identify the Account Creation RITM.

  • Loop over all RITMs.

    • If RITM ≠ Account Creation → update RITM state to “On Hold” or a custom waiting state

    • If RITM = Account Creation → let it progress normally

      Use a Trigger Flow on Account Creation RITM Completion:

      • When its stage changes to the desired milestone:

        • Loop over associated RITMs in the REQ

        • If they are in hold → change state to “Open” or trigger their flow

           

          Optional: Add a flag field (e.g., wait_for_account_creation) on RITMs for filtering.

      (function execute(inputs, outputs) {
      var reqID = inputs.requestID; // Passed in
      var holdUntilStage = "account_provisioned"; // Customize as needed

      // Find Account Creation RITM
      var ritmGr = new GlideRecord('sc_req_item');
      ritmGr.addQuery('request', reqID);
      ritmGr.addQuery('cat_item.name', 'Account Creation'); // adjust name or ID
      ritmGr.query();
      if (ritmGr.next()) {
      var stage = ritmGr.stage || '';
      if (stage == holdUntilStage) {
      // Trigger all other RITMs
      var otherRitmGr = new GlideRecord('sc_req_item');
      otherRitmGr.addQuery('request', reqID);
      otherRitmGr.addQuery('sys_id', '!=', ritmGr.sys_id);
      otherRitmGr.query();
      while (otherRitmGr.next()) {
      otherRitmGr.state = 1; // Open
      otherRitmGr.update();
      // You can also call a flow trigger here if needed
      }
      } else {
      gs.info('Account Creation not yet at target stage: ' + stage);
      }
      }
      })(inputs, outputs);

      Scoped App or Utility to Manage Playbook Item Dependency

      If this is a common requirement, you could build a small utility/scripted flow in your Scoped App that:

      • Flags the “main” item (like Account Creation)

      • Suspends all others

      • On a signal/event, triggers the rest via FlowAPI or scripted transitions

  • Considerations

    • Avoid setting RITMs to “Closed Incomplete” prematurely — that might skip delivery logic.

    • Make sure to manage SLA impact if items are in a “hold” or custom state.

    • If using Playbooks for visibility: have placeholder steps that represent “All Other Items” or a summarizer if tracking them all individually is impractical.

  • Yes, you can trigger fulfillment of all Order Guide RITMs without listing them individually. The best approach is:

    • Let the Order Guide create all RITMs

    • Hold all but Account Creation

    • Use a Flow or Playbook step to resume remaining RITMs once Account Creation completes

View solution in original post

2 REPLIES 2

SasiChanthati
Giga Guru

Use Flow Logic to Defer All RITMs Except Account Creation

Let the Order Guide generate all RITMs normally, but:

  • Immediately set all RITMs (except Account Creation) to a custom “Hold” state

  • Once Account Creation reaches the required stage (e.g., "Completed" or "Provisioned"), remove the hold and allow other RITMs to move forward

How To:Flow in Catalog Item Flow Designer (or Playbook step):

  • On REQ submission, identify the Account Creation RITM.

  • Loop over all RITMs.

    • If RITM ≠ Account Creation → update RITM state to “On Hold” or a custom waiting state

    • If RITM = Account Creation → let it progress normally

      Use a Trigger Flow on Account Creation RITM Completion:

      • When its stage changes to the desired milestone:

        • Loop over associated RITMs in the REQ

        • If they are in hold → change state to “Open” or trigger their flow

           

          Optional: Add a flag field (e.g., wait_for_account_creation) on RITMs for filtering.

      (function execute(inputs, outputs) {
      var reqID = inputs.requestID; // Passed in
      var holdUntilStage = "account_provisioned"; // Customize as needed

      // Find Account Creation RITM
      var ritmGr = new GlideRecord('sc_req_item');
      ritmGr.addQuery('request', reqID);
      ritmGr.addQuery('cat_item.name', 'Account Creation'); // adjust name or ID
      ritmGr.query();
      if (ritmGr.next()) {
      var stage = ritmGr.stage || '';
      if (stage == holdUntilStage) {
      // Trigger all other RITMs
      var otherRitmGr = new GlideRecord('sc_req_item');
      otherRitmGr.addQuery('request', reqID);
      otherRitmGr.addQuery('sys_id', '!=', ritmGr.sys_id);
      otherRitmGr.query();
      while (otherRitmGr.next()) {
      otherRitmGr.state = 1; // Open
      otherRitmGr.update();
      // You can also call a flow trigger here if needed
      }
      } else {
      gs.info('Account Creation not yet at target stage: ' + stage);
      }
      }
      })(inputs, outputs);

      Scoped App or Utility to Manage Playbook Item Dependency

      If this is a common requirement, you could build a small utility/scripted flow in your Scoped App that:

      • Flags the “main” item (like Account Creation)

      • Suspends all others

      • On a signal/event, triggers the rest via FlowAPI or scripted transitions

  • Considerations

    • Avoid setting RITMs to “Closed Incomplete” prematurely — that might skip delivery logic.

    • Make sure to manage SLA impact if items are in a “hold” or custom state.

    • If using Playbooks for visibility: have placeholder steps that represent “All Other Items” or a summarizer if tracking them all individually is impractical.

  • Yes, you can trigger fulfillment of all Order Guide RITMs without listing them individually. The best approach is:

    • Let the Order Guide create all RITMs

    • Hold all but Account Creation

    • Use a Flow or Playbook step to resume remaining RITMs once Account Creation completes

Thank you!

I was able to create a business rule and a custom action definition for Playbooks based on your recommendation.

 

The BR finds all associated RITMs when an 'Onboarding' order guide is submitted and holds up all RITMs other than the 'Onboarding Summary' RITM. 

 

Once the 'Onboarding Summary' RITM enters the 'User Created' stage, the playbook enters the second stage which triggers the custom action I wrote. The custom action finds all RITMs in the 'Pending' state and sets them to 'Open', then triggers the corresponding flow/workflow for that RITM based on catalog item.