# Nested workflow job

**URL:** <https://forum.ansible.com/t/nested-workflow-job/35171>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [May 14, 2021, 4:43pm UTC](https://forum.ansible.com/t/nested-workflow-job/35171 "2021-05-14T16:43:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Butak](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Michael\_Butak](https://forum.ansible.com/u/Michael_Butak)\
**Post date:** [May 14, 2021, 4:43pm UTC](https://forum.ansible.com/t/nested-workflow-job/35171/1 "2021-05-14T16:43:47Z")

</div>

Hello,

TLDR: Does AWX support requests to nested workflow jobs called from ManageIQ? Is a request to the `jobs` endpoint valid when requesting the status of a `workflow_job`?

From ManageIQ (“MIQ”) we are calling an AWX workflow template that contains six workflows. On the AWX side everything runs without errors. In ManageIQ, after all of the workflows complete, MIQ performs a refresh of the “containing” workflow\_job with AWX (presumably to get the final status). To our surprise, it says that the workflow\_job doesn’t exist in our AWX instance. This answer appears to be coming from AWX.

Here’s the error in MIQ which says the job doesn’t exist:  
`[----] E, [2021-05-10T09:22:38.349852 #4003:3cd0034] ERROR -- : Q-task_id([r286_service_template_provision_task_589]) Method STDERR: (drbunix:///tmp/automation_engine20210510-4003-rbf8wu) /usr/local/lib/ruby/gems/2.5.0/bundler/gems/manageiq-providers-ansible_tower-cdc04865ff9a/app/models/manageiq/providers/ansible_tower/automation_manager/workflow_job.rb:84:in`rescue in refresh\_ems’: AnsibleTower Workflow Job postgres soup to nuts with id(175) does not exist on awx-qa Automation Manager (MiqException::MiqOrchestrationStackNotExistError) (DRb::DRbRemoteError) `

There’s a separate log in MIQ that tells us that this workflow\_job with id 175 in MIQ corresponds to workflow Job 18847 in AWX:  
`[----] E, [2021-05-10T09:22:38.343391 #4003:b57e8dc] ERROR -- : Q-task_id([r286_service_template_provision_task_589]) The following error occurred during instance method <refresh_ems> for AR object <#<ManageIQ::Providers::AnsibleTower::AutomationManager::WorkflowJob id:175, name: "postgres soup to nuts", type: "ManageIQ::Providers::AnsibleTower::AutomationManag...", description: nil, status: "successful", ems_ref: "18447", ancestry: nil, ems_id: 5, orchestration_template_id: 38, created_at: "2021-05-10 16:17:09", updated_at: "2021-05-10 16:22:35", retired: nil, retires_on: nil, retirement_warn: nil, retirement_last_warn: nil, retirement_state: nil,retirement_requester: nil, status_reason: nil, cloud_tenant_id: nil, resource_group: nil, start_time: "2021-05-10 16:17:08", finish_time: "2021-05-10 16:22:21", configuration_script_base_id: nil, verbosity: nil, hosts: nil, evm_owner_id: nil, miq_group_id: nil, tenant_id: nil>>`

We can clearly see in AWX that workflow job id 18847 exists. On the AWX side we can see that when performing this refresh, MIQ is calling the `jobs` endpoint. We suspected that MIQ should instead be calling the `workflow_jobs` endpoint (meaning a bug in MIQ). However our friends at RedHat tell us that `jobs` is a superset of `workflow_jobs` so the request to `jobs` should be valid.

Does anyone have any insight? Here’s a link to a gist containing more of the log context: [https://gist.github.com/mikebutak/0d4c8c0629dbadf1b55ae055095eebec](https://gist.github.com/mikebutak/0d4c8c0629dbadf1b55ae055095eebec)

---

<div class="post-metadata">

**Author:** ![Michael\_Butak](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Michael\_Butak](https://forum.ansible.com/u/Michael_Butak)\
**Post date:** [May 14, 2021, 5:17pm UTC](https://forum.ansible.com/t/nested-workflow-job/35171/2 "2021-05-14T17:17:47Z")

</div>

Perhaps this (calling the /jobs endpoint to get the status of a workflow\_job) used to work? Does anyone know if the AWX api changed?

---

<div class="post-metadata">

**Author:** ![Michael\_Butak](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Michael\_Butak](https://forum.ansible.com/u/Michael_Butak)\
**Post date:** [May 14, 2021, 9:25pm UTC](https://forum.ansible.com/t/nested-workflow-job/35171/3 "2021-05-14T21:25:22Z")

</div>

that was worded poorly. Let me rephrase:  
Is it possible that in the past it was valid to call the /jobs endpoint to get the status of a workflow\_job? Currently that appears to fail (says that workflow\_job doesn’t exist). Perhaps calling /jobs used to work but the AWX api changed. Would anyone have insight into that?
