n8n-nodes-awx
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

n8n AWX Node

Ansible AWX Logo

An unofficial n8n integration node for Ansible AWX/Tower with enhanced type safety

Trademark Notice: Ansible®, AWX®, and Red Hat® are trademarks of Red Hat, Inc. This project is not affiliated with or endorsed by Red Hat.

Features

  • TypeScript interfaces for AWX Projects and Job Templates
  • Type-safe API interactions for key operations
  • Job Templates (launch/get/list)
  • Jobs (monitor/list)
  • Inventories (get/list)
  • Projects (get/list/update)
  • Workflows (launch/get/list)
  • Secure credential management
  • Automatic pagination
  • Enhanced error handling

Installation

npm install n8n-nodes-awx

Type-Safe Implementation

This package features TypeScript interfaces for key AWX resources:

  • IAwxJobTemplate - Type-safe job template operations
  • IAwxProject - Type-safe project operations

All API responses for these resources are properly typed, making it easier to work with AWX data in your workflows.

Launch with Variables

{
  "parameters": {
    "operation": "launch",
    "jobTemplateId": "1",
    "extraVariables": "{\"limit\":\"web\",\"tags\":\"deploy\"}"
  }
}

3. Full Workflow with Monitoring

{
  "nodes": [
    {
      "parameters": {
        "operation": "launch",
        "jobTemplateId": "1"
      },
      "name": "Launch Job"
    },
    {
      "parameters": {
        "operation": "get",
        "resource": "jobs",
        "id": "={{ $node['Launch Job'].json.id }}"
      },
      "name": "Monitor Job",
      "executeOnce": false,
      "maxExecutions": 10
    }
  ]
}

4. Error Handling Example

{
  "nodes": [
    {
      "parameters": {
        "operation": "launch",
        "jobTemplateId": "1"
      },
      "name": "Launch Job",
      "continueOnFail": true
    },
    {
      "parameters": {
        "if": "={{ $node['Launch Job'].json.failed === true }}",
        "message": "Job failed: {{ $node['Launch Job'].json.msg }}"
      },
      "type": "n8n-nodes-base.if"
    }
  ]
}

Launch Job by Template ID

{
  "nodes": [
    {
      "parameters": {
        "operation": "launch",
        "jobTemplateId": "1",
        "extraVariables": "{\"debug\":true}"
      },
      "name": "Launch AWX Job",
      "type": "n8n-nodes-awx.awx",
      "typeVersion": 1
    }
  ]
}

Launch Job by Template Name

{
  "nodes": [
    {
      "parameters": {
        "operation": "list",
        "resource": "jobTemplates",
        "filter": "name:My Template Name"
      },
      "name": "Get Template ID",
      "type": "n8n-nodes-awx.awx",
      "typeVersion": 1
    },
    {
      "parameters": {
        "operation": "launch",
        "jobTemplateId": "={{ $node[\"Get Template ID\"].json.results[0].id }}",
        "extraVariables": ""
      },
      "name": "Launch Job",
      "type": "n8n-nodes-awx.awx",
      "typeVersion": 1
    }
  ]
}

Filtering Resources

When listing resources in the n8n UI, you can filter using simple field inputs. These are automatically converted to the proper AWX API syntax:

UI Filter Fields

  • Name: Simple text input (matches partial names)
  • Organization: Dropdown or text input
  • Status: Dropdown selection

Underlying API Syntax

For reference, these UI filters translate to:

  1. Name
    • UI input becomes: name__contains=your_search_term
  2. Organization
    • UI selection becomes: organization__name__contains=org_name or organization=id
  3. Status
    • UI selection becomes: status=selected_status

For advanced filtering needs (like exact matches or case-insensitive search), you'll need to modify the node code or use direct API calls.

Advanced Filter Patterns

You can combine multiple filters using AND conditions:

// Multiple filters
name:MyTemplate AND organization:Default AND status:running

// Date ranges
created__gte:2025-01-01 AND created__lte:2025-12-31

// Numeric comparisons
id__gt:100 AND id__lt:200

For full syntax details, see the AWX API Filtering Documentation

Additional Resources

Node Configuration Screenshot

AWX Node Configuration

API Documentation

Example with Inventory Selection

{
  "parameters": {
    "operation": "launch",
    "jobTemplateId": "1",
    "inventoryId": "2",
    "extraVariables": "{\"target\":\"production\"}"
  }
}

Workflow with Approval Step

{
  "nodes": [
    {
      "parameters": {
        "operation": "launch",
        "jobTemplateId": "1"
      },
      "name": "Launch Job"
    },
    {
      "parameters": {
        "type": "approval",
        "message": "Approve production deployment?"
      },
      "name": "Approval Step",
      "type": "n8n-nodes-base.manual"
    },
    {
      "parameters": {
        "operation": "get",
        "resource": "jobs",
        "id": "={{ $node['Launch Job'].json.id }}"
      },
      "name": "Monitor Job"
    }
  ]
}

Version History

For detailed release notes and changes, see:
CHANGELOG.md

Configuration

  1. Add "AWX API" credentials in n8n
  2. Set:
    • Base URL (e.g., https://your-awx-instance.com)
    • API Token

Troubleshooting

  • Connection issues: Verify base URL ends with /api/v2 for AWX
  • Authentication errors: Regenerate API token in AWX
  • Version Support: Compatible with AWX 15+ and n8n 1.0+

Development

npm install
npm run build

Authors and License

Author: Wei-Yen Tan

License: MIT License

Copyright (c) 2025 Wei-Yen Tan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Package Sidebar

Install

npm i n8n-nodes-awx

Weekly Downloads

41

Version

0.4.3

License

MIT

Unpacked Size

529 kB

Total Files

30

Last publish

Collaborators

  • weiyentan