# Jenkins

> Run and watch Jenkins builds: start a job with its parameters, wait for it to finish, read results and console logs, stop builds, enable or disable jobs and check agents. Start a workflow when a build finishes.

App · 11 actions. Web page: https://docs.lodol.com/docs/integrations/jenkins

## Actions

### Enable or disable job

Disable a job so it cannot be built, or enable it again.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- State (`state`, text, required): Whether the job can be built. One of: `enabled`, `disabled`.

**Outputs**

- `buildable` (true/false): False when the job is disabled
- `building` (true/false): True while a build runs
- `description` (text): The job's description
- `display_name` (text): The job's display name
- `health` (text): Jenkins's health report, such as 'Build stability: 1 out of the last 5 builds failed.'
- `health_score` (number): The health score, 0 to 100
- `in_queue` (true/false): True when a build is waiting in the queue
- `last_build` (number): The latest build's number
- `last_failed_build` (number): The latest failed build's number
- `last_successful_build` (number): The latest successful build's number
- `name` (text): The job's full name, with its folders
- `next_build_number` (number): The number the next build will get
- `parameters` (list): The parameters the job takes
- `status` (text): The last build's status: success, failure, unstable, aborted, not built or disabled
- `url` (text): The job's page

**Example output**

```json
{
  "buildable": false,
  "building": false,
  "description": "Deploy the app",
  "display_name": "deploy",
  "health": "Build stability: No recent builds failed.",
  "health_score": 100,
  "in_queue": false,
  "last_build": 42,
  "last_failed_build": 40,
  "last_successful_build": 42,
  "name": "team/deploy",
  "next_build_number": 43,
  "parameters": [
    {
      "choices": [
        "staging",
        "production"
      ],
      "default": "staging",
      "description": "Where to deploy",
      "name": "ENVIRONMENT",
      "type": "choice"
    }
  ],
  "status": "disabled",
  "url": "https://jenkins.example.com/job/team/job/deploy/"
}
```

### Get build

Get a build's result, timing, what started it, its parameters and its artifacts.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- Build number (`build_number`, text): The build's number, such as 42. Leave empty to use 'Which build'.
- Which build (`which`, text): When no number is given. Defaults to the latest build. One of: `lastBuild` (The latest build), `lastCompletedBuild` (The latest finished build), `lastSuccessfulBuild` (The latest successful build), `lastFailedBuild` (The latest failed build), `lastStableBuild` (The latest stable build). Default: `lastBuild`.

**Outputs**

- `artifacts` (list): Files the build archived
- `building` (true/false): True while it runs
- `causes` (list): Why it ran, such as 'Started by user Jo'
- `description` (text): The build's description
- `display_name` (text): The build's name, such as #42
- `duration_seconds` (number): How long it took; empty while it runs
- `estimated_seconds` (number): How long Jenkins expects it to take
- `job` (text): The job's full name
- `number` (number): The build's number
- `parameters` (object): The parameters it ran with
- `result` (text): SUCCESS, FAILURE, UNSTABLE, ABORTED or NOT_BUILT; empty while it runs
- `started_at` (text): When it started, in UTC (ISO 8601)
- `url` (text): The build's page

**Example output**

```json
{
  "artifacts": [
    {
      "file_name": "app.zip",
      "path": "dist/app.zip",
      "url": "https://jenkins.example.com/job/team/job/deploy/42/artifact/dist/app.zip"
    }
  ],
  "building": false,
  "causes": [
    "Started by user Jo Bloggs"
  ],
  "description": "",
  "display_name": "#42",
  "duration_seconds": 93.4,
  "estimated_seconds": 90.0,
  "job": "team/deploy",
  "number": 42,
  "parameters": {
    "ENVIRONMENT": "staging"
  },
  "result": "SUCCESS",
  "started_at": "2026-10-27T10:00:00Z",
  "url": "https://jenkins.example.com/job/team/job/deploy/42/"
}
```

### Get build log

Get the last lines of a build's console output, such as where it failed.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- Build number (`build_number`, text): The build's number, such as 42. Leave empty to use 'Which build'.
- Which build (`which`, text): When no number is given. Defaults to the latest build. One of: `lastBuild` (The latest build), `lastCompletedBuild` (The latest finished build), `lastSuccessfulBuild` (The latest successful build), `lastFailedBuild` (The latest failed build), `lastStableBuild` (The latest stable build). Default: `lastBuild`.
- Last lines (`last_lines`, number): How many lines from the end, up to 5000. Defaults to 200. From 1 to 5000.

**Outputs**

- `build` (text): The build's number, or which latest build
- `job` (text): The job's full name
- `line_count` (number): How many lines were returned
- `log` (text): The lines, oldest first
- `truncated` (true/false): True when earlier lines were left out

