async function getStaleVMInstances(prefix = PREFIX) {
  const projectId = await instancesClient.getProjectId();
  const result = [];
  const currentDate = new Date();
  currentDate.setHours(currentDate.getHours() - 1);

  const aggListRequest = instancesClient.aggregatedListAsync({
    project: projectId,
  });

  for await (const [zone, instancesObject] of aggListRequest) {
    const instances = instancesObject.instances;
    result.push(
      ...instances
        .filter(
          instance =>
            new Date(instance.creationTimestamp) < currentDate &&
            instance.name.startsWith(prefix)
        )
        .map(instance => {
          return {
            zone: zone.split('zones/')[1],
            instanceName: instance.name,
            timestamp: instance.creationTimestamp,
          };
        })
    );
  }

  return result;
}
Get VM instances created more than one hour ago.