$\newcommand{\ket}[1]{\left \lvert #1 \right \rangle}$
Context
Consider a system described by
$$H(t) = H_0 + V_0 v(t) \mathcal{O}$$
where $V_0$ defines the strength of a time dependent perturbation, $v(t)$ is a dimensionless function of time, and $\mathcal{O}$ is a dimensionless operator. Supposing the system starts in state $\ket{i}$, the second order contribution to the probability to transition to state $\ket{f}$ is
\begin{align} \langle f | \Psi(t) \rangle =& - \left( \frac{V_0^2}{\hbar}\right)^2 \sum_n \langle f | \mathcal{O} | n \rangle \langle n | \mathcal{O} | i \rangle \\ \times & \int_0^t dt' v(t') \exp(i(\omega_f - \omega_n)t') \int_0^{t'} dt'' v(t'') \exp(i(\omega_n - \omega_i)t'') \, . \end{align} I would like to interpret this in terms of the so-called "virtual transitions" to and from the intermediate states $\ket{n}$.
What I understand
It's obvious that the system goes from $\ket{i} \rightarrow \ket{n} \rightarrow \ket{f}$ and that the matrix elements of $\mathcal{O}$ play into the amplitudes for those transitions. It's also clear that the drive function $v$ has to have spectral content near the $\omega_f - \omega_n$ and $\omega_n - \omega_i$ transitions.
Question
How do we interpret the limits on the integrals? I want to think of the process as two sequential first order processes, one for $\ket{i} \rightarrow \ket{n}$ going from time 0 to time $t'$ and then another for $\ket{n} \rightarrow \ket{f}$ going from time $t'$ to time $t$. With that thinking, we'd have something like \begin{equation} \int_0^t dt' \left( \int_{t'}^t dt'' v(t'') e^{i (\omega_f - \omega_n)t''} \int_0^{t'} dt'' v(t'') e^{i (\omega_n - \omega_i)t''} \right) \end{equation} which is incorrect.