After T117786: Run maintenance/FlowPopulateRefId.php on all production wikis is done, run db_patches/patch-ref_id-phase2.sql from https://gerrit.wikimedia.org/r/#/c/238393/ . At this point, that change will be merged.
This has to be done on flowdb on extension1, and officewiki on the standard cluster.
This is to ensure that all Flow tables have a PK; see T109676. I have tested that Flow works continually if the deployment plan given on that Gerrit is followed.