How to run run a action dynamically in orquesta workflow

I’m trying to run a job dynamically. Below is part of my workflow

  • when: “{{ succeeded() }}”
    - env: “{{ result().result.env }}”
    - job: “{{ result().result.job }}”
    - color: “{{ result().result.color }}”
    - <% ctx(job) %>

but I’m getting below exception. Instead of <% ctx(job) %> I tried “<% ctx(job) %>”, <% ctx.job() %>, “<% ctx().job %>”

  • message: The task “<% ctx(job) %>” is not defined.
    schema_path: properties.tasks.patternProperties.^\w+$
    type: semantic

See here: Dynamic action workflows pattern

This is not supported. The tasks defined to run next in do must be explicit. The workflow engine does validation before running the workflow and so the execution paths must be predetermined.

it would be great if tasks can be ran dynamically.

This is in conflict to our core concept for our workflow engine which requires task and transition to be defined explicitly.

got it. Thanks for the quick response @m4dcoder

@m4dcoder couldn’t one just have more than one when And have different tasks based on the conditional and get the same outcome? Or at least for repeatable cases?