Skip to main content

Workflow Rules

Workflow rules automate compliance decisions based on risk scores, verification results, and screening outcomes. Define rules to streamline operations while maintaining compliance.

Rule Structure

{
"rule_id": "auto_approve_low_risk",
"name": "Auto-approve Low Risk Applicants",
"enabled": true,
"priority": 100,
"conditions": [...],
"actions": [...],
"exceptions": [...]
}

Creating Rules

Auto-Approve Low Risk

curl -X POST https://api.bytrustgate.com/v1/workflows/rules \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule_id": "auto_approve_low_risk",
"name": "Auto-approve Low Risk Applicants",
"trigger": "verification_complete",
"conditions": {
"all": [
{"field": "risk_score", "operator": "lte", "value": 25},
{"field": "verification_status", "operator": "eq", "value": "verified"},
{"field": "screening_status", "operator": "eq", "value": "clear"},
{"field": "document_status", "operator": "eq", "value": "verified"}
]
},
"actions": [
{
"type": "update_status",
"status": "approved"
},
{
"type": "send_notification",
"template": "applicant_approved"
}
]
}'

Auto-Reject High Risk

curl -X POST https://api.bytrustgate.com/v1/workflows/rules \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule_id": "auto_reject_sanctions",
"name": "Auto-reject Confirmed Sanctions Match",
"trigger": "screening_complete",
"conditions": {
"any": [
{"field": "sanctions_match", "operator": "eq", "value": true},
{"field": "risk_score", "operator": "gte", "value": 95}
]
},
"actions": [
{
"type": "update_status",
"status": "rejected"
},
{
"type": "create_case",
"case_type": "sanctions",
"priority": "critical"
},
{
"type": "send_notification",
"template": "compliance_alert",
"recipients": ["compliance@company.com"]
}
]
}'

Escalate PEP Matches

curl -X POST https://api.bytrustgate.com/v1/workflows/rules \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule_id": "escalate_pep",
"name": "Escalate PEP Matches for Review",
"trigger": "screening_complete",
"conditions": {
"all": [
{"field": "pep_match", "operator": "eq", "value": true}
]
},
"actions": [
{
"type": "update_status",
"status": "pending_review"
},
{
"type": "create_case",
"case_type": "pep",
"priority": "high",
"assign_to": "team_enhanced_dd"
},
{
"type": "add_flag",
"flag": "pep"
}
]
}'

Condition Operators

OperatorDescriptionExample
eqEquals{"field": "status", "operator": "eq", "value": "verified"}
neqNot equals{"field": "status", "operator": "neq", "value": "rejected"}
gtGreater than{"field": "risk_score", "operator": "gt", "value": 50}
gteGreater than or equal{"field": "risk_score", "operator": "gte", "value": 75}
ltLess than{"field": "risk_score", "operator": "lt", "value": 25}
lteLess than or equal{"field": "age", "operator": "lte", "value": 18}
inIn list{"field": "country", "operator": "in", "value": ["USA", "GBR"]}
ninNot in list{"field": "country", "operator": "nin", "value": ["IRN", "PRK"]}
containsContains string{"field": "notes", "operator": "contains", "value": "fraud"}
existsField exists{"field": "pep_tier", "operator": "exists", "value": true}

Condition Logic

All Conditions (AND)

{
"conditions": {
"all": [
{"field": "risk_score", "operator": "lte", "value": 25},
{"field": "verification_status", "operator": "eq", "value": "verified"}
]
}
}

Any Condition (OR)

{
"conditions": {
"any": [
{"field": "sanctions_match", "operator": "eq", "value": true},
{"field": "risk_score", "operator": "gte", "value": 90}
]
}
}

Nested Logic

{
"conditions": {
"all": [
{"field": "verification_status", "operator": "eq", "value": "verified"},
{
"any": [
{"field": "pep_match", "operator": "eq", "value": true},
{"field": "risk_score", "operator": "gte", "value": 50}
]
}
]
}
}

Available Actions

Status Update

{
"type": "update_status",
"status": "approved",
"reason": "Auto-approved by low risk rule"
}

Create Case

{
"type": "create_case",
"case_type": "pep",
"priority": "high",
"title": "PEP Review Required",
"assign_to": "team_compliance"
}

Send Notification

{
"type": "send_notification",
"template": "review_required",
"channels": ["email", "slack"],
"recipients": ["compliance@company.com"]
}

Add Flag

{
"type": "add_flag",
"flag": "enhanced_monitoring"
}

Trigger Webhook

{
"type": "webhook",
"url": "https://your-system.com/webhook",
"method": "POST",
"include_payload": true
}

Schedule Review

{
"type": "schedule_review",
"review_type": "periodic",
"review_date": "+365d"
}

Rule Exceptions

Define Exceptions

curl -X POST https://api.bytrustgate.com/v1/workflows/rules \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule_id": "auto_approve_low_risk",
"conditions": {
"all": [
{"field": "risk_score", "operator": "lte", "value": 25}
]
},
"exceptions": [
{
"condition": {"field": "country", "operator": "in", "value": ["IRN", "PRK", "SYR"]},
"reason": "Never auto-approve sanctioned countries"
},
{
"condition": {"field": "industry", "operator": "eq", "value": "cryptocurrency"},
"reason": "Crypto requires manual review"
}
],
"actions": [...]
}'

Rule Priority

Rules execute in priority order (lower number = higher priority):

curl -X GET "https://api.bytrustgate.com/v1/workflows/rules" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"rules": [
{"rule_id": "block_sanctioned", "priority": 1},
{"rule_id": "auto_reject_sanctions", "priority": 10},
{"rule_id": "escalate_pep", "priority": 20},
{"rule_id": "auto_approve_low_risk", "priority": 100}
]
}

Rule Triggers

TriggerWhen Fires
applicant_createdNew applicant submitted
document_uploadedDocument uploaded
document_verifiedDocument verification complete
biometric_completeBiometric check complete
verification_completeAll verifications complete
screening_completeAML screening complete
case_resolvedCase resolved
risk_score_changedRisk score recalculated
manual_triggerTriggered via API

Testing Rules

Test Rule Against Applicant

curl -X POST https://api.bytrustgate.com/v1/workflows/rules/test \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rule_id": "auto_approve_low_risk",
"applicant_id": "550e8400-e29b-41d4-a716-446655440000",
"dry_run": true
}'

Response

{
"rule_id": "auto_approve_low_risk",
"would_trigger": true,
"conditions_met": [
{"field": "risk_score", "value": 20, "condition": "lte 25", "met": true},
{"field": "verification_status", "value": "verified", "condition": "eq verified", "met": true}
],
"exceptions_triggered": [],
"actions_would_execute": [
{"type": "update_status", "status": "approved"}
]
}

Rule Analytics

View Rule Performance

curl -X GET "https://api.bytrustgate.com/v1/analytics/workflows?period=30d" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"period": "30d",
"rules": {
"auto_approve_low_risk": {
"triggered": 2500,
"successful": 2495,
"failed": 5,
"avg_processing_time_ms": 45
},
"escalate_pep": {
"triggered": 120,
"successful": 120,
"failed": 0,
"avg_processing_time_ms": 150
}
}
}

Next Steps