Api Gateway Workflow
patterns
API Gateway pattern with request authentication, rate limiting, request routing to backend services, response aggregation, and error handling.
patterns
User authentication workflow with credential validation, MFA challenge, JWT token generation, session creation, and failed attempt tracking.
User { # User
n1: circle label:"Start"
n2: rectangle label:"Enter credentials"
n3: rectangle label:"Submit login form"
n4: rectangle label:"Receive access token"
n5: rectangle label:"Access protected resource"
n6: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left)
n3.handle(bottom) -> AuthServer.n7.handle(top) [label="Login request"]
n4.handle(right) -> n5.handle(left)
n5.handle(right) -> n6.handle(left)
}
AuthServer { # Auth Server
n7: rectangle label:"Receive credentials"
n8: rectangle label:"Lookup user in database"
n9: diamond label:"User exists?"
n10: rectangle label:"Verify password hash"
n11: rectangle label:"Return invalid user"
n12: diamond label:"Password correct?"
n13: diamond label:"MFA enabled?"
n14: rectangle label:"Return invalid password"
n15: rectangle label:"Generate JWT token"
n7.handle(right) -> n8.handle(left)
n8.handle(right) -> n9.handle(left)
n9.handle(right) -> n10.handle(left) [label="Yes"]
n9.handle(bottom) -> n11.handle(top) [label="No"]
n10.handle(right) -> n12.handle(left)
n11.handle(top) -> User.n2.handle(bottom) [label="Try again"]
n12.handle(right) -> n13.handle(left) [label="Yes"]
n12.handle(bottom) -> n14.handle(top) [label="No"]
n13.handle(right) -> n15.handle(left) [label="No"]
n13.handle(bottom) -> MFA.n16.handle(top) [label="Yes"]
n14.handle(top) -> User.n2.handle(bottom) [label="Try again"]
n15.handle(top) -> User.n4.handle(bottom) [label="Token issued"]
}
MFA { # Multi-Factor Auth
n16: rectangle label:"Send OTP to device"
n17: rectangle label:"Verify OTP code"
n18: diamond label:"OTP valid?"
n19: rectangle label:"Return MFA failure"
n16.handle(right) -> n17.handle(left)
n17.handle(right) -> n18.handle(left)
n18.handle(right) -> AuthServer.n15.handle(bottom) [label="Yes"]
n18.handle(bottom) -> n19.handle(top) [label="No"]
n19.handle(top) -> User.n2.handle(bottom) [label="Retry"]
}
patterns
API Gateway pattern with request authentication, rate limiting, request routing to backend services, response aggregation, and error handling.
patterns
This workflow models comparing two versions to see which performs better.
patterns
This workflow models checking user permissions before actions run.
patterns
Batch processing pattern with job scheduling, chunk-based processing, checkpoint/restart capability, error handling, and completion reporting.
patterns
Blue-green deployment pattern with parallel environment setup, smoke testing, load balancer traffic switch, and instant rollback capability.