Use a flag as a countdown timer.
Define a Flag and give it a name, something like "Water Shutoff Timer"
In the code below I am using "Water Valve" for the output or unit that controls your water valve.
Then the program is easy.
WHEN AWAY
THEN Water Shutoff Timer ON FOR 1 HOUR
WHEN Water Shutoff Timer OFF
AND IF AWAY
THEN Water Valve OFF
WHEN OFF
THEN Water Valve ON
I added the AND IF AWAY conditional so that if you were only away for a short time *not a full hour) and came back before the timer ran out the valve would not shut off after you returned.
I added the third block to automatically turn the water back on when you return.
Instead of the AND IF AWAY conditional, you could add a set command to the OFF sequence of events, like this:
WHEN AWAY
THEN Water Shutoff Timer ON FOR 1 HOUR
WHEN Water Shutoff Timer OFF
THEN Water Valve OFF
WHEN OFF
THEN Water Valve ON
THEN Water Shutoff Timer SET TO 0
The "Set to 0" turns the flag state to off without generating an "OFF" trigger event.
However, the second way without the conditional can be a bit tricky.
You have to ensure you get the flag to an off state or it will keep counting down.
Once it counts down to 0, the second block of code will execute (regardless of the arming condition) and turn the water off.
So if any other block of code turns that timer on, you have to remember to set it to 0 if the timer has not yet reached 0.
Either way will work, the first method is more sure you don't have an inadvertent turning off of the water.
It really depends on other programming blocks as to which method ends up being more efficient.