Repository: ansible/awx

Issue:
awx collection workflow approval with success node fail
##### ISSUE TYPE
 - Bug Report

##### SUMMARY
apply success node to approval_node fail because success_nodes not exists in /api/v2/workflow_approval_templates/

"msg": "The requested object could not be found at /api/v2/workflow_approval_templates/280/success_nodes/."


##### ENVIRONMENT
* AWX version: 15.0.1
* AWX install method: docker
* Ansible version:  2.8.7
* Operating System: redhat
* Web Browser: chrome

##### STEPS TO REPRODUCE

approval_node with success_node

##### EXPECTED RESULTS

ansible tasks changed

##### ACTUAL RESULTS

ansible fail

##### ADDITIONAL INFORMATION



Discussion:
Hey @chris93111,

Can you give some clearer step-by-step instructions on how to reproduce this?  I'm having trouble understanding how to reproduce the issue.
Also @chris93111,

Could you give this a shot in the latest AWX (16.0.0)?  We've recently rewritten the entire workflow editor interface, and if this is a bug in the old interface, it's possible that it's been resolved in a newer AWX version.
 /api/v2/workflow_approval_templates - > workflow_approval_templates is the wrong toplevel endpoint (it doesn't exist)

Resolving patch:
diff --git a/awx_collection/plugins/modules/tower_workflow_job_template_node.py b/awx_collection/plugins/modules/tower_workflow_job_template_node.py
--- a/awx_collection/plugins/modules/tower_workflow_job_template_node.py
+++ b/awx_collection/plugins/modules/tower_workflow_job_template_node.py
@@ -174,6 +174,54 @@
     organization: Default
     success_nodes:
       - my-first-node
+
+- name: Create workflow with 2 Job Templates and an approval node in between
+  block:
+  - name: Create a workflow job template
+    tower_workflow_job_template:
+      name: my-workflow-job-template
+      ask_scm_branch_on_launch: true
+      organization: Default
+
+  - name: Create 1st node
+    tower_workflow_job_template_node:
+      identifier: my-first-node
+      workflow_job_template: my-workflow-job-template
+      unified_job_template: some_job_template
+      organization: Default
+
+  - name: Create 2nd approval node
+    tower_workflow_job_template_node:
+      identifier: my-second-approval-node
+      workflow_job_template: my-workflow-job-template
+      organization: Default
+      approval_node:
+        description: "Do this?"
+        name: my-second-approval-node
+        timeout: 3600
+
+  - name: Create 3rd node
+    tower_workflow_job_template_node:
+      identifier: my-third-node
+      workflow_job_template: my-workflow-job-template
+      unified_job_template: some_other_job_template
+      organization: Default
+
+  - name: Link 1st node to 2nd Approval node
+    tower_workflow_job_template_node:
+      identifier: my-first-node
+      workflow_job_template: my-workflow-job-template
+      organization: Default
+      success_nodes:
+        - my-second-approval-node
+
+  - name: Link 2nd Approval Node 3rd node
+    tower_workflow_job_template_node:
+      identifier: my-second-approval-node
+      workflow_job_template: my-workflow-job-template
+      organization: Default
+      success_nodes:
+        - my-third-node
 '''
 
 from ..module_utils.tower_api import TowerAPIModule


Test patch: