I’ve got a mistral workflow that takes some parameters and also is set to notify on complete so I can do something else with the data after each step completes:
---
name: test_action
entry_point: workflows/test_action.yaml
runner_type: mistral-v2
pack: test_pack
parameters:
param_1:
type: string
notify:
on-complete:
routes:
- "to_somewhere"
Corresponding rule:
---
...
trigger:
type: core.st2.generic.notifytrigger
parameters: {}
criteria:
trigger.channel:
pattern: "to_somewhere"
type: "equals"
action:
ref: test_pack.send_somewhere
parameters:
message: "{{ trigger }}"
I’ve been trying to figure out the best way to get the parameters fed to the “test_action” workflow to be sent at the end of each task in the workflow and at the end of the workflow itself. Jinja templates such as {{ action_parameters }} or {{ action_context }} etc. in the test_action.yaml notify section don’t seem to work quite right.
So for example, I’ve tried:
notify:
on-complete:
routes:
- "to_somewhere"
data:
param: "{{ action_parameters.param_1 }}"
But it seems like it doesn’t render out properly for both the tasks in the workflow and the workflow…it’s one or the other.
I’ve seen in the docs regarding notifications and mistral that per task notifications aren’t fully supported as “first class citizens” and wondering if that’s what’s causing my frustration with this. Also open to suggestion on how to achieve the end result in a different way.