This paper introduces a comprehensive framework for planning and operating a zonal-based flexible transit (FT) service, a public transit mode designed to accommodate uncertain demand patterns. The framework addresses both offline planning based on stochastic demand distributions and cancellations, as well as online routing considering real-time orders and cancellation behaviour. Offline interzonal route planning is formulated as a two-stage recourse problem, while the intrazonal routing problem is modelled using a Markov decision process (MDP) that incorporates online information. To solve the problem, a service reliability-based decomposition method is employed to divide the problem into three mixed-integer subproblems. The first subproblem focuses on designing interzonal routes up to a specific demand level, taking into account a designated cancellation probability as determined by reliability measures. An insertion heuristic is developed for this subproblem to improve the solution efficiency. The second subproblem allocates passengers from certain categories to vehicles based on the passenger volume designated by reliability measures. Lastly, the third subproblem refines the vehicle intrazonal route according to the passenger assignment from the previous subproblem. The reliability measures are optimised iteratively until no further improvements are observed in consecutive iterations. The proposed FT service’s performance is evaluated using numerical simulations based on real New York City (NYC) taxi demand data, illustrating the effectiveness of the integrated planning and operational approach in accommodating uncertainties in on-demand transit systems.