Would it be possible to create a script in one PythonCaller with a number of functions, and then call the functions in that script from another PythonCaller using the 'from <script_name> import <function_name>' syntax?
Within one PythonCaller script, are you able to call functions defined in other PythonCaller scripts in the FME workbench ?

Best answer by david_r
Yes, you can, but not exactly as you propose. For example, you can import modules that are saved in the same directory as your workspace file. This works because FME automatically adds the current workspace directory to the PythonPath when the workspace is running. This is also mentioned in the log.
Since the entire workspace is using the same Python interpreter, it is also possible to reference objects between different PythonCallers, but there are some potential pitfalls so this is something that I always try to avoid.
But as an example, you can define a global variable in the startup script and retrieve the value in e.g. a PythonCaller later on.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.