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

Methods#

continueAsNew#

Optional continueAsNew(input, next): Promise<never>

Called when Workflow calls continueAsNew

Parameters#

NameType
inputContinueAsNewInput
nextNext<this, "continueAsNew">

Returns#

Promise<never>


scheduleActivity#

Optional scheduleActivity(input, next): Promise<unknown>

Called when Workflow schedules an Activity

Parameters#

NameType
inputActivityInput
nextNext<this, "scheduleActivity">

Returns#

Promise<unknown>

result of the activity execution


signalWorkflow#

Optional signalWorkflow(input, next): Promise<void>

Called when Workflow signals a child or external Workflow

Parameters#

NameType
inputSignalWorkflowInput
nextNext<this, "signalWorkflow">

Returns#

Promise<void>


startChildWorkflowExecution#

Optional startChildWorkflowExecution(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 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.

Parameters#

NameType
inputStartChildWorkflowExecutionInput
nextNext<this, "startChildWorkflowExecution">

Returns#

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


startTimer#

Optional startTimer(input, next): Promise<void>

Called when Workflow starts a timer

Parameters#

NameType
inputTimerInput
nextNext<this, "startTimer">

Returns#

Promise<void>