Interface: WorkflowOutboundCallsInterceptor
Implement any of these methods to intercept Workflow code calls to the Temporal APIs, like scheduling an activity and starting a timer.
Extends
SystemNexusWorkflowOutboundCallsInterceptor
Properties
continueAsNew?
optionalcontinueAsNew?: (input,next) =>Promise<never>
Called when Workflow calls continueAsNew.
Parameters
input
next
OmitLastParam<(input: ContinueAsNewInput, next: OmitLastParam<...>) => Promise<never>>
Returns
Promise<never>
getLogAttributes?
optionalgetLogAttributes?: (input,next) =>Record<string,unknown>
Called on each invocation of the workflow.log methods.
The attributes returned in this call are attached to every log message.
Parameters
input
next
OmitLastParam<(input: GetLogAttributesInput, next: OmitLastParam<...>) => Record<string, unknown>>
Returns
Record<string, unknown>
getMetricTags?
optionalgetMetricTags?: (input,next) =>MetricTags
Called once every time a metric is emitted from a Workflow metric (ie. a metric created from workflow.metricMeter).
Tags returned by this hook are prepended to tags defined at the metric level and tags defined on the emitter function itself.
Parameters
input
next
OmitLastParam<(input: MetricTags, next: OmitLastParam<...>) => MetricTags>
Returns
scheduleActivity?
optionalscheduleActivity?: (input,next) =>Promise<unknown>
Called when Workflow schedules an Activity.
Parameters
input
next
OmitLastParam<(input: ActivityInput, next: OmitLastParam<...>) => Promise<unknown>>
Returns
Promise<unknown>
result of the activity execution
scheduleLocalActivity?
optionalscheduleLocalActivity?: (input,next) =>Promise<unknown>
Called when Workflow schedules a local Activity.
Parameters
input
next
OmitLastParam<(input: LocalActivityInput, next: OmitLastParam<...>) => Promise<unknown>>
Returns
Promise<unknown>
result of the activity execution
signalWithStartWorkflow?
optionalsignalWithStartWorkflow?: (input,next) =>Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>
Parameters
input
SignalWithStartWorkflowRequest
next
(input) => Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>
Returns
Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>
Inherited from
SystemNexusWorkflowOutboundCallsInterceptor.signalWithStartWorkflow
signalWorkflow?
optionalsignalWorkflow?: (input,next) =>Promise<void>
Called when Workflow signals a child or external Workflow.
Parameters
input
next
OmitLastParam<(input: SignalWorkflowInput, next: OmitLastParam<...>) => Promise<void>>
Returns
Promise<void>
startChildWorkflowExecution?
optionalstartChildWorkflowExecution?: (input,next) =>Promise<[Promise<string>,Promise<unknown>]>
Called when Workflow starts a child workflow execution.
The interceptor function returns 2 promises:
- The first resolves with the
runIdwhen the child workflow has started or rejects if failed to start. - The second resolves with the workflow result when the child workflow completes or rejects on failure.
Parameters
input
StartChildWorkflowExecutionInput
next
OmitLastParam<(input: StartChildWorkflowExecutionInput, next: OmitLastParam<...>) => Promise<[Promise<string>, Promise<unknown>]>>
Returns
Promise<[Promise<string>, Promise<unknown>]>
startNexusOperation?
optionalstartNexusOperation?: (input,next) =>Promise<StartNexusOperationOutput>
Called when Workflow starts a Nexus Operation.
Parameters
input
next
OmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>
Returns
Promise<StartNexusOperationOutput>
startSystemNexusOperation?
optionalstartSystemNexusOperation?: (input,next) =>Promise<StartNexusOperationOutput>
Called when Workflow starts a Temporal System Nexus operation.
Parameters
input
next
OmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>
Returns
Promise<StartNexusOperationOutput>
startTimer?
optionalstartTimer?: (input,next) =>Promise<void>
Called when Workflow starts a timer.
Parameters
input
next
OmitLastParam<(input: TimerInput, next: OmitLastParam<...>) => Promise<void>>
Returns
Promise<void>