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:
- Primary call: Use Decision API (not table API)
- On failure: Parse error response to distinguish between temporary (network, timeout) vs. permanent (invalid condition) errors
- Temporary errors: Retry up to 3 times with 30-second intervals
- Permanent errors: Create a manual approval task and notify workflow admin
- 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:
- Test each decision table rule individually via REST API using Postman or similar tool
- Verify complex conditions with multiple AND/OR operators evaluate correctly
- Run your RPA bot against a test dataset covering all rule combinations
- Monitor System Logs > REST API calls to confirm proper endpoint usage
- 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.