Is it possible to have background tasks?

I would like to do some automated cleanup / garbage collection / reorganization of my content. Is this possible to hook this to Logseq (in the form of a plugin that would run in the background)?

What do you mean by cleanup?

I mean tasks that would modify the existing pages, add some context, delete empty ones, build possible links that were missed - all kinds of tasks that could run in the background.

Possible with plugins.