sub process (%chapters) { await do for %chapters.kv -> $number, $content { start { note "Chapter $number started"; &?ROUTINE.outer.($content) if $content ~~ Hash; sleep 1; # here the chapter itself is processed note "Chapter $number finished"; } } } process(%document);