Skip to main content Link Search Menu Expand Document (external link)

Workflow overview

Added in v1.0.0


Table of contents


utils

Workflow (interface)

Signature

export interface Workflow<T extends Message.Message.Any, R> {
  schema: Schema.Schema<T, unknown>
  execute: (
    input: T
  ) => Effect.Effect<Message.Message.Success<T>, Message.Message.Error<T>, R | WorkflowContext.WorkflowContext>
  version: (input: T) => string
}

Added in v1.0.0

Workflow (namespace)

Added in v1.0.0

Any (type alias)

Signature

export type Any = Workflow<any, any>

Added in v1.0.0

Context (type alias)

Signature

export type Context<A> = A extends Workflow<any, infer R> ? R : never

Added in v1.0.0

Request (type alias)

Signature

export type Request<A> = A extends Workflow<infer T, any> ? T : never

Added in v1.0.0

make

Signature

export declare function make<T extends Message.Message.Any, R = never, I = unknown>(
  schema: Schema.Schema<T, I>,
  execute: (input: T) => Effect.Effect<Message.Message.Success<T>, Message.Message.Error<T>, R>,
  version?: (input: T) => string
): Workflow<T, Exclude<R, WorkflowContext.WorkflowContext>>

Added in v1.0.0

sleep

Signature

export declare const sleep: (persistenceId: string, duration: Duration.Duration) => any

Added in v1.0.0

timeout

Signature

export declare const timeout: (
  persistenceId: string,
  duration: Duration.Duration
) => <R, E, A>(fa: Effect.Effect<R, E, A>) => any

Added in v1.0.0

union

Signature

export declare function union<WFs extends ReadonlyArray<Workflow.Any>>(...wfs: WFs)

Added in v1.0.0

yieldExecution

Signature

export declare const yieldExecution: any

Added in v1.0.0