Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

Clean up of schedule jobs

_Manu
Tera Contributor

I was given a task of cleaning up unnecessary scheduled jobs and write a report if we don't need any of the scheduled jobs. I found this record in our scheduled jobs list. Not sure which one this is related to or what it does can any one help? please refer screenshot. 

IMG_2346.jpeg

 

1 ACCEPTED SOLUTION

RaghavendraGund
Tera Contributor

Hello @_Manu 

When you create a flow with with trigger type = Scheduled with Daily or Monthly  or any of the available Options.
2 records gets created  one is created in the scheduled job table and other is created in the sys_flow_timer_trigger table.

To find out which flow this scheduled job is associated with 
1. copy the trigger sys id from the screenshot you posted
2. Open sys_hub_flow Table
3. In this list View, you can find a find field called "Remote Trigger ID" , paste your sys_id, you'll find out your flow. please refer screenshot i posted from your PDI.

Please Mark "Helpful" if my Reply added any Value to your question.

Regards
Raghavendra G



View solution in original post

5 REPLIES 5

Rafael Batistot
Kilo Patron

Hi @_Manu 

 

 

This record is automatically generated by the Flow Designer engine whenever a Flow or Subflow is set to run on a time-based trigger (e.g., Daily, Weekly, or Repeat interval).

The script line ⁠sn_flow_trigger.FlowTriggerAPI.fireTimerTrigger('...')⁠ is passing a ⁠sys_id⁠ as a parameter to trigger the execution of that specific Flow.

 

To find the name of the flow may you use this code:

 

var gr = new GlideRecord('sys_hub_flow');
gr.addQuery('sys_id', 'SYS_ID');
gr.query();
if (gr.next()) {
gs.info(gr.name);
}

If this response was helpful, please mark it as Helpful and, if applicable, as Correct.
This helps other users find accurate and useful information more easily

Tanushree Maiti
Tera Patron

Hi @_Manu 

 

In ServiceNow, sn_flow_trigger.FlowTriggerAPI.fireTimerTrigger is the backend method called by system scheduled jobs (sys_trigger) to run time-based Flow Designer triggers.

 

This KB would be helpful on same context: KB1744875 Fix scheduled flows that do not run at configured trigger times 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Doctor ITOM
Mega Guru

Hi @_Manu 

 

I would strongly recommend not deleting it yet. You need to verify if it is still used. 

Follow these steps to verify:

  1. Open the Scheduled Job.

  2. Copy the complete fireItemTrigger() sys_id.

  3. Search it in:

    • sys_hub_flow
    • Flow Designer > Flows
    • Trigger Definitions
  4. Check whether the Flow is:

    • Published
    • Active
    • Last Executed recently

If the Flow is active and still executing, keep the job. If the Flow was deleted but the scheduled job remains, then it is likely an orphan and can usually be removed after validation.

 

Please mark correct/helpful if this solves.

Henni2
Giga Contributor

From the screenshot, it looks like the scheduled job is calling sn_flow_trigger.FlowTriggerAPI.fireTimerTrigger(), which usually means it's related to Flow Designer rather than a custom scheduled script. Before deleting it, I'd check where that trigger ID is referenced and see if it's still linked to an active flow or workflow. If nothing depends on it anymore, disabling it first and monitoring the instance for a few days is usually safer than deleting it immediately.