Open file, detach, audit, run graphs, save and close

Im not really sure if this is possible or not, but ill ask anyway.
I am in the process of creating a large “project file clean-up” tool and i ahve a series of graphs in a single file which does:
Remove imported .dwg files
Removes imported .dwg line styles
Removes sheets which do not meet a parameter requirement
Removes all non-required views.
I am also working on a graph to remove all non-used / standard sub-categories (not quite working yet)

What i would like to do is open this file in the background, using the detach from central option, run the above scripts and then save the file to a designated folder location.

I have seen the Applications.OpenDocumentFile and Application.CloseDocument nodes (at the bottom of the image), but i just dont know how to patch these as the graphs above dont have a Document input?

Is there a way to do this?

Can you zoom in and retake the picture so that we can see what nodes you are using? Thanks!