Type > Text Variables > Define...
Then define a variable.
For example, I would use Month and Year as the variable. It makes it easier and more descriptive overall. Depending upon how often the document changes, adding day as well may help.
So....
Note the Preview
. That's what the auto-text will look like.
Then, somewhere in your document create a text frame and choose Type > Text Variables > Insert Variable
and choose the variable you just created. Set the font, size, style, etc you want.
Now every time you modify the document and save it the variable will be updated after the save. So before outputting, you need to save the file for the variable to be updated.
I usually open a file, make my first change and save - that ensure variables based upon file modifications update. Then continue on with any changes.
If you need something even more specific...
See the Preview
area above.
Here I've used the hour (00-23) - year.month.day
And it's possible to also add minutes, or seconds, if by the hour isnis still not targeted enough.
Unfortunately, I'm not aware of any auto-numbering that is merely standard numbers within InDesign. The only auto-numbering which exists are all based upon document frameworks such as page numbers, chapter numbers, sections, etc. You really can't add a random number that auto-updates. You would need to run a script to update it or manually update it. Both of which would require more interaction that merely using a timestamp as a text variable.
Frankly, if you can't configure a variable based upon file modification, then manually update a number whenever you open the file.