# Class WorkflowRun

WorkflowRun Class

- Defined in packages/saltcorn-data/models/workflow_run.ts:57

##### Index

### Constructors

constructor

### Properties

context
current_step
error?
id?
session_id?
started_at
started_by?
status
status_updated_at?
step_start?
steps?
trigger_id
wait_info?

### Accessors

current_step_name
toJson

### Methods

createTrace
delete
get_next_step
markAsError
popReturnDirectives
provide_form_input
run
set_current_step
update
user_allowed_to_fill_form
userFormFields
count
create
find
findOne
getResumableWorkflows
prune
runResumableWorkflows

## Constructors

### constructor

- new WorkflowRun(o: WorkflowRun | WorkflowRunCfg): WorkflowRun

  WorkflowRun constructor

  #### Parameters

  - o: WorkflowRun | WorkflowRunCfg

  #### Returns WorkflowRun

  - Defined in packages/saltcorn-data/models/workflow_run.ts:77

## Properties

### context

context: any

- Defined in packages/saltcorn-data/models/workflow_run.ts:60

### current_step

current_step: any[]

- Defined in packages/saltcorn-data/models/workflow_run.ts:68

### `Optional` error

error?: string

- Defined in packages/saltcorn-data/models/workflow_run.ts:65

### `Optional` id

id?: number

- Defined in packages/saltcorn-data/models/workflow_run.ts:58

### `Optional` session_id

session_id?: string

- Defined in packages/saltcorn-data/models/workflow_run.ts:66

### started_at

started_at: Date

- Defined in packages/saltcorn-data/models/workflow_run.ts:62

### `Optional` started_by

started_by?: number

- Defined in packages/saltcorn-data/models/workflow_run.ts:64

### status

status: "Error" | "Pending" | "Running" | "Finished" | "Waiting"

- Defined in packages/saltcorn-data/models/workflow_run.ts:67

### `Optional` status_updated_at

status_updated_at?: Date

- Defined in packages/saltcorn-data/models/workflow_run.ts:63

### `Optional` step_start

step_start?: Date

- Defined in packages/saltcorn-data/models/workflow_run.ts:71

### `Optional` steps

steps?: WorkflowStep[]

- Defined in packages/saltcorn-data/models/workflow_run.ts:69

### trigger_id

trigger_id: number

- Defined in packages/saltcorn-data/models/workflow_run.ts:59

### `Optional` wait_info

wait_info?: any

- Defined in packages/saltcorn-data/models/workflow_run.ts:61

## Accessors

### current_step_name

- get current_step_name(): any

  #### Returns any

  - Defined in packages/saltcorn-data/models/workflow_run.ts:246

### toJson

- get toJson(): any

  #### Returns any

  - Defined in packages/saltcorn-data/models/workflow_run.ts:112

## Methods

### createTrace

- createTrace(step_name: string, user?: User): Promise<void>

  #### Parameters

  - step_name: string
  - `Optional` user: User

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:250

### delete

- delete(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:149

### get_next_step

- get_next_step(step: WorkflowStep, user?: User): WorkflowStep | null

  #### Parameters

  - step: WorkflowStep
  - `Optional` user: User

  #### Returns WorkflowStep | null

  - Defined in packages/saltcorn-data/models/workflow_run.ts:186

### markAsError

- markAsError(e: Error, step: WorkflowStep, user?: User): Promise<void>

  #### Parameters

  - e: Error
  - step: WorkflowStep
  - `Optional` user: User

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:953

### popReturnDirectives

- popReturnDirectives(nextUpdate?: Row): Promise<any>

  #### Parameters

  - `Optional` nextUpdate: Row

  #### Returns Promise<any>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:967

### provide_form_input

- provide_form_input(form_values: any, response_variable?: string): Promise<void>

  #### Parameters

  - form_values: any
  - `Optional` response_variable: string

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:173

### run

- run(
  __namedParameters: {
  api_call?: boolean;
  interactive?: boolean;
  noNotifications?: boolean;
  req?: any;
  trace?: boolean;
  user?: User;
  },
  ): Promise<any>

  #### Parameters

  - __namedParameters: {
    api_call?: boolean;
    interactive?: boolean;
    noNotifications?: boolean;
    req?: any;
    trace?: boolean;
    user?: User;
    }

  #### Returns Promise<any>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:413

### set_current_step

- set_current_step(stepName: string): void

  #### Parameters

  - stepName: string

  #### Returns void

  - Defined in packages/saltcorn-data/models/workflow_run.ts:409

### update

- update(row: Row): Promise<void>

  #### Parameters

  - row: Row

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:160

### user_allowed_to_fill_form

- user_allowed_to_fill_form(user: User): boolean

  #### Parameters

  - user: User

  #### Returns boolean

  - Defined in packages/saltcorn-data/models/workflow_run.ts:210

### userFormFields

- userFormFields(
  step0?: WorkflowStep,
  user?: User,
  ): Promise<{ fields: FieldLike[]; validator?: (r: Row) => any }>

  #### Parameters

  - `Optional` step0: WorkflowStep
  - `Optional` user: User

  #### Returns Promise<{ fields: FieldLike[]; validator?: (r: Row) => any }>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:266

### `Static` count

- count(where?: Where): Promise<number>

  #### Parameters

  - `Optional` where: Where

  #### Returns Promise<number>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:995

### `Static` create

- create(run_in: WorkflowRunCfg): Promise<WorkflowRun>

  #### Parameters

  - run_in: WorkflowRunCfg

  #### Returns Promise<WorkflowRun>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:102

### `Static` find

- find(where: Where, selectopts?: SelectOptions): Promise<WorkflowRun[]>

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<WorkflowRun[]>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:122

### `Static` findOne

- findOne(where: Where, selectopts?: SelectOptions): Promise<WorkflowRun>

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<WorkflowRun>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:134

### `Static` getResumableWorkflows

- getResumableWorkflows(): Promise<WorkflowRun[]>

  #### Returns Promise<WorkflowRun[]>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:218

### `Static` prune

- prune(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:999

### `Static` runResumableWorkflows

- runResumableWorkflows(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_run.ts:237