The `workflow_job_monitor_set_pid()` should be inside the `if {...}` block.