doc of publish flow