This guide covers theDocumentation Index
Fetch the complete documentation index at: https://docs.output.ai/llms.txt
Use this file to discover all available pages before exploring further.
@outputai/core hook payload and activity context changes in v0.6.0.
What changed
- Hook payloads no longer expose flat
workflowId,runId,workflowName,activityId, oractivityNamecontext fields. - Workflow lifecycle hooks now receive
workflowDetailsinstead ofid,runId,name, andduration. - Activity-scoped hooks and custom events now receive Temporal’s
activityInfo, Output’sworkflowDetails, andoutputActivityKind. - The
on()hook envelope now containseventId,eventDate,workflowDetails,activityInfo, andoutputActivityKind. getExecutionContext()now returns{ activityInfo, workflowFilename }when activity context is available.HttpRequestHookPayloadwas removed. Pass event attributes directly toon<TAttributes>()instead.- Trace workflow node ids now use Temporal
runId, improving traces for child workflows that continue as new.
Migration steps
Update workflow lifecycle hooks
UseworkflowDetails for workflow ids and type.
Before
After
onWorkflowEnd() and onWorkflowError() use the same workflowDetails shape. The old lifecycle duration field is no longer part of the hook payload.
Update error hooks
Activity errors now expose Temporal activity info and workflow details instead of flat ids and names.Before
After
activityInfo is Temporal’s Activity execution info object. See Temporal’s activity.Info reference. workflowDetails is Output’s serializable subset of Temporal’s workflow.WorkflowInfo.
Update custom event hooks
Events emitted withemitEvent() still include your custom payload, eventId, and eventDate. When emitted from an Output activity, the contextual fields are now activityInfo, workflowDetails, and outputActivityKind.
outputActivityKind is one of step, evaluator, or internal_step.
Before
After
http:request, cost:http:request, and cost:llm:request.
Update TypeScript hook payload types
Theon() hook now lets you type event-specific attributes directly through its generic. Core still owns the common envelope (eventId, eventDate, workflowDetails, activityInfo, and outputActivityKind); event-emitting packages own their event attribute types.
HttpRequestEvent and HttpRequestCostEvent from @outputai/http, and LLMUsageEvent from @outputai/llm.
| Event name | Import type from | Use with on<T>() |
|---|---|---|
http:request | @outputai/http | on<HttpRequestEvent>( 'http:request', handler ) |
cost:http:request | @outputai/http | on<HttpRequestCostEvent>( 'cost:http:request', handler ) |
cost:llm:request | @outputai/llm | on<LLMUsageEvent>( 'cost:llm:request', handler ) |
OnHookEnvelope, and the full merged payload type is OnHookPayload<TAttributes>.
Update activity integration context usage
If you use the internal@outputai/core/sdk_activity_integration helpers, getExecutionContext() now returns Temporal’s activity info plus the workflow file path.
Before
After
Check trace consumers
Trace file names still useworkflowId, but workflow node ids inside trace entries now use runId. If you parse trace JSON directly, update code that assumed a workflow trace node id was the workflow id.
This makes traces more accurate for child workflows that continue as new, because each Temporal run has a distinct node id.
Checklist
- Replace workflow lifecycle hook destructuring of
id,runId,name, ordurationwithworkflowDetails. - Replace activity hook destructuring of
activityId,activityName,workflowId, orworkflowNamewithactivityInfoandworkflowDetails. - Update
on('http:request'),on('cost:http:request'), andon('cost:llm:request')handlers to read context fromactivityInfoandworkflowDetails. - Replace
HttpRequestHookPayloadwith package-owned event attribute types passed toon<TAttributes>(). - Update any
getExecutionContext()usage to read fromactivityInfo. - Update direct trace JSON consumers to use
runIdfor workflow node ids.