Parametrized Bot Data Model
Advertencia
Esta página aún no se encuentra traducida al español.
Description
A parametrized bot is an automated routine with a bot that executes a task in each stage.
The COTParametrizedBot data model contains a routine's settings. This data model is used within other data models, such as COTSMStateMachine, COTSMState, COTSMSLA, COTBot, among others.
JSON Sample
Sample taken from an SLA Routine:
{
"_id": "61829b0ecc13e1ff490c8547",
"maxIterations": 10,
"stages": [
{
"_id": "61829b17bfbdc5e41e3fb653",
"key": "email",
"name": "PBEmail",
"data": {
"subject": "Task Reminder",
"content": {
"recipientName": "($CODE#users#_id#($OUTPUT#task_request#data|assignee))|name|names",
"recipientEmail": "",
"companyName": "ACME",
"title": [
"Pending Task"
],
"action": "",
"code": "",
"messageA": "$JOIN# #(Task number)#($OUTPUT#task_request#data|serial)#($OUTPUT#task_request#data|name)#is still pending.",
"messageB": "Please complete the task or modify its end-date."
},
"targets": [
"($CODE#users#_id#($OUTPUT#task_request#data|assignee))|email"
],
"singleRecipient": true
},
"next": {
"DEFAULT": ""
},
"customNetworkRequest": []
},
{
"_id": "61829b287076806e3559a796",
"key": "task_request",
"name": "NWRequest",
"data": {
"url": "$JOIN#/#($ENV#BASEURL)#api#tasks#($VALUE#taskGroupId)#task#($VALUE#taskId)",
"method": "GET",
"defaultAuth": true,
"headers": {
"admin": true
}
},
"next": {
"SUCCESS": "email",
"ERROR": ""
},
"customNetworkRequest": []
}
],
"start": "task_request",
"version": "v3"
},
Fields
Field | Description | Type | Note |
---|---|---|---|
maxIterations | Specifies the maximum number of stages the routine can go through. | number | Make sure looping stages are taken into account when specifying the maximum number of iterations. |
stages | Represents the different stages or steps the routine goes through. Each routine stage is designated a stage type or bot that is called upon to carry out a specific task. | object[ ] | A complete list of stage types can be found here. |
stages[index].customNetworkRequest | Indicates the parameters for making a customized network request within the routine stage. | object[ ] | |
stages[index].data | Contains the stage type parameters or configuration. The required data format depends on the stage type and its version. | object | Format example: Wait stage type data includes time with the following format: { milliseconds: number } |
stages[index].key | Indicates the stage's custom code name. | string | Maximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique. |
stages[index].name | Indicates the standard name of the stage type (bot), e.g., PBMessage, PBCreateTask, etc.. | string | |
stages[index].next | next is a custom {[key]: string} object that indicates the next step in the routine. key is defined by the stage type. | object | Object keys usually follow IF/ELSE logic and can include keys such as SUCCESS , ERROR , or DEFAULT . |
stages[index].version | Stage version. | string | For internal use only. |
start | Indicates the stage the routine initiates in. | string | Valid options include any routine stages[index].key value. |
version | The routine's version number. | number | For internal use only. |
Deprecated
Field | Description | Type | Note |
---|---|---|---|
stages[index].customNetworkRequest[index].body | The customized network request's body. | object | DEPRECATED |
stages[index].customNetworkRequest[index].endpoint | The customized network request's endpoint. | string[ ] | DEPRECATED |
stages[index].customNetworkRequest[index].findOne | boolean | DEPRECATED | |
stages[index].customNetworkRequest[index].keyOutput | string | DEPRECATED | |
stages[index].customNetworkRequest[index].method | Indicates the request method. Enum: ["GET", "POST"] | string | DEPRECATED |
stages[index].customNetworkRequest[index].query | object | DEPRECATED |
Additional Resources
- Routine Builder: How to add a routine using the Routine Builder
- Routine Stage Types: Complete list of stage types and their configuration
- API documentation in Swagger: complete with data models (schemas)
- COTLang: use COTLang for extracting data from models in routines
- Triggers and Contexts: more information on using data models within routines
Help
- Cotalker Platform Community: post your questions or search for previous answers given in the forum