Welcome to FlowZap, the App to diagram with Speed, Clarity and Control.

Workflow de disjoncteur (circuit breaker)

patterns

Pattern de résilience de disjoncteur avec états fermé, ouvert et semi-ouvert pour protéger les services des défaillances en cascade avec tests de récupération automatique.

Code FlowZap complet

Client { # Client Application
n1: circle label:"Start"
n2: rectangle label:"Initiate service call"
n3: rectangle label:"Receive response"
n4: rectangle label:"Process fallback response"
n5: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> CircuitBreaker.n6.handle(top) [label="Request"]
n3.handle(right) -> n5.handle(left)
n4.handle(right) -> n5.handle(left)
}
CircuitBreaker { # Circuit Breaker
n6: diamond label:"Circuit state?"
n7: rectangle label:"Allow request through"
n8: rectangle label:"Return cached fallback"
n9: rectangle label:"Increment failure count"
n10: diamond label:"Failure threshold reached?"
n11: rectangle label:"Open circuit"
n12: rectangle label:"Reset failure count"
n13: rectangle label:"Start half-open timer"
n6.handle(right) -> n7.handle(left) [label="Closed"]
n6.handle(bottom) -> n8.handle(top) [label="Open"]
n6.handle(left) -> n7.handle(top) [label="Half-Open"]
n7.handle(bottom) -> ExternalService.n14.handle(top) [label="Forward"]
n8.handle(top) -> Client.n4.handle(bottom) [label="Fallback"]
n9.handle(right) -> n10.handle(left)
n10.handle(right) -> n11.handle(left) [label="Yes"]
n10.handle(bottom) -> n12.handle(top) [label="No"]
n11.handle(right) -> n13.handle(left)
n12.handle(top) -> Client.n3.handle(bottom) [label="Success"]
n13.handle(top) -> Client.n4.handle(bottom) [label="Tripped"]
}
ExternalService { # External Service
n14: rectangle label:"Process request"
n15: diamond label:"Request successful?"
n16: rectangle label:"Return success response"
n17: rectangle label:"Return error response"
n14.handle(right) -> n15.handle(left)
n15.handle(right) -> n16.handle(left) [label="Yes"]
n15.handle(bottom) -> n17.handle(top) [label="No"]
n16.handle(top) -> CircuitBreaker.n12.handle(bottom) [label="OK"]
n17.handle(top) -> CircuitBreaker.n9.handle(bottom) [label="Error"]
}

Modèles associés

Workflow de passerelle API

patterns

Schéma de passerelle API avec authentification des requêtes, limitation de débit, routage des requêtes vers les services backend, agrégation des réponses et gestion des erreurs.

Flux de travail de réessai avec backoff

patterns

Modèle de réessai avec backoff exponentiel pour les appels API avec limites de réessai configurables, calcul de délai, détection d'erreurs réessayables et dégradation gracieuse en cas d'échecs permanents.

Workflow du pattern Saga

patterns

Pattern d’orchestration Saga pour transactions distribuées entre les services Commande, Paiement et Expédition avec compensation et retour arrière automatiques en cas d’échec.