> For the complete documentation index, see [llms.txt](https://docs.unskript.com/unskript-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unskript.com/unskript-documentation/runbooks/xrunbooks/runbook-outputs.md).

# RunBook Outputs

RunBooks are able to publish output data.  The output is a JSON collection of data collected from the Actions inside your RunBook.

{% embed url="<https://youtu.be/1l-giACuYPI>" %}

## Define Output Parameters

To define your output parameters (these will be the "key" in the output JSON):

1. Click the Parameters option in the top navigation.
2. Choose the submenu "Output."
3. Select "Add Input Parameter."

![the Output parameter menu](/files/WSrNtGETkH0mnJzUcJnt)

A Dialogue will appear, where you can enter the values that correspond to the data you wish to add to the RunBook output:\
\
In this example, the output will have the name 'iam\_users', and will be a list.

<figure><img src="/files/KPRsh2sOi6aXEprBVZeX" alt="" width="563"><figcaption><p>Output parameter addition dialogue</p></figcaption></figure>

## Connect Action outputs to the RunBook Output

Each Action has an Output section:

![](/files/12NGPggwXaC9QmbQoPcN)

To add the output from this action to the RunBook output, select the "RunBook Output" checkbox.

![](/files/SKq1ZztKqG33bzmhJiXJ)

A new text box will appear.  Add the output parameter you wish to connect your Action output to.  In this case, we are connecting the output from "AWS List all IAM Users" to the "iam\_users" output.

## Adding outputs from Glue Actions

Glue Actions are Python code without a connector.  You can add output parmeters from glue actions with the following command:

<pre class="language-python"><code class="lang-python"><strong>#place the value you wish to output into a variable
</strong><strong>variable = "foo"
</strong><strong>w.set_output("&#x3C;output_parameter>", "variable")
</strong></code></pre>

For example, If we wanted to output a random IAM user, we could use the following glue Action

```python
import random
random_number = random.randint(0, len(iams)-1)
user= iams[random_number]
print(random_number, user)
w.set_output("random_number", "random_number")
w.set_output("random_user", "user")
```

This code reads in the list of IAM users, and randomly selects one of them.  The last two lines add RunBook outputs - "random\_number" and "random\_user".  For this to run successfully, both of these must be added as output parameters:

![](/files/KUcilxIqbQsaZ9SoJ9Ho)

## Seeing RunBook Outputs

In the Execution menu of unSkript, find the RunBook execution you wish to examine.  Click the Output tab, and you will see the RunBook output:

<figure><img src="/files/q6WaJ1NjxAQNTW7zIDZt" alt=""><figcaption><p>Screenshot of outputs tab of a RunBook execution</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.unskript.com/unskript-documentation/runbooks/xrunbooks/runbook-outputs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
