Skip to main content

Interface: InjectedSinkFunction<F>

worker.InjectedSinkFunction

Registration of a SinkFunction, including per-sink-function options.

See WorkerOptions.sinks for more details.

Type parameters

NameType
Fextends SinkFunction

Properties

callDuringReplay

Optional callDuringReplay: boolean

Whether or not the function will be called during Workflow replay.

Take note that setting callDuringReplay to false (or leaving it unset) doesn't guarantee that the sink function will only ever run once for a particular Workflow execution at a particular point of its history. In particular, calls to sink functions will be executed even if the current workflow task ends up failling or timing out. In such situations, a call to a sink function configured with callDuringReplay: false will be executed again, since the workflow task is not being replayed (ie. retrying a workflow task is not the same as replaying it).

For use cases that require at-most-once or exactly-once guarantees, please consider using a regular activity instead.

Defaults to false.

Methods

fn

fn(info, ...args): void | Promise<void>

The implementation function for sink function F

Parameters

NameType
infoWorkflowInfo
...argsParameters<F>

Returns

void | Promise<void>