Skip to main content
POST
/
v1
/
process
Create process
curl --request POST \
  --url https://api.example.com/v1/process \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "steps": [
    {
      "policyNames": [
        "<string>"
      ],
      "id": "<string>",
      "label": "<string>",
      "description": "<string>",
      "prompt": "<string>",
      "processId": "<string>",
      "tokenIds": [
        "<string>"
      ],
      "roles": [
        {
          "p": "<string>",
          "r": [
            "<string>"
          ]
        }
      ],
      "orderedPolicies": [
        "<string>"
      ],
      "viewPolicyNames": [
        "<string>"
      ],
      "routing": {
        "entityParamName": "<string>",
        "entityId": "<string>",
        "rules": [
          {
            "value": "<string>",
            "stepId": "<string>"
          }
        ]
      },
      "webhookUrls": "<string>",
      "legalContractId": "<string>",
      "frequency": "<string>",
      "deadline": "<string>",
      "deadlineType": "<string>",
      "frequencyDate": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "deletedAt": "<string>",
      "requireOrder": true,
      "stepIdsDependencies": [
        "<string>"
      ],
      "stepIdsReprovalDependencies": [
        "<string>"
      ],
      "parameters": [
        {
          "label": "<string>",
          "id": "<string>",
          "name": "<string>",
          "type": "ATTACHMENT",
          "isUnique": true,
          "isPermanent": true,
          "isRequired": true,
          "decimals": 123,
          "stepId": "<string>",
          "entityOperation": [
            "WRITE"
          ],
          "description": "<string>",
          "parameterId": "<string>",
          "entityId": "<string>",
          "autoFillEntityRelation": "<string>",
          "contractTemplateId": "<string>",
          "contractTemplate": {
            "templateEntityId": "<string>",
            "templateEntityName": "<string>"
          },
          "showColumns": [
            "<string>"
          ],
          "viewColumns": [
            "<string>"
          ],
          "computedFormula": [
            "<string>"
          ],
          "readFromOtherMeasurementData": {
            "processId": "<string>",
            "stepId": "<string>",
            "id": "<string>",
            "parameterId": "<string>",
            "readParameterId": "<string>",
            "searchFieldId": "<string>",
            "selectedFields": [
              {
                "readParameterId": "<string>",
                "writeParameterId": "<string>"
              }
            ]
          },
          "readFromEntity": {
            "stepId": "<string>",
            "id": "<string>",
            "processId": "<string>",
            "entityId": "<string>",
            "readParameterId": "<string>",
            "originParameterId": "<string>",
            "targetParameterIds": [
              "<string>"
            ],
            "createdAt": "<string>",
            "updatedAt": "<string>"
          },
          "optionItems": [
            {
              "value": "<string>",
              "id": "<string>",
              "label": "<string>",
              "color": "<string>",
              "meta": {},
              "parameterId": "<string>",
              "persisted": true,
              "entityParameterId": "<string>",
              "createdAt": "<string>",
              "updatedAt": "<string>",
              "deletedAt": "<string>"
            }
          ],
          "apiCalls": [
            {
              "id": "<string>",
              "type": "<string>",
              "description": "<string>",
              "sort": [
                "<string>"
              ],
              "parameters": [
                "<unknown>"
              ],
              "createdAt": "<string>",
              "updatedAt": "<string>"
            }
          ],
          "sheetData": {
            "sheetApiId": "<string>",
            "id": "<string>",
            "cell": "<string>",
            "inputType": "<string>",
            "parameterId": "<string>",
            "entityId": "<string>",
            "entityParameterId": "<string>",
            "page": "<string>",
            "formula": "<string>"
          },
          "advancedOptions": {
            "id": "<string>",
            "tooltip": "<string>",
            "description": "<string>",
            "placeholder": "<string>",
            "max": 123,
            "maxLength": 123,
            "min": 123,
            "minLength": 123,
            "decimals": 123,
            "sort": 123,
            "currency": "USD",
            "locale": "pt-BR",
            "isHidden": true,
            "rightFreeze": true,
            "leftFreeze": true,
            "hasCustomColor": true,
            "hasMetadata": true,
            "hiddenFrom": [
              "<string>"
            ],
            "isMultiple": true,
            "insertOnEntity": "<string>",
            "insertOnEntityMetadata": [
              "<string>"
            ],
            "dateFormat": "dd/MM/yyyy",
            "entityOperation": [
              "WRITE"
            ],
            "parameterId": "<string>",
            "entityParameterId": "<string>",
            "createdAt": "<string>",
            "updatedAt": "<string>",
            "deletedAt": "<string>"
          },
          "parameters": [
            {
              "id": "<string>",
              "name": "<string>",
              "label": "<string>",
              "type": "ATTACHMENT",
              "isUnique": true,
              "isPermanent": true,
              "stepId": "<string>",
              "isRequired": true,
              "decimals": 123,
              "parameterId": "<string>",
              "computedFormula": [
                "<string>"
              ],
              "createdAt": "<string>",
              "updatedAt": "<string>",
              "optionItems": [
                {
                  "value": "<string>",
                  "id": "<string>",
                  "label": "<string>",
                  "color": "<string>",
                  "meta": {},
                  "parameterId": "<string>",
                  "persisted": true,
                  "entityParameterId": "<string>",
                  "createdAt": "<string>",
                  "updatedAt": "<string>",
                  "deletedAt": "<string>"
                }
              ],
              "sheetData": {
                "sheetApiId": "<string>",
                "id": "<string>",
                "cell": "<string>",
                "inputType": "<string>",
                "parameterId": "<string>",
                "entityId": "<string>",
                "entityParameterId": "<string>",
                "page": "<string>",
                "formula": "<string>"
              },
              "advancedOptions": {
                "id": "<string>",
                "tooltip": "<string>",
                "description": "<string>",
                "placeholder": "<string>",
                "max": 123,
                "maxLength": 123,
                "min": 123,
                "minLength": 123,
                "decimals": 123,
                "sort": 123,
                "currency": "USD",
                "locale": "pt-BR",
                "isHidden": true,
                "rightFreeze": true,
                "leftFreeze": true,
                "hasCustomColor": true,
                "hasMetadata": true,
                "hiddenFrom": [
                  "<string>"
                ],
                "isMultiple": true,
                "insertOnEntity": "<string>",
                "insertOnEntityMetadata": [
                  "<string>"
                ],
                "dateFormat": "dd/MM/yyyy",
                "entityOperation": [
                  "WRITE"
                ],
                "parameterId": "<string>",
                "entityParameterId": "<string>",
                "createdAt": "<string>",
                "updatedAt": "<string>",
                "deletedAt": "<string>"
              },
              "autoFillEntityRelation": "<string>",
              "readFromOtherMeasurementData": {
                "processId": "<string>",
                "stepId": "<string>",
                "id": "<string>",
                "parameterId": "<string>",
                "readParameterId": "<string>",
                "searchFieldId": "<string>",
                "selectedFields": [
                  {
                    "readParameterId": "<string>",
                    "writeParameterId": "<string>"
                  }
                ]
              }
            }
          ],
          "entity": {
            "label": "<string>",
            "params": [
              {}
            ],
            "hasGSheetKey": true
          },
          "hasGSheetKey": true,
          "createdAt": "<string>",
          "updatedAt": "<string>",
          "deletedAt": "<string>"
        }
      ]
    }
  ],
  "id": "<string>",
  "type": "<string>",
  "iconName": "<string>"
}
'
{
  "orgId": "<string>",
  "name": "<string>",
  "label": "<string>",
  "steps": [
    {
      "policyNames": [
        "<string>"
      ],
      "id": "<string>",
      "label": "<string>",
      "description": "<string>",
      "prompt": "<string>",
      "processId": "<string>",
      "tokenIds": [
        "<string>"
      ],
      "roles": [
        {
          "p": "<string>",
          "r": [
            "<string>"
          ]
        }
      ],
      "orderedPolicies": [
        "<string>"
      ],
      "viewPolicyNames": [
        "<string>"
      ],
      "routing": {
        "entityParamName": "<string>",
        "entityId": "<string>",
        "rules": [
          {
            "value": "<string>",
            "stepId": "<string>"
          }
        ]
      },
      "webhookUrls": "<string>",
      "legalContractId": "<string>",
      "frequency": "<string>",
      "deadline": "<string>",
      "deadlineType": "<string>",
      "frequencyDate": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "deletedAt": "<string>",
      "stepIdsDependencies": [
        "<string>"
      ],
      "stepIdsReprovalDependencies": [
        "<string>"
      ]
    }
  ],
  "id": "<string>",
  "iconName": "<string>"
}

