@HaveF I have created an example like this. You have a code as a string and dynamically write that to a (temporary) folder and use that as a source. The example is about a Python code. Maybe you can adapt that.
Not the most elegant solution but it could work.