Patch for writing the default flow for gateways