How to use notify with orquesta workflow and jinja expression support?
Issue: Not able to notify in slack channel with workflow output/stdout. How to use workflow context and variable in notify parameter, without writing for each of the task in the workflow
Workflow-meta.yaml
---
description: A Nessus scanner reporter validator workflow
enabled: true
runner_type: orquesta
entry_point: workflows/nessus_report_validation_workflow.yaml
name: nessus_report_validation_workflow
pack: st2pack_poc
notify:
on-complete:
routes:
- slack
message: "Action has finished"
on-success:
routes:
- slack
message: "Succeeded: {{action_results.stdout}}"
on-failure:
routes:
- slack
message: |
Yikes!! It failed. {{ stdout }} {{ result().stdout }} <% ctx() %> <% result().issue_key %> <% stdout %>!!
parameters:
...
Slack channel output:

Currently, there is already a notify parameter that can be specified in st2 action execution to specify which task to notify on. An example is located at https://github.com/StackStorm/st2/blob/master/st2tests/st2tests/fixtures/packs/orquesta_tests/actions/notify.yaml. However, it does not work the way you specified here to notify on certain conditions and what channel to notify on and with what message. We will mark this as a feature request at this point in time as we're trying to get the current scope into GA for st2 v3.0. If you do not hear from us, please ping us again about this feature. Thanks.
@m4dcoder thanks for looking into it.
well that's a very unpredictable syntax. Which route? which notify trigger will it choose?
Unfortunately this syntax didn't work on my v2.10.3 setup. I have chatops n slack: both configured correctly.
The old schema was working in the action-chain and thought all other workflows:mistra, orquesta will also honor it. We should have more consistent behavior across all workflow engines to have more coherent and delightful user experience.
To solve my problem, I had to write custom notify action in the workflow.
It is now 3.1.0. Is there a way to specify format for orquesta notify yet?
@moejarv You can use this example at https://github.com/StackStorm/st2/blob/master/st2tests/st2tests/fixtures/packs/orquesta_tests/actions/notify.yaml to specify a simple notify for the list of tasks that you want to get notification on. As for the original request in this issue, it's still open.
I also need either jinja 2 or yaql to help with formatting. Guess I need to try find out how to write custom notify action then.
I'm having issues with getting notify parameter to work.
Even if I specify to notify on a single task, I still see multiple core.st2.generic.notifytrigger triggers getting dispatched which results in multiple notifications.
I didn't have too much time to dig in yet, but once I do, I will open a new issue with some additional context.
Basically, what I wanted to achieve is to only notify on the whole workflow failure (not on sub tasks).
I tried to achieve that by specifying "notify" parameter and setting the default value to a dummy task which is never called.
Even when doing that, I see multiple notifications being triggered when a single task in a workflow fails, which makes it looks like this parameter is not being used or similar.
Trip on it today, relay need it, it makes orquesta useless for us, only workaround is to write manual actions all over the place :-(
Also issue with trigger 2 notification with a single task also happen on me