Skip to main content

Step

Steps in the context of a workflow refer to individual, reusable, and predefined tasks or operations that are executed as part of an action. Each step is a small, well-defined unit of work that contributes to the overall execution of an action and can be used across multiple actions or processes.

Steps help break down complex actions into smaller, manageable parts that are easy to implement, test, and reuse in different workflows or scenarios.

interface StepConfig {
id: string;
module: string;
config: unknown;
}

Manual Action Steps


Steps which are used with manual actions.

User Input

  • Specify the input values that need to be collected from the user input.
  • Module key value USER_INPUT
interface ItemList {
id: string | number;
label: string;
}

interface UserInput {
data: {
buttonActionText: string;
fieldType:
| 'datePicker'
| 'timePicker'
| 'inputField'
| 'textArea'
| 'checkBox'
| 'radioList'
| 'dropDown'
| 'summary';
field: {
keyForAPI: string;
isRequired: boolean;
label: string;
value: string;
placeholder: string;
multiple?: boolean;
itemList?: ItemList[];
mapper?: object;
request?: object;
};
label: string;
inputType?: 'text' | 'number';
order: number;
minLength?: number;
maxLength?: number;
export?: (value: any) => any;
customValidation?: (value: any) => boolean;
};
}
user input

The above interface represents best practices, as followed by the mobi-dynamic-form package.

Custom Field

  • Specify the input values that need to be collected from the client.
  • Module key value CUSTOM_FIELD
interface CustomField {
key: string;
as: string;
}

Context Field

  • Specify the input values that is taken from the context.
  • Module key value CONTEXT_FIELD
interface ContextField {
key: string;
as: string;
value: any;
}

Non Manual Action Steps


Steps which are used with auto or chained actions.

Request

  • Used to make api request from mstate the server.
  • Module key value REQUEST
interface Request {
as: string;
method: string;
url: string;
headers: unknown;
data: unknown;
params: unknown;
}

Update Context

  • Used to make api request from mstate the server.
  • Module key value UPDATE_CONTEXT
interface UpdateContext {
as: string;
value: unknown;
}

Change Instance

  • Used to switch control from current running workflow instance to another running or new workflow instance.
  • Module key value CHANGE_INSTANCE
interface ChangeInstance {
action: string;
instanceID: string;
workflowName: string;
token: string;
data: unknown;
as: string;
}

Use Instance

  • Used to perform action on other running or new workflow instance.
  • Module key value USE_INSTANCE
interface UseInstance {
action: string;
instanceID: string;
workflowName: string;
token: string;
data: unknown;
as: string;
}

Set Next Event

  • Used to guide the workflow about the next event.
  • Module key value SET_NEXT_EVENT
interface SetNextEvent {
event: string;
}

Mail

  • Used to send email.
  • Module key value MAIL
interface Mail {
transport: {
auth: {
user: string;
pass: string;
};
};
mailOptions: {
from: string;
to: string;
subject: string;
};
}

Double Tick

  • Used to add or update tickets in double tick.
  • Module key value DOUBLE_TICK
interface DoubleTick {
operation: 'create' | 'update';
payload: {
assignedTo: string;
description: string;
title: string;
workspaceID: string;
html?: string;
workflow?: number;
customerID?: number;
areaID?: number;
};
secretKey: string;
}