How to define Activity Return Values in TypeScript
To import the types of the Activities defined in ./activities
, you must first retrieve an Activity from an Activity Handle before you can call it, then define Return Types in your Activity.
import type * as activities from './activities';
const { greet } = proxyActivities<typeof activities>({
startToCloseTimeout: '1 minute',
});
// A workflow that simply calls an activity
export async function example(name: string): Promise<string> {
return await greet(name);
}