The study of mediation of treatment effects, or how treatments work, is important to understanding and improving psychological and behavioral treatments, but applications often focus on mediators and outcomes measured at a single time point. Such cross-sectional analyses do not respect the implied temporal ordering that mediation suggests. Clinical trials of treatments often provide repeated measures of outcomes and, increasingly, of mediators as well. Repeated measurements allow the application of various types of longitudinal structural equation mediation models. These provide flexibility in modeling, including the ability to incorporate some types of measurement error and unmeasured confounding that can strengthen the robustness of findings. The usual approach is to identify the most theoretically plausible model and apply that model. In the absence of clear theory, we put forward the option of fitting a few theoretically plausible models, providing a type of sensitivity analysis for the mediation hypothesis. In this tutorial, we outline how to fit several longitudinal mediation models, including simplex, latent growth and latent change models. This will allow readers to learn about one type of model that is of interest, or about several alternative models, so that they can take this sensitivity approach. We use the Pacing, Graded Activity, and Cognitive Behavioral Therapy: A Randomized Evaluation (PACE) trial of rehabilitative treatments for chronic fatigue syndrome (ISRCTN 54285094) as a motivating example and describe how to fit and interpret various longitudinal mediation models using simulated data similar to those in the PACE trial. The simulated data set and Mplus code and output are provided.