AWS Thinkbox Discussion Forums

Run post job script even when the main task is failed

My MaxScript job has 1 task and a post job script.
The post job script will report job status to our internal server, so I need it to be run even when the task is failed.
Currently, whenever the main task fails, the post job script also be marked as failed too (without executing).
Is there any setting to run post job script even when the main task is failed?

As far as I know, you need something like an Event script for this. You can catch job and task errors pretty easily, and do whatever status updates you need from there. Just be aware of some pitfalls like what I’ve outlined here.

On a side-note, I personally think you might want to reconsider what you put in the post-job script if you also want it to run on failure. You can do whatever you want of course, but handling checkins/versions/API communication and hooking on further processing of successful jobs seems to me the best use for post-job scripts.

1 Like

Yes, seem like event is the formal way to go.
Thank you a lot @danielskovli!

1 Like
Privacy | Site terms | Cookie preferences