How do you diagnose workflow issues in production if there are no logs???

smacleod
Tera Guru

We would like to keep the logs on for all of our workflows in production so we can review them when there is an error (was this a strange edge case, did something move too fast, etc.) but the system retains all of the logs and has no setting (that I have found) for clearing them out on a regular basis. Is there a setting I am missing or do I need to set up a scheduled flow or script to clear out the older logs so we can review them while keeping our server size managable?

4 REPLIES 4

Rafael Batistot
Kilo Patron

Hi @smacleod 

 

May this support help you 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538547

 

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

I was talking about the workflow studio not the old flow editor

Ehab Pilloor
Mega Sage

Hi @smacleod,

 

  • In ServiceNow Flow Designer completed flow execution records are retained only for a limited time (typically around 2 weeks), after which they are automatically deleted by the Table Cleaner job.
  • Subflows follow the same mechanism since they also use the Flow Engine and store execution data in the same sys_flow_context table.
  • If you see the message “Flow execution not found”, it usually means the context record has already been removed by the cleanup job.

The retention period of flow is controlled by Table Cleanup (sys_auto_flush) records rather than a simple system property. You can review or adjust the cleanup rules by navigating to:

  • All→ Table Cleanup
  • and filtering for tables starting with sys_flow_.
  • There you can increase the Age in seconds field value.

EhabPilloor_0-1785242855140.png

Note that flows or subflows that are still in a waiting state (approval, wait condition, etc.) should not be deleted, so if executions are missing while RITMs remain open, it may indicate the flow completed, errored, or never triggered properly.

 

Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.

 

Kind Regards,

Ehab Pilloor

This appears to not be running or is selectively running,  I am able to see full flow engine contexts from months ago. The table cleanup for the flow contexts is active, where do I see what actually runs it?