Identify the release register
I would start with the register that defines what should be issued. For each document, the workflow needs a stable identifier, expected revision, issue purpose, approval state, and source location. Filenames can help staff navigate, but they should not be the only identifier.
The release register must also distinguish drafts from issued documents. If a folder contains working copies and approved files, the automation needs an explicit selection rule. “Use the newest file” is insufficient because a recent draft may be less authoritative than an older approved revision.
The document controller should be able to explain where each expected value comes from. If the register conflicts with the approval record, hold the affected item for review. The model should not choose whichever source appears more polished or more recent without an established precedence rule.