Skip to main content

Parametrized Bot Scripts Data Model

COTPBScript

Description

Parametrized Bot Scripts (PBScripts) are routines that can be created and saved for later use as a stage in any routine builder.

JSON Sample

{
"_id": "618a8c46d64cf5d6c0a9139a",
"code": "iterate2",
"company": "618a8c3c346c88bfa0a2081e",
"createdAt": "2021-09-30T00:29:14.800Z",
"documentation": {
"key": "iterate2",
"type": "flowcontrol",
"display": "Iterate2",
"description": "Iterate over an Array",
"dataType": [
{
"key": "control",
"display": "Array",
"description": "Array in which iterations will be performed",
"required": true,
"type": "array"
},
{
"key": "target",
"display": "Key",
"description": "Name of the variable under which the current iteration value will be available",
"required": true,
"type": "string"
},
{
"key": "true_false",
"display": "true or false",
"description": "",
"required": false,
"type": "boolean"
}
],
"nextType": [
{
"key": "SUCCESS",
"display": "Stage to execute when the operation is successful",
"description": "Stage to execute when the operation is successful",
"context": "normal"
},
{
"key": "ERROR",
"display": "Stage to execute when the operation has error",
"description": "Stage to execute when the operation has error",
"context": "normal"
}
]
},
"isActive": true,
"modifiedAt": "2021-09-30T00:29:14.804Z",
"parametrizedBot": {
"default": {
"stages": []
},
"start": "use_fceach",
"maxIterations": 100,
"stages": [
{
"next": {
"STEP": "",
"DONE": ""
},
"key": "use_fceach",
"name": "FCEach",
"data": {},
"customNetworkRequest": []
}
],
"version": "v3"
}
}

Fields

FieldDescriptionTypeNote
codeThe routine's unique code name.stringMaximum 60 characters; only lowercase letters, numbers, and underscores allowed; must be unique.
companyThe ID of the company the routine is found in.ObjectID<COTCompany>
createdAtThe date the routine was created.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
documentationContains the structure and descriptions of the various fields used to set up the routine.objectWIP
isActiveIndicates if the routine is active or not.boolean
modifiedAtIndicates the last time the routine was modified.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
parametrizedBotContains the routine stages.COTParametrizedBot

Additional Resources

Help