The loaded file can contain statements at top level or just load and run a closure. For example:
def flow node('slave') { flow = load 'flow.groovy' flow.functionA() } flow.functionB()
Where flow.groovy
defines functionA and functionB functions (among others) before ending with return this;