Room file generation is compile-time.
If it's for game state saving/loading, I would suggest to look into variable_instance_ functions and saving into a buffer instead of JSON-based format. Depending on the game, you may want some custom logic on top (like handling surfaces/data structures, which are going to have different IDs upon load)