AGENT-822: Check if task exists before attempting to run it