Features
Group workflows
- You can organize workflows into groups, similar to how files are structured within a file system on your computer.
- Use double underscores (
__) in the path to define the directory structure. - Pass the workflow along with its path to access or utilize that specific workflow.
- Example:
Environment
- The environment is a context space that is created at the initial phase when a workflow instance is generated.
- This are defined at workflow level, thus it remains the same for every workflow instance created from the respective workflow.
- In the context, the variable name is
env, and you can access it usingEVAL --followed by targetingenv. - Example:
{
"name": "chained_action",
"type": "CHAINED",
"version": "v1",
"steps": [
{
"module": "src/steps/execute/request.step",
"id": "ha-1",
"config": {
"as": "chained_action_context",
"method": "POST",
"data": {
"company": {
"name": "mobioffice",
"phone": "+919865321470"
}
},
"url": "EVAL -- CONCAT(env.mobiofficeURL, 'api/Mstate/new')"
}
}
]
}
EVAL Functions
- You can use a variable from the context by prefixing it with the string
EVAL --. EVAL --provides several built-in functions, such as the following:
CONCAT
- Used to concatenate as many parameters as you enter, outputting the result as a string.
- Example:
"EVAL -- CONCAT('(+91', user.phone, ')')"; // output (+919859859859)
OR
- The
orfunction behaves similarly to a logical OR operation; it returns the first value that is notnull,undefined,false, or0. - Example
"EVAL -- OR(user.name, user.email, user.phone)
IF
- If you use an
ifstatement in the action configuration, it allows you to conditionally execute actions based on specified criteria. - Example:
"EVAL -- IF(user.isAdmin, user.name, user.phone) // execute as (user.isAdmin === true ? user.name : user.phone;)