Static
execSpawns a child workflow and awaits the return.
the workflow options
Static
getReturns the current workflow context restored from Redis
Static
getStatic
hookSpawns a hook from either the main thread or a hook thread with the provided options; worflowId/TaskQueue/Name are optional and will default to the current workflowId/WorkflowTopic if not provided
the hook options
Static
interruptInterrupts a running job
Static
onceExecutes a function once and caches the result. If the function is called again, the cached result is returned. This is useful for wrapping expensive activity calls that should only be run once, but which might not require the cost and safety provided by proxyActivities.
Static
randomStatic
searchStatic
signalStatic
sleepSleeps the workflow for a duration. As the function is reentrant, upon reentry, the function will traverse prior execution paths up until the sleep command and then resume execution thereafter.
See the ms
package for syntax examples: '1 minute', '2 hours', '3 days'
Static
startSpawns a child workflow and returns the child Job ID. This method guarantees the spawned child has reserved the Job ID, returning a 'DuplicateJobError' error if not. Otherwise, this is a fire-and-forget method.
the workflow options
Static
wait
The workflow module provides a set of static extension methods that can be called from within a workflow function. In this example, the
waitFor
extension method is called to add collation to the workflow, only continuing once both outside signals have been received.Example