Workflow - Where to check for problems and see the code? I can't find what I'm expecting

Can someone advise me where to find the workflow code generated from creating custom workflows?

I need to fix some errors that can’t be fixed using studio.

I also want to use the structure to learn how to create logic hooks.

I’m operating 7.9.8 and having all sorts of problems, primarily with email templates and especially workflow. I can’t get some workflows to work and some workflows when I examine them, the fields are missing.

Looking at other threads in the forum, it appears that the SQL code should be located in /custom/modules/MODULENAME/logichook.php

I have lots of custom workflows, including workflows that are functioning and I see records in aow_workflow table that reflect the workflows, albeit I’m not able to find the PHP code?