Flow encoding