Skip to content

Function: useStepCtx()

ts
function useStepCtx<T>(ctx: T): T & {
  page: Page;
  renderer: WorkflowSkillRenderer;
};

Defined in: src/workflow-step-ctx/index.ts:86

Enrich a workflow ctx with live host handles. Idempotent — if page / renderer are already present, they're left untouched (so a step called by another step receives the parent's already-enriched ctx).

Typed loosely because the workflow-side ctx is a {skillId, targetId} record but the SDK's Context carries many fields a workflow doesn't provide (signal, browser, render, languageCode, …). The cast pins the step's expectations to the surface area it actually uses (page, renderer, plus whatever the workflow propagates).

Type Parameters

Type Parameter
T extends { skillId: string; targetId: string; page?: unknown; renderer?: unknown; }

Parameters

ParameterType
ctxT

Returns

T & { page: Page; renderer: WorkflowSkillRenderer; }

Matterway Assistant SDK Documentation