<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em; position: relative; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; background-color: rgb(255, 255, 255); z-index: auto;">The problem:</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 13.63636302948px; line-height: 20.3636360168457px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Refer to workflow / action output without explicitly re-publishing the output values. Why we want it: to reduce repetition, and to make modifications in the place values are used, not where they are obtained (and not in multiple places). E.g., as an editor of a workflow, when I just realized that I need a value of some task down the line, I want to make change right here in the tasks that consumes the data (and only those which need this data), without finding and modifying the task that supplies the data.</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em; position: relative; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; background-color: rgb(255, 255, 255); z-index: auto;">Reasons:</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 13.63636302948px; line-height: 20.3636360168457px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">We don't have a concept of workflow or action ‘results': it's the task which produces and publishes results. Different tasks call same actions/workflows, produce same output variables with diff values. We don't want to publish this output with output name as a key, to the global context: they will conflict and mess up. Instead, we can namespace them by the task (as specific values are the attributes of the tasks, and we want to refer to tasks, not actions/workflows).</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em; position: relative; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; background-color: rgb(255, 255, 255);">Solution:</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 13.63636302948px; line-height: 20.3636360168457px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">To refer the output of a particular task (aka raw result of action execution invoked by this task), use the<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8181819915771px; line-height: normal; padding: 0.2em 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157);">_task</code> prefix:</p><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8181819915771px; margin-top: 0px; line-height: 1.45; padding: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); background-color: rgb(247, 247, 247); margin-bottom: 0px !important;"><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8181819915771px; line-height: inherit; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; word-wrap: normal; background-color: transparent; background-position: initial initial; background-repeat: initial initial;"> $_task.<taskname>.<path.to.variable>
$_task.my_task.my_task_result.foo.bar</code></pre><div><br></div><div><br></div><div style="font-size: 14px;"><b>Expanded example</b></div><div> </div><div><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8181819915771px; line-height: 1.45; padding: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); background-color: rgb(247, 247, 247); margin-top: 0px !important; margin-bottom: 0px !important;"><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.8181819915771px; line-height: inherit; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; word-wrap: normal; background-color: transparent; background-position: initial initial; background-repeat: initial initial;">my_sublfow:
output:
- foo # << declare output here
- bar
tasks:
my_task:
action: get_foo
publish:
foo: $foo # << define output in a task
bar: $bar
...
main_flow_with_explicit_publishing:
tasks:
t1:
workflow: my_subflow
publish:
# Today, you must explicitly publish to make data
# from action available for other tasks
foo: $foo # << re-plublish, else you can't use it
bar: $bar
t2:
action: echo output="$foo and $bar" # << use it from task t1
main_flow_with_implicit_publishing:
tasks:
t1:
workflow: my_subflow
t2:
action: echo output="$_task.t1.foo and $_task.t1.bar"</code></pre><div><br></div></div></body></html>