Execute Hook Error

I am trying implement the ability to open a file via Loader action. Inside of the Loader action, I am attempting to run this code that I found in scene_operation.py for open_file:

self.parent.execute_hook(
“hook_scene_operation”,
operation=“open”,
file_path=filepath,
context=self.sgtk.context_from_path(filepath),
parent_action=“open_file”,
file_version=fields[“version”],
read_only=False,
)

However, this is giving me the following error:

File “/[my config location]/.config/shotgun/install/core/python/tank/platform/bundle.py”, line 580, in execute_hook
resolved_hook_paths = self.__resolve_hook_expression(key, hook_name)
File “/[my config location]/.config/shotgun/install/core/python/tank/platform/bundle.py”, line 977, in __resolve_hook_expression
unresolved_hook_paths = hook_expression.split(“:”)
AttributeError: ‘NoneType’ object has no attribute ‘split’ //

And I’m not sure why since the key “hook_scene_operation” is already being used in open_file. Is there something obvious I am missing?

Figured it out, self.parent was the loader app and it needed to be the workfiles app. The solution was to get the workfiles app using

workfiles_app = engine.apps[“tk-multi-workfiles2”]

And then execute hook via the workfiles app