Simplest example

Simple create process query. This one is likely never going to be used, because 99% of the time, we are manipulating data into a database (entity). But is possible to do it on a process as well.
Simple request
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "name",
          "type": "TEXT"
        },
        {
          "label": "age",
          "type": "NUMBER"
        }
      ]
    }
  ]
}

Updating data on a Database (Entity)

Simplest request for referencing an entity. In this scenario, someone from the HR deparment has the permission to add a new user, and the HR Manager has to approve that new user before it gets added to the Users database
Simple request with entity_update
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["WRITE"]
        }
      ]
    }
  ]
}

Entity connection example.

In this example, as the two steps on the process manipulate the same entity, the default logic is to connect these two steps into the same line being manipulated. This means that when the second step comes around, it will edit columns D and E for the line step 1 created on the Users database. If none of these variables are sent, all columns will be shown
Simple request with autoFillEntityRelation
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["WRITE"],
          "showColumns": ["Name", "Surname", "Birthdate"]
        }
      ]
    }
    {
      "label": "Step 2",
      "policyNames": ["HR Director"],
      "parameters": [
        {
          "label": "Update User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["EDIT"],
          "showColumns": ["Role", "Experience"]
        }
      ],
      "stepIdsDependencies": ["Step 1"]
    },
  ]
}

