This documentation supports releases of BMC Helix Intelligent Automation up to December 31, 2021. To view the latest version, select version 23.1 from the Product version menu.

Launching a job template

The Launch a Job Template action launches a specified job template from the Ansible Tower server. This template contains actions that are executed when the template is launched. For example, a template can contain action to stop an Amazon EC2 instance.

You specify this action while creating a policy. 

While creating an action, you can use an event stored in the BMC Helix Intelligent Automation database or provide an event in a JSON format. 


The process described in this topic is for one of the Ansible Tower actions supported by BMC Helix Intelligent Automation. Use the steps in this topic to add any Ansible Tower actions while creating a policy.

Before you begin

Do the following steps to include event attributes in the Ansible Tower's job or workflow template: 

  1. Log on to Ansible Tower.
  2. Go to the Resources > Templates section and open the job template or the workflow template that you want to launch via the automation policy.
  3. In the EXTRA VARIABLES section, include the variables and their values as per the template requirements.
    For example, if a template contains the action to stop an EC2 instance, specify the instance ID and the region for the instance in the following format:

            "instance_ids": [
            "region": "us-east-1"


    If you want to pass any extra variables to scripts in Ansible Tower, you must select the Prompt on Launch option in Ansible Tower.

    For more information about the job templates and extra variables, see the Ansible Tower documentation. 

To add Launch a Job Template action to a policy

  1. In the BMC Helix Intelligent Automation console, click Policies and the click Create Automation Policy.
  2. In the Policy Information section, enter a unique name and an optional description for the policy. 
  3. Select Manual or Automatic depending upon whether you want to execute the policy manually or automatically based on the incoming events.
  4. In the Trigger section, click Browse and perform one of the following steps to select an event:
    • From the Select Event Type tab, select an existing event type, and click Done.
    • On the Paste Event JSON tab, enter event in the JSON format, and click Done.

      Sample event for launching a job template
      "tags": {
          "event_type": "STOP_EC2_INSTANCE",
          "region": "ap-southwest",
          "instance_ids": ["i-05rab782b1f3770ct"]

      The event contains the following details:

      • region is the location in which the instance to be shut down is located.

      • instance_ids is the ID for the instance that you want to stop.

  5. In the Trigger Condition text box, build the following expression to match the trigger condition to the event:

    ( tags.event_type == STOP_EC2_INSTANCE ) && ( tags.event.region == ap-southwest ) && ( tags.event.instance_ids == i-05rab782b1f3770ct )

    To understand the expression syntax, see the Trigger condition expressions section in Creating automation policies.

  6. To add action to the policy, click Add Action and perform the following steps by using the action wizard:
    1. From the Pick an automation tool section, click the connector name.
      Only configured connectors are displayed here. The wizard takes you to the next step to select an action. 
    2. Click Sync Actions
      All job template and workflow template actions in your Ansible Tower instance appear. 
    3. Click Select against the Launch a Job Template action.
      The wizard takes you to the next step to configure an action.
    4. Provide the following information:
      1. In Request body, enter the region and instance ID in the following format:

        Sample request body for stopping an AWS EC2 instance
            "extra_vars": {
                "instance_ids": [
                "region": "us-east-1"

        Replace <region> with the region in which the instance ID is located and instanceID with the ID of the instance that you want to stop by launching this template. The <region> and <instanceID> variables should match the variables in the Ansible template.

      2. In Template Id, enter the ID of the template that you want to launch. 
    5. Click Done.
      The added action appears in the Action Configuration section on the Create Automation Policies page.
  7. In the Estimated Savings section, enter an approximate time (in minutes) and money (in USD) that you may save by automating this action.
  8. Select Publish Policy and click Save to publish the policy.

Was this page helpful? Yes No Submitting... Thank you


  1. Jon Brent Fournet

    The note below is not clear, it needs to say specifically that if you want to pass variables to scripts in ansible tower, you must check the check box "Prompt on Launch" in the extra variables section of the job template.


    The extra variables in the request body (specified while adding an action) get overridden in Ansible Tower only if the Prompt on Launch option is enabled in Ansible Tower.

    Jun 10, 2022 09:00
  2. Shweta Hardikar

    Hi Jon,

    Updated this note. Will work with you for any other feedback that you have, Thanks!

    Jun 14, 2022 08:26