How to set up a post job script?

I’m completely new to Unreal and i just want to integrate it to our pipeline with Shotgrid. I already wrote the Script to upload it and it works fine. I just don’t know how to make it work that this Script will be executed after the render job is done. A person in our crew build the render graph setup in unreal (I never saw that, don’t know how it looks like) and sent me this link

to inform me how to integrate the script. He just also doesn’t really know how to do that. So how I would understand it so far, is that I should make a new script in which I’ll write the on_job_finished-function and in this function I need to extract the output directory of the rendered exr files, the comment and description of the job if there are any. I need these things for my script to work. Then from there I’ll open my script to upload it to shotgrid with these three things as arguments.
That’s what I want but how should the post job script be built? Do I just need to write the class and the function like it is in the link (with some addition to extract the things) and then it’ll work?
And how would I extract the output directory, the comment and the creator of the job?
And how do I let the post job script run so that it’ll only start when the job is finished?
As you can see, I’m lost here and I’d really appreciate it if someone has an idea:)