Gateway Script global name not defined

Define functions in a project script module. Call those functions as project.someName.functionName(). In the designer, navigate to Project => Scripts => Script Library.