# %% [markdown]
# # Setting pipeline inputs <a class="anchor" id="pipeline_inputs"></a>

The final step before running the pipeline, is to set input values:

# %%

{%  for step_id, inputs in input_values.items() -%}
{%  for name, value in inputs.items() -%}
step_{{ step_id }}.input.{{ name }} = {{ value }}
{% endfor -%}
{% endfor -%}

# %% [markdown]
# # Pipeline results <a class="anchor" id="pipeline_results"></a>

We don't need to explicitly run the pipeline, since our pipeline object is smart enough to process the required steps
for the outputs we request. But we can do it nonetheless, because it helps us debug any issues there might be by printing
out the current pipeline state:

# %%

workflow.process()
workflow

{%  for stage in structure.processing_stages -%}
{% for step_id in stage -%}# %% [markdown]
{%  set step = structure.get_step(step_id) -%}
# %% [markdown]
# ### Outputs for step: ``{{ step.step_id }}`` <a class="anchor" id="outputs_stage_{{ loop.index }}_{{ step.step_id }}"></a>

# %%
step_{{ step_id }}.info

{% for output_name in step.module.output_names %}
# %% [markdown]
# ### Output: ``{{ output_name }}``

# %%
step_{{ step_id }}.output_schemas["{{ output_name }}"].doc

# %% [metadata]
# #### Value metadata
# %%
step_{{ step_id }}.output.{{ output_name }}.value
# %% [markdown]
# #### Value data
# %%
kiara.pretty_print(step_{{ step_id }}.output.{{ output_name }}.data)
{% endfor -%}
{% endfor -%}
{% endfor -%}
