Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Creating duplicate tasks with create catalog task action in flow designer

PrasadK43791691
Mega Contributor

I have used create catalog task action in flow designer. while testing the flow there were two similer SCTASKs created as duplicate. how we can fix this?

6 REPLIES 6

mohithreddy
Mega Contributor

Duplicate SCTASKs from the Create Catalog Task action almost always mean the flow ran twice, not that the action fired twice. Check these in order: 1) Flow trigger - if it is "Service Catalog" plus an extra "Created or Updated" record trigger on sc_req_item, or the same flow is also attached to the catalog item AND called from a subflow/business rule, you get two runs. Keep only one entry point. 2) Open the RITM in Flow Designer > Runtime/Executions (or flow_context list filtered on your RITM sys_id) - if you see two contexts, it is a trigger duplication, not an action bug. 3) If there is only one context but two tasks, look for a Do-Until / For Each loop wrapping the Create Catalog Task step, or a duplicated step copied during editing. 4) Also check for an old Workflow still published on the same catalog item - Workflow + Flow both create the task. Set the item's Flow field and deactivate/unpublish the workflow. 5) During testing, "Test" runs plus a real order can look like duplicates - clear old contexts before comparing. Quick guard if you cannot remove the second trigger: before the Create Catalog Task step add an If condition with a GlideRecord/lookup on sc_task where request_item = trigger RITM and short_description = your task name, and only create when the count is 0.

Hello @mohithreddy ,

Thanks for the detailed troubleshooting steps. This issue has been fixed.