Decision table integration with RPA fails on complex conditional routing

RPA bots invoking decision tables for approval routing are failing with ‘invalid condition evaluation’ errors when processing complex multi-criteria requests. Simple decision table lookups work fine, but rules with 3+ conditions fail consistently.

Our approval workflow uses a decision table with conditions on request_amount, department, and risk_level to determine approver hierarchy. When the RPA bot calls the decision table via REST API with all three criteria, we get:


Error: DecisionTableException
Message: "Invalid condition evaluation for rule ID DT_APPROVAL_003"
Condition: "(amount > 10000 AND department = 'Finance') OR risk_level = 'High'"

The decision table rule structure uses AND/OR operators, and testing through the UI works perfectly with the same input values. Our RPA bot error handling currently just logs failures and skips the request, causing automation failures for 40% of approval requests. We’re on Utah release. Is there a known issue with complex decision table conditions via API, or are we missing something in how the bot formats the request?

There’s definitely a difference in how the UI evaluates decision table conditions versus the REST API. The UI uses client-side JavaScript evaluation which is more forgiving with type coercion and operator precedence. The API uses server-side Java evaluation which is stricter.

For complex conditions with AND/OR operators, you need to ensure proper parentheses in your decision table rule structure. The error message shows your condition might have ambiguous operator precedence. Also, check if your RPA bot is properly encoding special characters in the API request - sometimes AND/OR operators get URL-encoded incorrectly.

What does your bot’s actual API call look like? POST payload and headers would help diagnose this.

That’s your problem - you’re posting to the sys_decision table directly instead of using the Decision API. The sys_decision table is the configuration table, not the execution endpoint. You need to call the Decision REST API at /api/now/decision/{decision_table_sys_id}/execute with your input parameters.

This endpoint properly evaluates the decision table rules and handles complex conditions correctly. The direct table API doesn’t trigger the decision engine’s evaluation logic, which is why you’re getting condition evaluation errors.

Complete solution covering all three critical areas:

Decision Table Rule Structure: Your decision table rules need proper parentheses for complex conditions. Edit rule DT_APPROVAL_003 in ServiceNow:

  • Navigate to Decision > Decision Tables
  • Open your approval routing table
  • For the problematic rule, restructure the condition:

((amount > 10000) AND (department = 'Finance')) OR (risk_level = 'High')

Explicit parentheses eliminate operator precedence ambiguity between AND/OR. Also ensure data types in the decision table match your input - set amount column type to ‘Decimal’ not ‘String’.

RPA Bot Error Handling: Enhance your bot’s error handling with this logic:

  1. Primary call: Use Decision API (not table API)
  2. On failure: Parse error response to distinguish between temporary (network, timeout) vs. permanent (invalid condition) errors
  3. Temporary errors: Retry up to 3 times with 30-second intervals
  4. Permanent errors: Create a manual approval task and notify workflow admin
  5. Log all decision table calls with input parameters for audit trail

Implement structured exception handling in your RPA bot:


try {
  result = callDecisionAPI(table_id, inputs)
} catch (DecisionTableException) {
  if (isRetryable(error)) { retry() }
  else { createManualApprovalTask() }
}

Approval Workflow Automation - Correct API Usage: Your RPA bot must call the Decision REST API, not the table API. Update your bot’s API call:

Endpoint: POST /api/now/decision/v1/execute/{decision_table_sys_id}

Headers:

  • Content-Type: application/json
  • Authorization: Bearer {oauth_token}

Payload:


{
  "inputs": {
    "amount": 15000,
    "department": "Finance",
    "risk_level": "High"
  }
}

The response will include the matched rule and output values:


{
  "result": {
    "approver_level": "VP",
    "approver_group": "Finance_VP_Approvers"
  }
}

Key differences from table API:

  • Decision API executes the decision engine evaluation
  • Handles complex AND/OR conditions correctly
  • Returns evaluated output values, not just rule records
  • Supports decision table versioning and effective dating

Testing and Validation: After implementing these changes:

  1. Test each decision table rule individually via REST API using Postman or similar tool
  2. Verify complex conditions with multiple AND/OR operators evaluate correctly
  3. Run your RPA bot against a test dataset covering all rule combinations
  4. Monitor System Logs > REST API calls to confirm proper endpoint usage
  5. Check Decision > Decision Audit for execution history and condition evaluation details

For your 40% failure rate, this should drop to near zero. Any remaining failures likely indicate data quality issues in input values or missing rules in your decision table coverage.

Also important for RPA bot error handling - don’t just log and skip. Implement retry logic with exponential backoff for decision table API calls. Temporary network issues or instance performance can cause intermittent failures. For true decision table errors (like invalid conditions), your bot should route to a manual approval queue rather than skipping entirely. Otherwise you’re creating approval gaps in your workflow.

How is your RPA bot passing the condition values to the decision table API? Decision tables expect specific data types - amounts should be numbers not strings, booleans as true/false not ‘true’/‘false’. Type mismatches can cause condition evaluation failures even if the UI handles it gracefully with type coercion.