When we unconditionally send event data to the controller for a workflow template the launch of the workflow template fails. With this option in a rulebook the user can prevent event data from being sent by setting
Root Cause Analysis:
In the Controller if you are running a workflow template you cannot send event data to it unconditionally like we can do with job template. We get an error from Controller
Check the Prompt on Launch setting on the Workflow Job Template to include Extra Variables.
If a survey spec is involved then there are more constraints if there are certain parameters that are marked as required in the survey spec.
So we get 2 distinct items
Prompt on Launch for Extra Variables
Survey Spec
The following use cases are supported for workflow job template with and without survey spec.
The use cases are based on a rulebook that looks like the following with the action being updated for every case.
---
- name: Test run job templates
hosts: all
sources:
- ansible.eda.generic:
payload:
- name: Fred
age: 25
rules:
- name: "Run job template"
condition: event.age == 25
action:
run_workflow_template:
name: workflow_mk
organization: Default
Case 1:
If your Workflow Template doesn't support Prompt on Launch for Extra Vars and a Survey Spec is not enabled
When we unconditionally send event data to the controller for a workflow template the launch of the workflow template fails. With this option in a rulebook the user can prevent event data from being sent by setting
The default value is true so existing rulebooks will keep sending events to controller. Fixes #622 https://issues.redhat.com/browse/AAP-13456
Root Cause Analysis: In the Controller if you are running a workflow template you cannot send event data to it unconditionally like we can do with job template. We get an error from Controller
Check the Prompt on Launch setting on the Workflow Job Template to include Extra Variables.
If a survey spec is involved then there are more constraints if there are certain parameters that are marked as required in the survey spec.
So we get 2 distinct items
The following use cases are supported for workflow job template with and without survey spec.
The use cases are based on a rulebook that looks like the following with the action being updated for every case.
Case 1:
If your Workflow Template doesn't support Prompt on Launch for Extra Vars and a Survey Spec is not enabled
Case 2:
If your Workflow Template supports Prompt on Launch for Extra Vars and a Survey Spec is not enabled
The payload sent to Controller
Case 3:
If your Workflow Template doesn't support Prompt on Launch for Extra Vars and a Survey Spec is enabled
The payload sent to Controller
Case 4:
If your Workflow Template supports Prompt on Launch for Extra Vars and a Survey Spec is enabled
The payload sent to Controller
Case 5: Survey Spec has a required parameter and its not provided
Missing args 2024-09-26 12:59:03,738 - ansible_rulebook.job_template_runner - ERROR - Error {'variables_needed_to_start': ["'name' value missing"]}
Case 6: Survey Spec has no required parameter and its not provided
The Default Value is provided by the Survey Spec and it works