Logic Rules

Configure conditional logic for workflows with operators, rule creation/management, and rule conditions

Get Logic Rule Operators

GET /v1/logic-rules/operators

Get available operators for logic rules.

Response (200 OK):

{
    "content": [
        {
            "id": "Equal",
            "operator": "Equal"
        },
        {
            "id": "NotEqual",
            "operator": "Not Equal"
        },
        {
            "id": "GreaterThan",
            "operator": "Greater Than"
        },
        {
            "id": "LessThan",
            "operator": "Less Than"
        },
        {
            "id": "Contains",
            "operator": "Contains"
        },
        {
            "id": "IsEmpty",
            "operator": "Is Empty"
        },
        {
            "id": "IsNotEmpty",
            "operator": "Is Not Empty"
        }
    ]
}

Create Logic Rule

POST /v1/logic-rules

Create a new logic rule for a workflow step.

Request Body:

Required fields:

  • name
  • stepId
  • type
{
    "name": "Skip if Emergency",
    "stepId": "9a15edfb-1cec-4f41-9c89-96204f1a2cb1",
    "type": "SKIP"
}

Response (201 Created):

{
    "id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
    "stepId": "9a15edfb-1cec-4f41-9c89-96204f1a2cb1",
    "name": "Skip if Emergency",
    "type": "SKIP",
    "ruleConditions": [],
    "stepLogicRule": {
        "step": {
            "id": "7b24fdc8-3ded-5g52-8d90-85305e2b3db2",
            "description": "Emergency Notification Step",
            "type": "notification",
            "workflowId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
            "version": 1,
            "organizationId": "org-123456789",
            "userId": "user-987654321",
            "createdAt": "2024-01-20T09:00:00.000Z",
            "updatedAt": "2024-01-20T09:00:00.000Z",
            "configurationStatistics": {
                "amountOfAssignees": 3
            }
        }
    },
    "createdAt": "2024-01-20T14:30:00.000Z",
    "updatedAt": "2024-01-20T14:30:00.000Z"
}

Get Logic Rule

GET /v1/logic-rules/{id}

Get details of a specific logic rule.

Path Parameters:

  • id (string, required): Logic rule UUID

Response (200 OK):

{
    "id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
    "stepId": "9a15edfb-1cec-4f41-9c89-96204f1a2cb1",
    "name": "Skip if Emergency",
    "type": "SKIP",
    "ruleConditions": [
        {
            "topLevelCondition": "all",
            "logicRuleId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
            "conditions": [
                {
                    "id": "condition-123",
                    "section": 1,
                    "fact": {
                        "sourceId": "source-step-456",
                        "sourceForeignFieldId": "emergency_type",
                        "sourceForeignDataType": "string"
                    },
                    "operator": "Equal",
                    "value": "critical"
                }
            ]
        }
    ],
    "stepLogicRule": {
        "step": {
            "id": "7b24fdc8-3ded-5g52-8d90-85305e2b3db2",
            "description": "Emergency Notification Step",
            "type": "notification",
            "workflowId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
            "version": 1,
            "organizationId": "org-123456789",
            "userId": "user-987654321",
            "createdAt": "2024-01-20T09:00:00.000Z",
            "updatedAt": "2024-01-20T09:00:00.000Z",
            "configurationStatistics": {
                "amountOfAssignees": 3
            }
        }
    },
    "createdAt": "2024-01-20T14:30:00.000Z",
    "updatedAt": "2024-01-20T14:30:00.000Z"
}

Update Logic Rule

PATCH /v1/logic-rules/{logicRuleId}

Update a logic rule's name.

Path Parameters:

  • logicRuleId (string, required): Logic rule UUID

Request Body:

Required fields:

  • name
{
    "name": "Skip if Critical Emergency"
}

Response (200 OK):

{
    "id": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
    "stepId": "9a15edfb-1cec-4f41-9c89-96204f1a2cb1",
    "name": "Skip if Critical Emergency",
    "type": "SKIP",
    "ruleConditions": [
        {
            "topLevelCondition": "all",
            "logicRuleId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
            "conditions": [
                {
                    "id": "condition-123",
                    "section": 1,
                    "fact": {
                        "sourceId": "source-step-456",
                        "sourceForeignFieldId": "emergency_type",
                        "sourceForeignDataType": "string"
                    },
                    "operator": "Equal",
                    "value": "critical"
                }
            ]
        }
    ],
    "stepLogicRule": {
        "step": {
            "id": "7b24fdc8-3ded-5g52-8d90-85305e2b3db2",
            "description": "Emergency Notification Step",
            "type": "notification",
            "workflowId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
            "version": 1,
            "organizationId": "org-123456789",
            "userId": "user-987654321",
            "createdAt": "2024-01-20T09:00:00.000Z",
            "updatedAt": "2024-01-20T09:00:00.000Z",
            "configurationStatistics": {
                "amountOfAssignees": 3
            }
        }
    },
    "createdAt": "2024-01-20T14:30:00.000Z",
    "updatedAt": "2024-01-20T15:45:00.000Z"
}

Delete Logic Rule

DELETE /v1/logic-rules/{id}

Delete a logic rule.

Path Parameters:

  • id (string, required): Logic rule UUID

Response (200 OK):

No response body.


Create Rule Condition

POST /v1/logic-rules/{id}/rule-condition

Create conditions for a logic rule.

Path Parameters:

  • id (string, required): Logic rule UUID

Request Body:

Required fields:

  • topLevelCondition
  • logicRuleId
  • conditions
{
    "topLevelCondition": "all",
    "logicRuleId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
    "conditions": [
        {
            "section": 1,
            "fact": {
                "sourceId": "source-step-456",
                "sourceForeignFieldId": "priority_level",
                "sourceForeignDataType": "number"
            },
            "operator": "GreaterThan",
            "value": "5"
        },
        {
            "section": 1,
            "fact": {
                "sourceId": "source-step-456",
                "sourceForeignFieldId": "status",
                "sourceForeignDataType": "string"
            },
            "operator": "Equal",
            "value": "active"
        }
    ]
}

Response (201 Created):

{
    "topLevelCondition": "all",
    "logicRuleId": "6c06edfb-1cec-4f41-9c89-96204f1a2cb0",
    "conditions": [
        {
            "id": "condition-789",
            "section": 1,
            "fact": {
                "sourceId": "source-step-456",
                "sourceForeignFieldId": "priority_level",
                "sourceForeignDataType": "number"
            },
            "operator": "GreaterThan",
            "value": "5"
        },
        {
            "id": "condition-790",
            "section": 1,
            "fact": {
                "sourceId": "source-step-456",
                "sourceForeignFieldId": "status",
                "sourceForeignDataType": "string"
            },
            "operator": "Equal",
            "value": "active"
        }
    ]
}