You can create a custom workout in Zwift based on a GPX file of a route.
See the monthly Megathread: Zwift Resource Megathread - November 2022 đź—ş
Specifically, this tool: Convert GPX file to Zwift workout | What's on Zwift?
Using a head unit (aka “Bike Computer”) with smart trainer control is another option, as @Steve_Hammatt suggested. “Potato/tomacco”.