Order guide execution issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2025 02:03 AM
I have an Order Guide that includes two Catalog Items. They both use the same Flow in Flow Designer. When I submit each Catalog Item individually, the Flow runs correctly.
However, when I submit both Catalog Items together through the Order Guide, only one of them triggers the Flow. Why does this happen?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2025 02:06 AM
Hi @Binnie
Practically, this shouldn’t have happened as both are different items. Did you try debugging it to see what might be going wrong?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2025 04:10 AM
I tried checking the system log after submitting an Order Guide, and I found the following error:
From my understanding, all the RITMs should belong to a single request (e.g., REQ_A). I'm not sure why the system attempted to create another request with the same sys_id as REQ_A.
I’m completely new to ServiceNow, so I may be missing something here.
Could you please help confirm if my understanding is incorrect, or share any suggestions on how to debug this?
Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2025 04:45 AM
Hi @Binnie Yes, as per the order guide behavior, there will be one REQ and multiple RITMs.
You might want to try repairing the Request plugin once. If the issue persists, it’s best to log a Now Support case.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2025 10:37 PM
Hey Binnie,
Based on the error message the following are the possibilities and requird fixes.
The Error Message
ERROR: duplicate key value violates unique constraint "tmp_t517646145k_pkey" Detail: Key (sys_id)=(/*sys_id*/) already exists.
Expected Behavior
When you submit an Order Guide containing multiple catalog items, ServiceNow should:
- Create one Request (REQ) record
- Create multiple Requested Items (RITMs) under that single request
- Each RITM should trigger its associated flow independently
What Actually Happens
The problem occurs due to concurrency conflicts when multiple catalog items use the same Flow Designer flow:
- Simultaneous Execution: Both catalog items trigger the same flow at nearly the same time
- Resource Collision: The flow attempts to create or update records with identical sys_ids
- Database Constraint Violation: The database rejects the duplicate key insertion
- Transaction Failure: The entire Order Guide submission fails
Why Individual Items Work
When catalog items are submitted individually, there's no concurrency conflict because only one flow execution occurs at a time.
The Concurrency Problem
ServiceNow processes Order Guide items within a single database transaction. When multiple items share the same flow:
- Flow Trigger Collision: Multiple "Record Created" triggers fire simultaneously
- Shared Resource Access: Both flows may try to access/modify the same parent request data
- Race Condition: The timing of database operations causes conflicts
Common Scenarios That Cause This Issue (1 or 2 is causing your issue)
- Fixed sys_id Generation: Flow creates records with predetermined sys_ids
- Parent Request Updates: Both flows update the same parent request record
- Global Variable Conflicts: Shared variables between flow executions
- Duplicate Record Creation: Same logic running twice creates identical records
Solutions
Solution 1: Create Separate Flows (Recommended)
Best for: Quick resolution and long-term stability
Implementation Steps:
- Navigate to Flow Designer
- Clone your existing flow
- Rename both flows distinctly:
- "Catalog Item A - Processing Flow"
- "Catalog Item B - Processing Flow"
- Update each catalog item to reference its dedicated flow
- Test the Order Guide
Solution 2: Add Flow Synchronization
Best for: When flows must remain shared
Implementation Steps:
- Open your existing flow
- Add a Wait action at the beginning:
Wait Duration: 2 secondsCondition: current.number (creates slight timing differences)
- Implement Try/Catch blocks around record creation actions
- Add proper error handling and logging
Solution 3: Modify Flow Trigger Strategy
Best for: Addressing trigger-level conflicts
Implementation Steps:
- Change trigger from "Record Created" to "Record Updated"
- Add specific trigger conditions:
current.state == '1' && current.active == true && current.u_processed != true
- Implement a flag system to prevent duplicate processing
- Update the flag after successful processing