The activity-internal API surface, exposed as Durable.activity. Methods on this class are designed to be called inside an activity function — they read from the activity's AsyncLocalStorage context that is populated by the activity worker before invoking the user's function.

import { Durable } from '@hotmeshio/hotmesh';

export async function processData(data: string): Promise<string> {
const ctx = Durable.activity.getContext();
console.log(`Activity ${ctx.activityName} for workflow ${ctx.workflowId}`);
console.log(`Metadata:`, ctx.headers);
return `Processed: ${data}`;
}

Constructors

Methods

Constructors

Methods

  • Returns the current activity's execution context. Only available inside an activity function invoked by the durable activity worker.

    Returns DurableActivityContext

    The activity context including name, args, metadata, and parent workflow info.

    If called outside of an activity execution context.