Harness Pipelines Integration for Runbooks
Harness AI SRE provides native integration with Harness Pipelines, enabling automated remediation actions and deployment control directly from your incident response workflows.
Overview
Harness Pipelines integration enables your runbooks to:
- Execute deployment pipelines automatically
- Trigger rollback procedures
- Scale services during incidents
- Run diagnostic workflows
- Control deployment gates based on incident severity
Prerequisites
- Pipeline exists in Harness: Target pipeline is created and working in Harness (CD or other module)
- Pipeline inputs configured: Pipeline defines inputs for incident data (service, environment, incidentId, changeId)
- Shared account structure: AI SRE project is in the same Harness account/org/project as the target pipeline
- Proper permissions: Users have permission to execute the target pipeline
- RBAC configured: AI SRE uses existing Harness identity and RBAC (no additional API keys needed)
Runbook Configuration
Create Runbook with Incident Context
- Navigate to Runbooks and click New runbook
- Provide a meaningful name and description, for example:
P1 - Emergency RollbackScale Service - ProductionDiagnostic Pipeline Execution
- Configure Inputs/Outputs section:
- Incident/Alert Context: Choose context level
Any Incident Type: Exposes base incident fields (severity, status, summary)Custom Incident Type: Exposes base fields plus custom fields from specific incident types
- Incident Type: Select specific type for custom fields (Eg, Major Incident, Security Incident, etc.)
- Incident/Alert Context: Choose context level
Context Selection Guidelines
- Use
Any Incident Typefor runbooks requiring only generic incident data - Use
Custom Incident Typewhen runbook depends on custom fields from specific incident types
Execution Patterns
Manual Execution
Recommended for production deployments and rollback operations:
- No automatic triggers configured
- Incident commander manually executes from Runbooks tab
- Human oversight maintained for critical operations
- Pipeline executes with mapped incident context
Automatic Execution
Use with caution for low-risk, well-tested actions:
- Navigate to Triggers section
- Add trigger type:
- Incident created
- Incident updated
- Configure conditions:
- Severity equals
P1orP0 - Service matches specific list
- Custom fields, for example:
customer_facing = true
- Severity equals
Pipeline Action Configuration
Get Pipeline Input YAML
- Open target pipeline in Harness Pipelines
- Click Run
- Switch to YAML tab in Run Pipeline modal
- Copy the complete YAML block defining pipeline inputs
Add Execute Harness Pipeline Action
- Open runbook and navigate to Workflow section
- Click New action
- Select Execute Harness Pipeline
- Configure settings:
- Account/Org/Project: Match target pipeline location
- Pipeline: Select the target pipeline
Configure Pipeline Inputs
- Locate Inputs or Payload area
- Paste copied YAML from Harness Run modal
- Verify structure matches pipeline expectations
Map Input Variables
Replace <+input.*> placeholders in the YAML using one of three approaches:
service: <+input.service>
environment: <+input.environment>
incidentId: <+input.incidentId>
Incident Context Mapping
Use data picker to bind incident fields:
service←incident.serviceenvironment←incident.environmentincidentId←incident.id
Runtime User Input
Define runbook inputs for user selection:
- Environment selection from predefined list (
dev,qa,prod) - Service selection from available options
- Custom parameters based on incident type
Hardcoded Values
Set static values for consistent parameters:
environment: "production"rollbackType: "last_successful"timeout: "300"
All <+input.*> placeholders must be resolved through incident data binding, user input, or hardcoded values.
Execution Mode Configuration
Configure how the runbook handles pipeline execution:
Fire and Forget
- AI SRE initiates pipeline without waiting for completion
- Suitable for non-critical or long-running operations
- Use when pipeline output is not required for subsequent actions
Wait for Completion
- AI SRE waits for pipeline completion and records status
- Enables conditional follow-up actions based on results
- Logs success/failure in incident timeline
- Required for dependent workflow steps
Follow-up Actions
Chain additional actions after pipeline execution:
Incident Timeline Updates
- Pipeline actions log start/finish automatically
- Add custom key events for failures or timeouts
- Include pipeline URLs and execution details
External System Integration
- Jira/ServiceNow Updates: Post completion status with pipeline links
- Conditional Actions: Gate follow-up steps on pipeline success/failure
- Status Synchronization: Update external tickets with remediation results
Team Notifications
- Slack/Teams Integration: Send pipeline status to incident channels
- Email Notifications: Alert stakeholders of completion
- Custom Webhooks: Integrate with additional monitoring tools
Testing and Validation
Pre-Production Testing
- Configure staging pipeline: Point action to staging/QA pipeline or non-destructive path
- Create test incident: Generate incident matching trigger conditions
- Execute manually: Run runbook to verify behaviour
Validation Checklist
- Field mapping: Incident fields correctly populate pipeline variables
- Pipeline execution: Pipeline runs successfully in Harness
- Timeline logging: Incident timeline captures pipeline events
- Follow-up actions: Downstream integrations (Jira, notifications) function properly
Production Deployment
- Update pipeline reference to production target
- Adjust trigger conditions and permissions
- Monitor initial executions closely
- Refine based on operational feedback
Use Cases
This integration pattern supports various incident response scenarios:
- Emergency rollbacks: Automated deployment reversions
- Service scaling: Dynamic resource adjustment during incidents
- Deployment pausing: Halt deployments during critical incidents
- Diagnostic workflows: Automated troubleshooting pipelines
- Infrastructure remediation: Automated infrastructure repairs
Best Practices
- Start with manual execution for critical production operations
- Use staging environments for initial testing and validation
- Implement proper RBAC to control pipeline execution permissions
- Monitor pipeline performance and adjust timeouts accordingly
- Document incident-to-pipeline mappings for team reference