Can I delete workflow XML files?

On my Jenkins master that keeps ca ~78000 historical pipeline jobs, I have accumulated large amount of XML files in the “workflow” subdirectory for every build. With 150 steps per job this means over 11 million small files.

We have started running into issues with our backup system - listing all the files and checking for incremental changes takes time and above all memory.

Currently I can’t discard old jobs altogether. I have cleaned up unnecessary artifacts to reduce the number of files and now workflow XML files make 90% of the files stored on the filesystem.

If I delete them how this will affect Jenkins? No nice squares or workflow steps in Blue Ocean? Anything more serious?

I am using point in time restore to roll back failed Jenkins core/plugin upgrades, so it is important that restore brings back files as stored by the older plugins.

Hello @saper :wave:

I guess it’s too late now, but you could maybe use Workspace Cleanup ?
As far as I know, it is safe to remove the workspace for a given Jenkins job as long as the job is not currently running. So you could remove the files without issues… unless you prove me wrong.

1 Like

It is never too late and thank you for the answer, @poddingue !

  1. yes we use it but at the start of the build, not at the end, to make sure we have a clean workspace on non-Kubernetes static workers (we use both K8 and static ones), but…

  2. If I see correctly, workspace gets stored under $JENKINS_HOME/workspaces directory, and those get purged as we need, but workflow files in questions are stored in


Similary, the retained artifacts are stored in


We can purge the archive easily and the effect is just losing the artifacts.

But workflow is neither part of the artifact storage (archive) nor the workspace (completely different directory under $JENKINS_HOME/workspaces) - it kind of belongs to the job history (along with the build.xml, changelogXXX.xml and the console output)

I suspect they are removed only when the build is removed altogether, the question would be if I can keep the build itself and its log and maybe even selected artifacts in the archive, but get rid of the workflow files without losing too much.

1 Like

Thanks for your detailed feedback Marcin.
Unfortunately, I don’t have the answer to your questioning, but I feel the same…
Hopefully, you will be able to clean the job history without losing anything (but the history).

1 Like