Currently we do expression serialization on all nodes, including the gateway, if the flow is distributed: in MakeExpression we call ctx.IsLocal() to decide whether we should serialize the expression, and that call returns true only when PlanningCtx.isLocal is true which is the case only when the flow is not distributed. I think we could be smarter and avoid the serialization on the gateway node, but it doesn't seem trivial.