Ask Your Question
2

How can I conditionally run a task in a Mistral workflow?

asked 2017-01-09 08:22:54 -0500

d0ugal gravatar image

If I have a Mistral workflow, how can I control the workflow and only run a task based on a specific input or the result of a previous task?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-09 08:31:56 -0500

d0ugal gravatar image

updated 2017-01-10 08:13:59 -0500

zaneb gravatar image

After some investigation, I found out a way to do this here:

my_workflow:
  input:
    - x: false

  tasks:
    task_switch:
      on-success:
        task_a: <% $.x = true %>
        task_b: <% $.x != true %>
    task_a:
      action: std.echo output="x is true"
    task_b:
      action: std.echo output="x is not true"

I wrote a fairly detailed post about how to do this.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-01-09 08:22:54 -0500

Seen: 106 times

Last updated: Jan 10 '17