We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

ServiceNow flows and subflow executions data

nayanmule
Kilo Sage

Hello Community,

I have a question regarding flow designer. For how long does Servicenow keep the flow execution of a particular flow after it is completed. 

I checked for one of the Catalog Item flows where the flow was completed and the time I checked 'Flow Context' of it , it gave me a message as - "Flow execution not found".

 

The flow has a subflow running under it and I can't track what is happening on the subflow. 

Do subflows also follow such behaviour after it's completed ? I know that subflows do run independently.

I don't have any problem with the subflow executions being wiped out once the subflow is completed with all the steps. But, I can't find the subflows that should be waiting for approvals , wait for conditions. This is causing issues and RITMs are staying open with no proper flow executions.

 

For now, I can only find the subflow executions that are created a month ago. But I am sure there must be other outstanding subflows that are wiped out even though they were waiting for some condition.

 

Do we have any system property that controls this ? Or how can I keep the subflow executions that are still waiting to be completed.

 

Regards,

Nayan 

4 REPLIES 4

Priyanka64
Tera Contributor

Hello @nayanmule ,

 

Do check the system property 'com.snc.process_flow.reporting.level

Here's a reference - 

https://www.servicenow.com/community/developer-blog/flow-reports-not-available-check-system-property...

 

Please accept my solution if it works for you and thumps up to mark it as helpful.

 

Thanks,

Priyanka

sivasankaris
Tera Guru

Hi @nayanmule ,

  • 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.

Be cautious when increasing retention periods because Flow execution data can consume significant storage.

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

 

If this is helpful.. Please Mark it as Helpful and Please Accept the Solution..

Best Regards,

SIVASANKARI S

yashkamde
Kilo Sage

Hello @nayanmule ,

 

This is the table : Flow engine contexts [sys_flow_context],
Parent table that stores all Workflow Studio context records and their associated process plans. Context records store the state and references to the data used to run a flow or action. See the child tables for context records in specific states.

Refer this for more details :

https://www.servicenow.com/docs/r/yokohama/build-workflows/workflow-studio/flow-reporting.html 

If my response helped mark as helpful and accept the solution.

HaimNizri
Tera Contributor

Flow execution data gets cleaned up automatically through the Flow Context Cleaner job that runs nightly. By default, it keeps completed executions for 30 days and removes them after that.

The key issue you're hitting is that ServiceNow treats "waiting" subflows differently. If a subflow is waiting for approval or a condition, it should still be visible in the Flow Context records, but there's a bug where sometimes the parent flow context gets cleaned up even when subflows are still active.

Check these system properties:
- `sn_fd.flow_context.cleaner.max_completed_age_in_days` (default 30)
- `sn_fd.flow_context.cleaner.max_cancelled_age_in_days` (default 30)

You can increase these values if you need longer retention.

For your immediate problem with missing active subflows:

Navigate to **Flow Designer > Flow Contexts** and filter by:
- State = Waiting
- Created in the timeframe you're concerned about

Also check **Flow Designer > Executions** table directly with similar filters.

If you're still missing executions that should be waiting, this is likely the known issue where parent flows get cleaned up prematurely. The workaround is to create a scheduled job that identifies orphaned RITMs (open RITMs with no active flow context) and either restart the flows or handle them manually.

For prevention, consider adding flow variables or updating the RITM work notes at key subflow checkpoints so you have breadcrumbs even if the execution context disappears.

**If you find my answer useful, please mark it as Helpful and Correct. 😊**