awx collection workflow creation

I’m trying to get my awx deployment documented in Iac. Trying to get workflows to create. ran into a bug with the built int tower-cli modules that was already documented and on that git issue the recommendation was to switch over to the new collection which I have done but it is still really new and I can’t find any documentation on workflow schema and survey formats supported. For my schema, I just have a very simple list that I pulled from tower-cli but when I run that against the awx.awx tower_workflow_template module I get

Elements value for option schema is of type <class ‘str’> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value"}

The below 2 formats are what I export out from tower-cli. Is there somewhere I can go to see the dict format the new collection is requesting??

I’ve tried the below two formats and this is what the module looks like:

  • name: Create Server Connection workflow
    tower_workflow_template:
    <<: *login
    name: Manage Server Connections
    description: Manage server connections in AWX
    organization: “{{ awx_org }}”
    schema: “{{ lookup(‘file’,‘./workflow_configure_ports.json’) }}”

survey: “{{ lookup(‘file’,‘./workflow_configure_ports_survey.json’) }}”

survey_enabled: yes

I was able to get this working finally. The problem is the easier documentation to find right now is on the older tower-cli based modules. In that documentation, they used a lookup to load the yaml schema. lookups parse the file and returns a str. In the collection though the tower_workflow_template wants a dictionary. Fix that by forgoing the lookup and drop your schema into a var file. There is also another way to do this and this is their recommend way going forward. Use the tower_workflow_job_template_node module to create the workflow. With this module you don’t upload a schema file you build the nodes and attach to the workflow. Something like this works: