> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/integrations/saas-applications/jenkins.md).

# Jenkins

Jenkins is an open-source automation server widely used for CI/CD pipelines and IT automation jobs. Connecting Jenkins to Harmony allows IT workflows to trigger Jenkins jobs as part of ticket resolution - enabling self-service provisioning, infrastructure automation, and deployment workflows without leaving Harmony.

### What the Jenkins Integration Enables

| Capability                 | Description                                                                                                           |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Pipeline Triggering        | Trigger Jenkins jobs and pipelines directly from Harmony workflows and agent steps                                    |
| Self-Service Automation    | Let employees request IT actions that execute Jenkins jobs automatically                                              |
| Multi-Instance Support     | Connect multiple Jenkins servers for different teams or environments, and target each independently per workflow step |
| Secure On-Premises Access  | Connect on-premises Jenkins servers via a secure Cloudflare tunnel without exposing them to the public internet       |
| Custom Agent Builder Steps | Add a dedicated Trigger Jenkins Job step inside any custom agent workflow                                             |

### Prerequisites

* **Jenkins Account**: User account with permissions to trigger jobs
* **Jenkins API Token**: Generated from your Jenkins profile (recommended over password)
* **Network Access**: Harmony must be able to reach your Jenkins server
* **Harmony Account**: Active Harmony workspace

{% hint style="warning" %}
Jenkins is typically deployed on-premises. Ensure Harmony has network access to your Jenkins server. If your Jenkins instance is not publicly accessible, use a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) or equivalent to expose it securely. Harmony supports both HTTP and HTTPS origins, including self-signed certificates.
{% endhint %}

### Connect Jenkins to Harmony

#### Step 1: Generate an API Token in Jenkins

1. Log in to your Jenkins instance
2. Click your username in the top-right corner
3. Select **Configure** from the dropdown
4. Scroll to the **API Token** section
5. Click **Add new Token**, enter a name (e.g. `Harmony`), and click **Generate**
6. Copy the generated token - it will not be shown again

#### Step 2: Navigate to Integrations

1. Log in to your Harmony dashboard
2. Go to **Settings** > **Integrations**
3. Find **Jenkins** under **SaaS Applications** and click **Connect**

#### Step 3: Enter Credentials

1. Enter your **Jenkins Address** - full URL including scheme and port (e.g. `http://10.0.1.100:8080`)
2. Enter your **Username**
3. Enter your **API Token** (paste the token generated in Step 1)
4. Click **Connect**

{% hint style="info" %}
To add additional Jenkins instances, repeat this process for each server. Each instance is identified by a unique name and hostname, and can be managed, tested, and targeted independently.
{% endhint %}

#### Connecting an On-Premises Jenkins Instance via Secure Tunnel

If your Jenkins server is not publicly accessible, you can connect it to Harmony using a secure Cloudflare tunnel - no need to expose it to the public internet.

1. Go to **Settings** > **Integrations** > **Jenkins**
2. Follow the step-by-step `cloudflared` install instructions shown directly in the setup UI
3. Harmony will provision a unique secure tunnel hostname for the instance
4. Use the built-in **Test connection** button to verify the tunnel is working before saving

Harmony supports both HTTP and HTTPS origins for tunnel connections, including self-signed certificates.

### Managing Multiple Jenkins Instances

You can connect as many Jenkins instances as your organisation needs from a single Harmony account. Each instance:

* Gets its own unique name and secure tunnel hostname
* Can be tested independently using the per-instance **Test connection** button
* Is immediately available for selection in any workflow or agent step once connected

When building a workflow, use the integration selector on any Jenkins step to choose which specific instance that step should target. This gives teams running more than one Jenkins environment full control over routing across workflows.

{% hint style="info" %}
Existing workflows that do not have a specific instance selected will continue to use the first available Jenkins instance automatically - there is no disruption to current automations.
{% endhint %}

### Triggering Jenkins Jobs from Workflows

#### AI Agent Workflows

You can trigger Jenkins jobs as a step inside your AI agent workflows using the Jenkins integration block. This lets you kick off CI/CD pipelines, builds, or any parameterized Jenkins job automatically as part of a support or operations workflow.

* Specify the **job path** and pass a custom **parameters dictionary** to the job at trigger time
* Use the integration selector to choose which Jenkins instance the step should target
* Jenkins errors are surfaced as clear, readable messages within the workflow

#### Custom Agent Builder

You can add a dedicated **Trigger Jenkins Job** step to any workflow in the Custom Agent Builder.

1. Open your agent workflow in the Custom Agent Builder
2. Add a **Trigger Jenkins Job** step
3. Select the target job by **Job ID** from your connected Jenkins server
4. Optionally pass parameters to the job at trigger time
5. Save and test the workflow

Any Jenkins server you have already connected to Harmony is immediately available for selection in the Custom Agent Builder.

### What Harmony Uses

**From Jenkins:**

* Available jobs and pipeline definitions
* Job execution status and build results
* Build logs for workflow context

### Use Cases

<details>

<summary>Self-Service Provisioning</summary>

Employees request infrastructure or environment setup via Slack; Harmony triggers the relevant Jenkins job automatically after approval

</details>

<details>

<summary>Automated Remediation</summary>

Harmony workflows detect an issue and trigger a Jenkins remediation job without requiring manual intervention

</details>

<details>

<summary>Deployment on Ticket Resolution</summary>

When an IT ticket is resolved, Harmony triggers a Jenkins deployment job to apply the fix to production

</details>

<details>

<summary>Multi-Environment CI/CD Routing</summary>

Teams running separate Jenkins instances for staging and production can route workflow steps to the correct environment using the per-step instance selector, keeping automation precise and environment-safe

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.harmony.io/integrations/saas-applications/jenkins.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
