Skip to main content
Module

x/deco/deps.ts>WorkflowContext

deco is a new type of web framework for building dynamic, high-performance, edge-native web applications that can be controlled via a powerful, visual admin UI.
Very Popular
Go to Latest
class WorkflowContext
Re-export
import { WorkflowContext } from "https://deno.land/x/deco@1.17.1/deps.ts";

WorkflowContext is used for providing api access to the workflow engine.

Constructors

new
WorkflowContext(executionId: string, metadata?: TMetadata)

Type Parameters

optional
TMetadata extends Metadata = Metadata

Properties

private
rand: RandomGenerators

Methods

callActivity<TArgs extends Arg = Arg, TResult = unknown>(activity: Activity<TArgs, TResult>, ...input: [...TArgs]): ScheduleActivityCommand<TArgs, TResult>

Executes the activity for the given context and args.

callLocalActivity<TResult = unknown>(activity: () => TResult): LocalActivityCommand<TResult>

Executes the activity for the given context and args.

fetch<TBody = unknown>(url: string, options?: { body?: TBody; headers?: Record<string, string>; method?: string; }): InvokeHttpEndpointCommand<TBody>

Executes the http request for the given context and args.

random(): number

Returns a random consistent with the given workflow execution

sleep(sleepMs: number): SleepCommand

stop the current workflow execution and sleep the given miliseconds time.

sleepUntil(until: Date): SleepCommand

stops the current workflow execution and sleep until the given date.

waitForSignal(signal: string): WaitForSignalCommand

waitForSignal wait for the given signal to be occurred.