Migrate to new Flow API

Change-Id: Ifb6d4f302f01d836ef12db76986bc85e95c1a934
Merge "Migrate to new Flow API" into frontend-rewrite