**Example output**

```json
{
  "build": "42",
  "job": "team/deploy",
  "line_count": 1,
  "log": "Finished: SUCCESS",
  "truncated": true
}
```

### Get job

Get a job's status, health, latest build numbers and the parameters it takes.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.

**Outputs**

- `buildable` (true/false): False when the job is disabled
- `building` (true/false): True while a build runs
- `description` (text): The job's description
- `display_name` (text): The job's display name
- `health` (text): Jenkins's health report, such as 'Build stability: 1 out of the last 5 builds failed.'
- `health_score` (number): The health score, 0 to 100
- `in_queue` (true/false): True when a build is waiting in the queue
- `last_build` (number): The latest build's number
- `last_failed_build` (number): The latest failed build's number
- `last_successful_build` (number): The latest successful build's number
- `name` (text): The job's full name, with its folders
- `next_build_number` (number): The number the next build will get
- `parameters` (list): The parameters the job takes
- `status` (text): The last build's status: success, failure, unstable, aborted, not built or disabled
- `url` (text): The job's page

**Example output**

```json
{
  "buildable": true,
  "building": false,
  "description": "Deploy the app",
  "display_name": "deploy",
  "health": "Build stability: No recent builds failed.",
  "health_score": 100,
  "in_queue": false,
  "last_build": 42,
  "last_failed_build": 40,
  "last_successful_build": 42,
  "name": "team/deploy",
  "next_build_number": 43,
  "parameters": [
    {
      "choices": [
        "staging",
        "production"
      ],
      "default": "staging",
      "description": "Where to deploy",
      "name": "ENVIRONMENT",
      "type": "choice"
    }
  ],
  "status": "success",
  "url": "https://jenkins.example.com/job/team/job/deploy/"
}
```

### Get queued build

Find out whether a queued build has started, and its number when it has.

**Inputs**

- Queue item (`queue_item_id`, text, required): The queue item's number, from 'Start build'.

**Outputs**

- `build_number` (number): The build's number, once it has started
- `build_url` (text): The build's page, once it has started
- `cancelled` (true/false): True when it was cancelled before starting
- `job_url` (text): The job's page
- `queue_item_id` (number): The queue item's number
- `queued_at` (text): When it was queued, in UTC (ISO 8601)
- `waiting` (true/false): True while the build waits to start
- `why` (text): Why it is waiting, in Jenkins's words

**Example output**

```json
{
  "build_number": 43,
  "build_url": "https://jenkins.example.com/job/team/job/deploy/43/",
  "cancelled": false,
  "job_url": "https://jenkins.example.com/job/team/job/deploy/",
  "queue_item_id": 512,
  "queued_at": "2026-10-27T10:00:00Z",
  "waiting": false,
  "why": ""
}
```

### List builds

List a job's latest builds with their results, newest first.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- How many (`limit`, number): How many builds, up to 100. Defaults to 20. From 1 to 100.

**Outputs**

- `builds` (list): The builds, newest first
- `count` (number): How many builds
- `job` (text): The job's full name

**Example output**

```json
{
  "builds": [
    {
      "artifacts": [
        {
          "file_name": "app.zip",
          "path": "dist/app.zip",
          "url": "https://jenkins.example.com/job/team/job/deploy/42/artifact/dist/app.zip"
        }
      ],
      "building": false,
      "causes": [
        "Started by user Jo Bloggs"
      ],
      "description": "",
      "display_name": "#42",
      "duration_seconds": 93.4,
      "estimated_seconds": 90.0,
      "job": "team/deploy",
      "number": 42,
      "parameters": {
        "ENVIRONMENT": "staging"
      },
      "result": "SUCCESS",
      "started_at": "2026-10-27T10:00:00Z",
      "url": "https://jenkins.example.com/job/team/job/deploy/42/"
    }
  ],
  "count": 1,
  "job": "team/deploy"
}
```

### List jobs

List every job, in folders too, with its last build's status.

**Inputs**

- Folder (`folder`, text): Only jobs in this folder. Leave empty for every job.
- Name contains (`search`, text): Only jobs whose name contains this text.

**Outputs**

- `count` (number): How many jobs
- `jobs` (list): The jobs

**Example output**

```json
{
  "count": 1,
  "jobs": [
    {
      "building": false,
      "name": "team/deploy",
      "status": "success",
      "url": "https://jenkins.example.com/job/team/job/deploy/"
    }
  ]
}
```

### List nodes

List the built-in node and the agents: whether each is online, idle, and why it is offline.

**Inputs**

- Only offline (`only_offline`, true/false): Only nodes that are offline. Off by default. Default: `false`.

**Outputs**

