Not quite clear what you are talking about here.
If you mean to run plain old Groovy programs in your workspace, like “Execute Groovy script” in a freestyle project,
node {
git '…'
sh 'groovy ./mystuff.groovy'
}
If you mean to run code inside the Jenkins JVM, you can use `evaluate(String)` (if accessible directly as text) or the `load` step (if a file in a workspace). Both run CPS-transformed.