Skip to content

MngTestWorkflowRule

Phase 1 dry-run endpoint. It validates rule schema and explicitly reports that runtime condition evaluation is not enabled yet.

Access

Manager sessions: SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER, SESSION_CRM_MANAGER, SESSION_CRM_ADMIN.

Request

{
  "command": "MngTestWorkflowRule",
  "extID": "1",
  "data": {
    "trigger": "deposit.created",
    "conditions": [
      { "field": "amount_usd", "op": ">=", "value": 50000 }
    ],
    "actions": [
      {
        "type": "notify.manager",
        "params": {
          "message": "Large deposit"
        }
      }
    ]
  }
}

Response Data

{
  "valid": true,
  "matched": false,
  "executed": false,
  "test_only": true,
  "message": "Rule schema is valid. Runtime condition evaluation is not enabled in phase 1.",
  "conditions": [
    {
      "field": "amount_usd",
      "op": ">=",
      "evaluated": true,
      "matched": false,
      "actual": 250
    },
    {
      "field": "customer.lifecycle_flags",
      "op": "has_all",
      "evaluated": false,
      "reason": "no customer context"
    }
  ]
}

conditions

conditions reports the outcome of every condition in the rule, one entry each.

Field Type Description
field string Condition field
op string Condition operator
evaluated bool Whether the condition could be evaluated at all
matched bool Present when evaluated is true. Whether the condition matched
actual any Present when evaluated is true. The value the condition was compared against
reason string Present when evaluated is false. Why the condition could not be evaluated

Conditions are evaluated without short-circuiting, so a result arrives for every one of them, not only up to the first failure.

Condition values are validated the same way as in MngValidateWorkflowRule, including the CONDITION_VALUE_TYPE, CONDITION_VALUE_EMPTY_MASK, and CONDITION_VALUE_UNKNOWN_FLAG codes.