I am presuming that your template is unchanging, hence the
caching of the results.
To that end, you could store the template as a string in
local memory at package startup. The template is only a
string so at the appropriate step in your Flow, load the
template from memory and then apply the Pipeline object to
it.
If this will fit your needs, let me know and we’ll take it
from there.