import { proxyActivities , isCancellation , ActivityCancellationType } from '@temporalio/workflow' ; import type * as activities from './activities' ; const { fakeProgress } = proxyActivities < typeof activities > ( { startToCloseTimeout : '60s' , heartbeatTimeout : '3s' , cancellationType : ActivityCancellationType . WAIT_CANCELLATION_COMPLETED , } ) ; export async function runCancellableActivity ( ) { try { await fakeProgress ( ) ; } catch ( err ) { if ( isCancellation ( err ) ) { console . log ( 'Workflow cancelled along with its activity' ) ; } throw err ; } }