The getExecution() function retrieves an execution by its ID and may include its result based on the execution state.

import { getExecution } from "@defer/client";
import { sayHello } from "./defer/sayHello";

const { id } = await sayHello("John Doe");
const response = await getExecution(id);

console.log(response.state, response.result);