• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

Get the status of an Ansible job

|View as Markdown (English)

This page provides a reference for the ansible.job.getStatus action available in the workflow automation actions catalog. Use this action to poll a job created by ansible.job.launch until it reaches a terminal state.

For prerequisites, see Ansible job actions.

Get the status of an Ansible job

The action identifier is ansible.job.getStatus.

Gets the status and details of an Automation Controller job. Job statuses progress from pending to waiting to running before reaching a terminal state: successful, failed, error, or canceled. The endpoint is GET https://{host}/api/controller/v2/jobs/{jobId}/.

The following table describes all available input fields for this action.

Input

Type

Description

Example

host

String

Required. Hostname (and optional port) of the Automation Controller, without scheme.

${{ :secrets:host }}

authToken

String

Required. OAuth2 token sent as Authorization: Bearer <token>.

${{ :secrets:ansibleControllerToken }}

jobId

Int

Required. Numeric job ID to poll. Typically the id returned by ansible.job.launch.

128

selectors

List

Optional. JQ selectors to extract specific fields from the action output.

[{"name": "status", "expression": ".status"}, {"name": "failed", "expression": ".failed"}]

The following table describes all output fields returned by this action.

Output

Type

Description

success

Boolean

true on success, false on failure.

response

Object

Job details from the Automation Controller API.

{
"id": 128,
"status": "successful",
"failed": false,
"started": "2026-07-08T10:00:00Z",
"finished": "2026-07-08T10:02:13Z",
"elapsed": 133.0
}

errorMessage

String

Error message on failure. null on success.

The following example polls an Ansible job and branches on the result.

Workflow example

name: check-ansible-job
description: Fetch the status of a previously launched Ansible job
steps:
- name: get_status
type: action
action: ansible.job.getStatus
version: 1
inputs:
host: ${{ :secrets:host }}
authToken: ${{ :secrets:ansibleControllerToken }}
jobId: "128"
selectors:
- name: status
expression: ".status"
- name: failed
expression: ".failed"
next: end
Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.