---
title: Ansible job get status action
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/ansible/ansible-job-getstatus
---

This page provides a reference for the `ansible.job.getStatus` action available in the workflow automation actions catalog. Use this action to retrieve the status and details of an Ansible Automation Platform (Automation Controller) job. Use this action to poll a job created by [`ansible.job.launch`](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/ansible/ansible-job-launch). This action builds on the `http.get` base action.

**Endpoint:** `GET https://{host}/api/controller/v2/jobs/{jobId}/`

## Prerequisites

Before using this action in workflow automation, ensure you have:

-   An Ansible Automation Platform (Automation Controller) instance accessible over HTTPS.
-   An OAuth2 token with write scope (create one under **Automation Controller → Users → Tokens**)
-   The numeric job ID to poll (typically the `id` field returned by `ansible.job.launch`).

## Get job status

**Get the status of an Ansible job**

Gets the status and details of an Automation Controller job. Built on the `http.get` base action.

Job statuses progress from `pending` to `waiting` to `running` before reaching a terminal state:`successful`, `failed`, `error`, or `canceled`.

### Inputs

| Input Field   | Optionality | Type   | Example                                                                                                                                                 |
| ------------- | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **host**      | Required    | String | `${{ :secrets:host }}` Hostname (and optional port) of the Automation Controller, without scheme, for example aap.example.com.                          |
| **authToken** | Required    | String | `${{ :secrets:ansibleControllerToken }}` OAuth2 token, sent as Authorization: Bearer &lt;token>.                                                        |
| **jobId**     | Required    | Int    | `128` Numeric job ID. Typically the id returned by ansible.job.launch.                                                                                  |
| **selectors** | Optional    | List   | ```yaml [{"name": "status", "expression": ".status"}, {"name": "finished", "expression": ".finished"}, {"name": "failed", "expression": ".failed"}] ``` |

### Outputs

| Output Field     | Type    | Example                                                                                                                                                                 |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **success**      | Boolean | `success: true | false`                                                                                                                                                 |
| **response**     | Object  | ```yaml {   "id": 128,   "status": "successful",   "failed": false,   "started": "2026-07-08T10:00:00Z",   "finished": "2026-07-08T10:02:13Z",   "elapsed": 133.0 } ``` |
| **errorMessage** | String  | `{ "detail": "Not found." }`                                                                                                                                            |

### Example

| Workflow example                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: check-ansible-job description: 'Fetches 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"     next: end ``` |
