diff --git a/contrib/examples/actions/orquesta-ask-multiple-parameters.yaml b/contrib/examples/actions/orquesta-ask-multiple-parameters.yaml new file mode 100644 index 0000000000..3280d7f016 --- /dev/null +++ b/contrib/examples/actions/orquesta-ask-multiple-parameters.yaml @@ -0,0 +1,7 @@ +--- +name: orquesta_ask_multiple_parameters +description: A basic workflow that demonstrates inquiry with multiple parameters. +runner_type: "orquesta" +entry_point: "workflows/orquesta-ask-multiple-parameters.yaml" +enabled: true +parameters: {} diff --git a/contrib/examples/actions/workflows/orquesta-ask-multiple-parameters.yaml b/contrib/examples/actions/workflows/orquesta-ask-multiple-parameters.yaml new file mode 100644 index 0000000000..92cfd7ad08 --- /dev/null +++ b/contrib/examples/actions/workflows/orquesta-ask-multiple-parameters.yaml @@ -0,0 +1,55 @@ +version: 1.0 + +description: A basic workflow that demonstrates inquiry with multiple parameters. + +tasks: + start: + action: core.echo message="Automation started." + next: + - when: <% succeeded() %> + do: get_approval + + get_approval: + action: core.ask + input: + schema: + type: object + properties: + approved: + type: boolean + description: "Continue?" + required: True + department_id: + type: number + description: "Your department ID:" + required: True + extra_output: + type: string + description: "Your message to echo next if you approve to continue:" + ttl: 60 + next: + - when: <% task(get_approval).result.response.containsKey("extra_output") and task(get_approval).result.response.approved = true %> + publish: + - custom_output: <% task(get_approval).result.response.extra_output %> + - approver_department_id: <% task(get_approval).result.response.department_id %> + do: echo_extra_message + - when: <% not task(get_approval).result.response.containsKey("extra_output") and task(get_approval).result.response.approved = true %> + publish: + - approver_department_id: <% task(get_approval).result.response.department_id %> + do: finish + - when: <% task(get_approval).result.response.approved = false %> + do: stop + + echo_extra_message: + action: core.echo message="Extra info <% ctx('custom_output') %>." + next: + - when: <% succeeded() %> + do: finish + + finish: + action: core.echo message="Approved by department <% ctx('approver_department_id') %>. Automation completed." + + stop: + action: core.echo message="Automation stopped." + next: + - do: fail