Skip to main content

Interface: WorkflowOutboundCallsInterceptor

workflow.WorkflowOutboundCallsInterceptor

Implement any of these methods to intercept Workflow code calls to the Temporal APIs, like scheduling an activity and starting a timer.

Hierarchy​

  • SystemNexusWorkflowOutboundCallsInterceptor

    ↳ WorkflowOutboundCallsInterceptor

Implemented by​

Properties​

continueAsNew​

• Optional continueAsNew: (input: ContinueAsNewInput, next: OmitLastParam<(input: ContinueAsNewInput, next: OmitLastParam<...>) => Promise<never>>) => Promise<never>

Called when Workflow calls continueAsNew.

Type declaration​

▸ (input, next): Promise<never>

Parameters​
NameType
inputContinueAsNewInput
nextOmitLastParam<(input: ContinueAsNewInput, next: OmitLastParam<...>) => Promise<never>>
Returns​

Promise<never>


getLogAttributes​

• Optional getLogAttributes: (input: GetLogAttributesInput, next: OmitLastParam<(input: GetLogAttributesInput, next: OmitLastParam<...>) => Record<string, unknown>>) => Record<string, unknown>

Called on each invocation of the workflow.log methods.

The attributes returned in this call are attached to every log message.

Type declaration​

▸ (input, next): Record<string, unknown>

Parameters​
NameType
inputGetLogAttributesInput
nextOmitLastParam<(input: GetLogAttributesInput, next: OmitLastParam<...>) => Record<string, unknown>>
Returns​

Record<string, unknown>


getMetricTags​

• Optional getMetricTags: (input: MetricTags, next: OmitLastParam<(input: MetricTags, next: OmitLastParam<...>) => MetricTags>) => 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.

Type declaration​

▸ (input, next): MetricTags

Parameters​
NameType
inputMetricTags
nextOmitLastParam<(input: MetricTags, next: OmitLastParam<...>) => MetricTags>
Returns​

MetricTags


scheduleActivity​

• Optional scheduleActivity: (input: ActivityInput, next: OmitLastParam<(input: ActivityInput, next: OmitLastParam<...>) => Promise<unknown>>) => Promise<unknown>

Called when Workflow schedules an Activity.

Type declaration​

▸ (input, next): Promise<unknown>

Parameters​
NameType
inputActivityInput
nextOmitLastParam<(input: ActivityInput, next: OmitLastParam<...>) => Promise<unknown>>
Returns​

Promise<unknown>


scheduleLocalActivity​

• Optional scheduleLocalActivity: (input: LocalActivityInput, next: OmitLastParam<(input: LocalActivityInput, next: OmitLastParam<...>) => Promise<unknown>>) => Promise<unknown>

Called when Workflow schedules a local Activity.

Type declaration​

▸ (input, next): Promise<unknown>

Parameters​
NameType
inputLocalActivityInput
nextOmitLastParam<(input: LocalActivityInput, next: OmitLastParam<...>) => Promise<unknown>>
Returns​

Promise<unknown>


signalWithStartWorkflow​

• Optional signalWithStartWorkflow: (input: SignalWithStartWorkflowRequest, next: (input: SignalWithStartWorkflowRequest) => Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>) => Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>

Type declaration​

▸ (input, next): Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>

Parameters​
NameType
inputSignalWithStartWorkflowRequest
next(input: SignalWithStartWorkflowRequest) => Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>
Returns​

Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>

Inherited from​

SystemNexusWorkflowOutboundCallsInterceptor.signalWithStartWorkflow


signalWorkflow​

• Optional signalWorkflow: (input: SignalWorkflowInput, next: OmitLastParam<(input: SignalWorkflowInput, next: OmitLastParam<...>) => Promise<void>>) => Promise<void>

Called when Workflow signals a child or external Workflow.

Type declaration​

▸ (input, next): Promise<void>

Parameters​
NameType
inputSignalWorkflowInput
nextOmitLastParam<(input: SignalWorkflowInput, next: OmitLastParam<...>) => Promise<void>>
Returns​

Promise<void>


startChildWorkflowExecution​

• Optional startChildWorkflowExecution: (input: StartChildWorkflowExecutionInput, next: OmitLastParam<(input: StartChildWorkflowExecutionInput, next: OmitLastParam<...>) => Promise<[Promise<string>, Promise<unknown>]>>) => Promise<[Promise<string>, Promise<unknown>]>

Called when Workflow starts a child workflow execution.

The interceptor function returns 2 promises:

  • The first resolves with the runId when 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.

Type declaration​

▸ (input, next): Promise<[Promise<string>, Promise<unknown>]>

Parameters​
NameType
inputStartChildWorkflowExecutionInput
nextOmitLastParam<(input: StartChildWorkflowExecutionInput, next: OmitLastParam<...>) => Promise<[Promise<string>, Promise<unknown>]>>
Returns​

Promise<[Promise<string>, Promise<unknown>]>


startNexusOperation​

• Optional startNexusOperation: (input: StartNexusOperationInput, next: OmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>) => Promise<StartNexusOperationOutput>

Called when Workflow starts a Nexus Operation.

Type declaration​

▸ (input, next): Promise<StartNexusOperationOutput>

Parameters​
NameType
inputStartNexusOperationInput
nextOmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>
Returns​

Promise<StartNexusOperationOutput>


startSystemNexusOperation​

• Optional startSystemNexusOperation: (input: StartNexusOperationInput, next: OmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>) => Promise<StartNexusOperationOutput>

Called when Workflow starts a Temporal System Nexus operation.

Type declaration​

▸ (input, next): Promise<StartNexusOperationOutput>

Parameters​
NameType
inputStartNexusOperationInput
nextOmitLastParam<(input: StartNexusOperationInput, next: OmitLastParam<...>) => Promise<StartNexusOperationOutput>>
Returns​

Promise<StartNexusOperationOutput>


startTimer​

• Optional startTimer: (input: TimerInput, next: OmitLastParam<(input: TimerInput, next: OmitLastParam<...>) => Promise<void>>) => Promise<void>

Called when Workflow starts a timer.

Type declaration​

▸ (input, next): Promise<void>

Parameters​
NameType
inputTimerInput
nextOmitLastParam<(input: TimerInput, next: OmitLastParam<...>) => Promise<void>>
Returns​

Promise<void>