VIEW Entity Operation Example

If you want to view some data on the Entity, use the “VIEW” entityOperation. In this example, user is viewing all data from the Users entity, but only for columns “Name”, “Surname” and “Birthdate” He also has another entity update param on the same step that allows him to EDIT columns “Role” and “Experience” of any user.
Simple request with autoFillEntityRelation
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["VIEW"],
          "showColumns": ["Name", "Surname", "Birthdate"]
        }
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["EDIT"],
          "showColumns": ["Role", "Experience"]
        }
      ]
    }
  ]
}
This Behaviour is automatically defined when you update the same entity in different steps. So, for the following request, Step 2 will already have the VIEW parameter created, with showColumns “Name”, “Surname” and “Birthdate” already set
Simple request with autoFillEntityRelation
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["WRITE"],
          "showColumns": ["Name", "Surname", "Birthdate"]
        }
      ]
    }
    {
      "label": "Step 2",
      "policyNames": ["HR Director"],
      "parameters": [
        {
          "label": "Update User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["EDIT"],
          "showColumns": ["Role", "Experience"]
        }
      ],
      "stepIdsDependencies": ["Step 1"]
    },
  ]
}

showColumns and hideColumns Example.

If a database is too big, you might want to hide or select some columns to be manipulated in each step. You can either set variable showColumns or hideColumns which is an array of strings - each string being the columns of the entity you are manipulating. If both showColumns and hideColumns are sent, only the hideColumns variable will be considered.
Simple request with autoFillEntityRelation
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["WRITE"],
          "showColumns": ["Name", "Surname", "Birthdate"]
        }
      ]
    }
    {
      "label": "Step 2",
      "policyNames": ["HR Director"],
      "parameters": [
        {
          "label": "Update User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["EDIT"],
          "showColumns": ["Role", "Experience"]
        }
      ],
      "stepIdsDependencies": ["Step 1"]
    },
  ]
}

Advanced Entity connection example.

In this example, as the first two steps create new lines on the Users database, you might want to connect to one or the other on the third step. To define which step you would like step 3 to be connected to, simpliy send the autoFillEntityRelation variable with the step name you would like to connect to.
Advanced request with multiple entity manipulations
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["HR Deparment", "HR Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Project",
          "entityOperation": ["WRITE"],
          "showColumns": ["A", "B", "C"]
        },
      ]
    }
    {
      "label": "Step 2",
      "policyNames": ["Sources Deparment", "Sources Manager"],
      "parameters": [
        {
          "label": "Create Quote",
          "type": "ENTITY_UPDATE",
          "entityId": "Project", // automatically connects to the line created on step 1. Because it has step 1 as a dependency. Would've also worked if variable was not set
          "entityOperation": ["WRITE"],
          "showColumns": ["D", "E"],
        }
      ],
      "stepIdsDependencies": ["Step 1"]
    },
    {
      "label": "Step 3",
      "parameters": [
        {
          "policyNames": ["HR Director"],
          "label": "Update User",
          "type": "ENTITY_UPDATE",
          "entityId": "Project",
          "entityOperation": ["EDIT"],
          "autoFillEntityRelation": "Step2" // connects to the line created on step 2. Would've also worked if variable was not set
          "showColumns": ["F", "G"]
        },
      ],
      "stepIdsDependencies": ["Step 2"]
    },
  ]
}

Required Variables for Step Deadlines

To define a deadline for the step, you need to send the following variables:
VariableTypeDescription
legalContractIdstringID of the legal contract
frequencyenumRecurrence pattern: 'weekly', 'monthly', or 'yearly'
frequencyDatenumberDate specification based on frequency (see table below)
deadlinenumberDeadline duration in the unit specified by deadlineType
deadlineTypeenumTime unit for deadline: 'days', 'weeks', or 'months' (defaults to 'days')

Frequency Date Values

The frequencyDate parameter varies based on the selected frequency:
FrequencyValid ValuesDescription
'weekly'1-7Day of the week (1 = Sunday, 7 = Saturday)
'monthly'1-31Day of the month
'yearly'1-12Month of the year (1 = January, 12 = December)
In this example, the Manager has 2 days to validate the work of the manager. And this is a process that repeats every week.
Define step deadline
{
  "name": "Process A",
  "steps": [
    {
      "label": "Step 1",
      "policyNames": ["Trainee", "Manager"],
      "parameters": [
        {
          "label": "Create New User",
          "type": "ENTITY_UPDATE",
          "entityId": "Users",
          "entityOperation": ["WRITE"],
          "showColumns": ["Name", "Surname", "Birthdate"],
          "legalContractId": "uuid",
          "frequency": "weekly",
          "deadline": "2"
        }
      ]
    }
  ]
}

Body

application/json
name
string
required
steps
object[]
required
id
string
type
string
iconName
string

Response

201 - application/json

ok

orgId
string
required
name
string
required
label
string
required
steps
object[]
required
id
string
iconName
string