Trying to access previous tasks output for javascript task

My code is not returning anything to the log, I think I am following the proper format, must be something I am missing?

Note: Format taken from - Run JavaScript action for Workflows — Dynatrace Docs

Note: The previous task which completes successfully is - “get_unhealthy_workers”

import { execution } from ‘@dynatrace-sdk/automation-utils’;
import { eventsClient } from “@dynatrace-sdk/client-classic-environment-v2”;

export default async function ({ execution_id }) {
var ex = await execution(execution_id);
var getunhealthyworkers = await ex.result(‘get_unhealthy_workers’);
console.log('The whole result object: ', getunhealthyworkers.alertText);

}

The log from the execution:

The whole result object: undefined

The code looks ok, could you verify the task get_unhealthy_workers actually has a result?
You can check that in an execution by looking at the result tab of the task details, example:

Thanks, I had forgotten to make sure return worked, simple fix.