Portal Community

Error Port Routing

Non-2xx responses from a business service route to the error port by default. The error output contains:

{
  "statusCode": 503,
  "errorCode": "SERVICE_UNAVAILABLE",
  "message": "Payroll service is temporarily unavailable",
  "serviceId": "payroll-service",
  "operationId": "calculatePayslip",
  "retryAfterSeconds": 30
}

Status Code Port Mapping

Configure specific status codes to route to named ports instead of the generic error port:

{
  "statusCodePorts": {
    "404": "notFound",
    "409": "conflict",
    "422": "validationError",
    "503": "serviceDown"
  }
}

This allows the workflow to handle different error scenarios with specific recovery paths rather than a single error handler.

Circuit Breaker

The circuit breaker prevents cascading failures when a service is down. It operates in three states:

StateBehaviorTransition
ClosedCalls pass through normally→ Open after N consecutive failures
OpenCalls fail immediately without hitting the service→ Half-Open after timeout (default 30s)
Half-OpenOne probe call allowed through→ Closed (success) or Open (failure)
// Circuit breaker config per service
new CircuitBreakerPolicy
{
    FailureThreshold = 5,        // 5 consecutive failures → Open
    SamplingDurationSeconds = 60,
    OpenDurationSeconds = 30,
    SuccessThresholdInHalfOpen = 1
}
Circuit breaker fires error port. When the circuit is Open, the node immediately routes to the error port with errorCode: "CIRCUIT_OPEN". Connect an error port edge that either retries later (via a WaitNode + SubWorkflow) or provides a graceful degraded response.