.png)
Harness Integration Guide
Integrate Harness with enterprise systems through REST APIs, configured webhook triggers, notifications, and Martini workflows for deployment orchestration and status synchronization.
Harness integration options at a glance
Harness provides REST APIs for querying and managing platform resources, starting pipeline executions, inspecting execution status, and working with projects, services, environments, connectors, and related objects. Configured webhook triggers allow external systems to start pipelines with branch, tag, commit, event, or custom input values. Harness notifications can report selected pipeline and execution events, although coverage depends on the configured channel and event type. Martini can consume these APIs, receive applicable webhook or notification requests, expose controlled APIs for deployment requests, and orchestrate polling, validation, mapping, retries, and downstream updates. Harness API keys are passed through the x-api-key header and should be stored as environment-specific secrets.
Common Harness integration patterns
Common Harness data objects used in integrations
Authentication and security considerations
API-key authentication
Harness REST API requests generally use an API key in the x-api-key header. Martini should keep the key in secure environment configuration or secrets management rather than in workflow source, query strings, mappings, or logs.
Scope and permissions
Requests commonly require an accountIdentifier and may also require organization and project identifiers. Harness RBAC, users, groups, roles, resource groups, and service accounts control what the credential can access.
Environment separation
- Prefer service account credentials for unattended workflows.
- Use separate credentials for development, testing, and production.
- Grant only the permissions required to query resources or start defined pipelines.
- Mask authorization headers and sensitive request values in operational logs.
Operational considerations for Harness integrations
Asynchronous execution
Starting a Harness pipeline does not mean deployment work has completed. Store the execution identifier, poll at a controlled interval or process applicable notifications, and define terminal states and timeout behavior.
Throttling and pagination
Confirm limits for the relevant Harness account, region, API family, and subscription tier. Use backoff for transient failures, avoid aggressive polling, and implement pagination according to each specific resource operation rather than assuming a universal format.
Idempotency and webhook controls
Retries after uncertain responses can start duplicate executions. Persist a business correlation identifier, check for an existing execution where appropriate, record notification identifiers and timestamps, and make downstream updates idempotent.
Schema and testing
Harness contains module-specific and versioned API areas. Validate pipeline, execution, service, environment, and connector response schemas, avoid relying on undocumented fields, and maintain contract tests for critical pipeline-start and status operations.
Failure handling
- Handle invalid API keys, insufficient RBAC permissions, and invalid account, organization, or project identifiers.
- Route missing inputs, validation failures, execution failures, rate limits, and network timeouts through explicit error paths.
- Do not treat a notification as proof of deployment success when final execution state can be queried.
- Recover or reconcile partial downstream updates.
Why use Martini instead of scripts or point-to-point integrations?
Orchestration beyond a script
Martini provides a maintainable workflow layer for validating release requests, invoking Harness APIs, monitoring asynchronous executions, applying business rules, and updating multiple enterprise systems. This avoids duplicating credentials, polling logic, and error handling across individual scripts.
Controlled APIs and reusable logic
Martini can expose a controlled API for internal applications that need to start Harness pipelines without embedding Harness credentials or release policy in each client. Common validation, mapping, correlation, and status logic can be reused across workflows.
Operational reliability
- Centralize retries, timeouts, throttling, pagination, and duplicate prevention.
- Keep environment-specific Harness credentials and identifiers outside workflow source.
- Map Harness states into consistent models for change, incident, collaboration, and deployment systems.
- Combine event-driven processing with scheduled reconciliation when notification coverage is incomplete.