# Class WorkflowStep

- Defined in packages/saltcorn-data/models/workflow_step.ts:29

##### Index

### Constructors

constructor

### Properties

action_name
configuration
id?
initial_step
name
next_step?
only_if?
trigger_id

### Accessors

mmname
mmnext
toJson

### Methods

delete
run
update
builtInActionConfigFields
builtInActionExplainers
create
deleteForTrigger
find
findOne
generate_diagram
getDiagramLoopLinkBacks
mmescape

## Constructors

### constructor

- new WorkflowStep(o: WorkflowStep | WorkflowStepCfg): WorkflowStep

  WorkflowStep constructor

  #### Parameters

  - o: WorkflowStep | WorkflowStepCfg

  #### Returns WorkflowStep

  - Defined in packages/saltcorn-data/models/workflow_step.ts:43

## Properties

### action_name

action_name: string

- Defined in packages/saltcorn-data/models/workflow_step.ts:35

### configuration

configuration: any

- Defined in packages/saltcorn-data/models/workflow_step.ts:37

### `Optional` id

id?: number

- Defined in packages/saltcorn-data/models/workflow_step.ts:30

### initial_step

initial_step: boolean

- Defined in packages/saltcorn-data/models/workflow_step.ts:36

### name

name: string

- Defined in packages/saltcorn-data/models/workflow_step.ts:31

### `Optional` next_step

next_step?: string

- Defined in packages/saltcorn-data/models/workflow_step.ts:33

### `Optional` only_if

only_if?: string

- Defined in packages/saltcorn-data/models/workflow_step.ts:34

### trigger_id

trigger_id: number

- Defined in packages/saltcorn-data/models/workflow_step.ts:32

## Accessors

### mmname

- get mmname(): string

  #### Returns string

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

### mmnext

- get mmnext(): string | undefined

  #### Returns string | undefined

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

### toJson

- get toJson(): any

  #### Returns any

  - Defined in packages/saltcorn-data/models/workflow_step.ts:93

## Methods

### delete

- delete(connect_prev_next?: boolean): Promise<void>

  #### Parameters

  - connect_prev_next: boolean = false

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:127

### run

- run(context: any, user: User): Promise<any>

  #### Parameters

  - context: any
  - user: User

  #### Returns Promise<any>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:209

### update

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

  #### Parameters

  - row: Row

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:195

### `Static` builtInActionConfigFields

- builtInActionConfigFields(
  opts?: any,
  ): Promise<
  (
  | FieldRepeat
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] };
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] };
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel?: undefined;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default: string;
  fieldview: string;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview: string;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg: boolean; wf_action_name: string };
  sublabel?: undefined;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default: string;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] }
  | undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string[] };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  )[],
  >

  #### Parameters

  - opts: any = {}

  #### Returns Promise<
  (
  | FieldRepeat
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] };
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] };
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel?: undefined;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default: string;
  fieldview: string;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview: string;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg: boolean; wf_action_name: string };
  sublabel?: undefined;
  type: string;
  validator?: undefined;
  }
  | {
  attributes?: undefined;
  class: string;
  default: string;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  | {
  attributes: { options: string[] }
  | undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class: string;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf: { immediately_bg?: undefined; wf_action_name: string };
  sublabel: string;
  type: string;
  validator: any;
  }
  | {
  attributes?: undefined;
  class?: undefined;
  default?: undefined;
  fieldview?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { immediately_bg?: undefined; wf_action_name: string[] };
  sublabel: string;
  type: string;
  validator?: undefined;
  }
  )[],
  >

  - Defined in packages/saltcorn-data/models/workflow_step.ts:430

### `Static` builtInActionExplainers

- builtInActionExplainers(opts?: any): any

  #### Parameters

  - opts: any = {}

  #### Returns any

  - Defined in packages/saltcorn-data/models/workflow_step.ts:401

### `Static` create

- create(step_in: WorkflowStepCfg): Promise<WorkflowStep>

  #### Parameters

  - step_in: WorkflowStepCfg

  #### Returns Promise<WorkflowStep>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:76

### `Static` deleteForTrigger

- deleteForTrigger(trigger_id: number): Promise<void>

  #### Parameters

  - trigger_id: number

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:183

### `Static` find

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

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<WorkflowStep[]>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:103

### `Static` findOne

- findOne(where: Where): Promise<WorkflowStep>

  #### Parameters

  - where: Where

  #### Returns Promise<WorkflowStep>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:115

### `Static` generate_diagram

- generate_diagram(steps: WorkflowStep[], options?: {}): string

  #### Parameters

  - steps: WorkflowStep[]
  - options: {} = {}

  #### Returns string

  - Defined in packages/saltcorn-data/models/workflow_step.ts:319

### `Static` getDiagramLoopLinkBacks

- getDiagramLoopLinkBacks(steps: WorkflowStep[]): Record<string, string>

  #### Parameters

  - steps: WorkflowStep[]

  #### Returns Record<string, string>

  - Defined in packages/saltcorn-data/models/workflow_step.ts:298

### `Static` mmescape

- mmescape(s: string): string

  #### Parameters

  - s: string

  #### Returns string

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