Store a value and reinsert it when flows start

This problem is now solved, thanks to everyone who tried to help me with this. The solution was a bit of everything and also reading some tutorials along the way.