Deployment Until Healthy
This loop automates the deployment process of a web application and ensures it becomes healthy by continuously checking its health endpoint. It iterates through deployment actions and health checks until the application is confirmed healthy or the maximum iteration limit is reached, providing visibility into the deployment process and preventing stuck deployments.
Goal
Successfully deploy application and confirm health status through endpoint checks
How to Run
Initiate deployment process and let the agent handle iterative health checks until success or max iterations
- 01
Prepare your environment
Ensure you're in the correct project directory with deployment scripts and configuration files ready
- 02
Provide deployment context
Share any necessary environment variables, health endpoint URL, or deployment commands when prompted
- 03
Start the loop
Use the kickoff prompt to begin the automated deployment and health check cycle
- 04
Monitor progress
Observe the agent's actions and health check results through console output or logs
Workflow Steps
- 01
Deploy application
Execute deployment script or commands to start/restart the application service
- 02
Run health check command
Execute curl command against the configured health endpoint to verify application is responding
- 03
Inspect health check result
Analyze HTTP response code: 200 means healthy, other codes indicate issues requiring investigation
- 04
Evaluate exit condition
If healthy, terminate loop successfully; if not and under iteration limit, return to step 1
- 05
Handle iteration limit
If max iterations reached without healthy status, escalate with detailed error information
Kickoff Prompt
Start the "Deployment Until Healthy" loop.
Goal: Successfully deploy application and confirm health status through endpoint checks
Max iterations: 10
Between iterations run: curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health
Exit when: Health check returns HTTP 200 status code
Deploy this application and check its health endpoint at http://localhost:8080/health. Run the deployment process iteratively until the health check returns HTTP 200 or you've attempted 10 times. After each deployment, wait 10 seconds before checking health again. Document each attempt and its result.
Self-pace this loop. After each iteration, run `curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health` and evaluate the output, and only continue if the exit condition is not met (Health check returns HTTP 200 status code). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.Guardrails
hardcoded- ·Only perform health check GET requests to prevent data modification
- ·Respect the 10-iteration maximum to prevent infinite loops
- ·Log all deployment attempts and their outcomes for audit purposes
- ·Validate environment configuration before attempting deployment
- ·Implement exponential backoff between retry attempts
- ·Stop immediately if health check endpoint is unreachable or returns 5xx errors persistently
Flow Diagram
Related loops — DevOps
DevOps
Container Security Fixer
Automatically detects and remediates security vulnerabilities in container images through iterative scanning and patching workflows.
DevOps
Monitoring Coverage Builder
This loop iteratively identifies and adds missing monitoring coverage to your codebase by analyzing test coverage, identifying gaps, and implementing targeted monitoring solutions until the desired threshold is achieved.
DevOps
Service Reliability Loop
This loop enables continuous improvement of service reliability and uptime by leveraging Service Level Objective (SLO) reports to identify and address performance gaps.