- `count` (number): How many nodes
- `nodes` (list): The nodes
- `offline_count` (number): How many are offline

**Example output**

```json
{
  "count": 1,
  "nodes": [
    {
      "executors": 2,
      "idle": true,
      "labels": [
        "linux"
      ],
      "name": "linux-agent-1",
      "offline_reason": "Disk full",
      "online": false
    }
  ],
  "offline_count": 1
}
```

### Start build

Start a build of a job, with its parameters. Returns the build's number once Jenkins starts it, or its queue item while it waits.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- Parameters (`parameters`, object): A value for each of the job's parameters. Empty ones keep their defaults.

**Outputs**

- `build_number` (number): The build's number, once it has started
- `build_url` (text): The build's page, once it has started
- `job` (text): The job's full name
- `queue_item_id` (number): The queue item, to follow with 'Wait for build'
- `queued` (true/false): True while it still waits in the queue
- `why` (text): Why it is still waiting, in Jenkins's words

**Example output**

```json
{
  "build_number": 43,
  "build_url": "https://jenkins.example.com/job/team/job/deploy/43/",
  "job": "team/deploy",
  "queue_item_id": 512,
  "queued": false,
  "why": ""
}
```

### Stop build

Abort a running build.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- Build number (`build_number`, text, required): The running build's number.

**Outputs**

- `artifacts` (list): Files the build archived
- `building` (true/false): True while it runs
- `causes` (list): Why it ran, such as 'Started by user Jo'
- `description` (text): The build's description
- `display_name` (text): The build's name, such as #42
- `duration_seconds` (number): How long it took; empty while it runs
- `estimated_seconds` (number): How long Jenkins expects it to take
- `job` (text): The job's full name
- `number` (number): The build's number
- `parameters` (object): The parameters it ran with
- `result` (text): SUCCESS, FAILURE, UNSTABLE, ABORTED or NOT_BUILT; empty while it runs
- `started_at` (text): When it started, in UTC (ISO 8601)
- `url` (text): The build's page

**Example output**

```json
{
  "artifacts": [
    {
      "file_name": "app.zip",
      "path": "dist/app.zip",
      "url": "https://jenkins.example.com/job/team/job/deploy/42/artifact/dist/app.zip"
    }
  ],
  "building": false,
  "causes": [
    "Started by user Jo Bloggs"
  ],
  "description": "",
  "display_name": "#42",
  "duration_seconds": 93.4,
  "estimated_seconds": 90.0,
  "job": "team/deploy",
  "number": 42,
  "parameters": {
    "ENVIRONMENT": "staging"
  },
  "result": "ABORTED",
  "started_at": "2026-10-27T10:00:00Z",
  "url": "https://jenkins.example.com/job/team/job/deploy/42/"
}
```

### Wait for build

Wait until a build finishes, then return its result. The run waits without holding anything up, checking every minute.

**Inputs**

- Job (`job`, text, required): The job. Pick one, type its name (folder/job), or paste its address.
- Build number (`build_number`, text): The build's number. Or give its queue item instead.
- Queue item (`queue_item_id`, text): The queue item from 'Start build', for a build that had not started yet.
- Wait at most (minutes) (`max_wait_minutes`, number): Fail if it is still running after this long. Defaults to 60. From 1 to 1440.

**Outputs**

- `artifacts` (list): Files the build archived
- `building` (true/false): True while it runs
- `causes` (list): Why it ran, such as 'Started by user Jo'
- `description` (text): The build's description
- `display_name` (text): The build's name, such as #42
- `duration_seconds` (number): How long it took; empty while it runs
- `estimated_seconds` (number): How long Jenkins expects it to take
- `job` (text): The job's full name
- `number` (number): The build's number
- `parameters` (object): The parameters it ran with
- `result` (text): SUCCESS, FAILURE, UNSTABLE, ABORTED or NOT_BUILT; empty while it runs
- `started_at` (text): When it started, in UTC (ISO 8601)
- `url` (text): The build's page

**Example output**

```json
{
  "artifacts": [
    {
      "file_name": "app.zip",
      "path": "dist/app.zip",
      "url": "https://jenkins.example.com/job/team/job/deploy/42/artifact/dist/app.zip"
    }
  ],
  "building": false,
  "causes": [
    "Started by user Jo Bloggs"
  ],
  "description": "",
  "display_name": "#42",
  "duration_seconds": 93.4,
  "estimated_seconds": 90.0,
  "job": "team/deploy",
  "number": 42,
  "parameters": {
    "ENVIRONMENT": "staging"
  },
  "result": "SUCCESS",
  "started_at": "2026-10-27T10:00:00Z",
  "url": "https://jenkins.example.com/job/team/job/deploy/42/"
}
```
