Nuke Script in MetaData/Header of EXR



I am currently working on trying to implement a workflow where the Nuke script is written into the metadata/header of the EXR files. Wondering if anyone has done this before and if so, how is this best achieved inside Nuke. I’m thinking of perhaps grabbing the comp script data, turning it into a string and embedding it into the metadata, however perhaps the metadata has a limit? Inversely, a similar “extractor” script would pull the script open inside Nuke if needed.

Any thoughts, knowledge, experience would be greatly appreciated. The purpose would be for the Nuke script to be available with any EXR image file without the need for an accompanying comp script.