> 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/connecting-actions.md).

# Connecting Actions

Connecting Actions to build on one another unleashes the full power of your RunBook

With a single Action, your xRunBook can be a powerful tool.  But to unleash the full potential of unSkript, we can connect multiple Actions. We do this by placing the output of an Action into a variable, and accessing this variable in subsequent Actions.

Each Action can have it's output saved into a variable for later use. In this example the List of IAM users is saved in the List `users`:

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FFq4FCERZbkF4B334wZFJ%2Fimage.png?alt=media&amp;token=3ad125ff-6072-43c8-ac61-66a2877bace8" alt=""><figcaption></figcaption></figure>

### Example:

{% embed url="<https://youtu.be/Vo1wxjDCj2A>" %}

Our first step is to get a list of all the IAM users in our AWS account.  Drag the "List all IAM Users" Action to your RunBook.<br>

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2F5EHIyrCYfRVZU0NLi1Us%2Fimage.png?alt=media&amp;token=5ed019d7-0f7d-4494-a2d8-878d6b77c773" alt=""><figcaption><p>List all IAM Users Action</p></figcaption></figure>

Next, we'll configure this action with credentials (to access our AWS account).  There are no required inputs for this action, but let's name the output of the Action "users."

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FTJCOJHUPbgL5iDMlX4ji%2Fimage.png?alt=media&amp;token=955df5c4-9f94-4c7d-b161-2d27ce551dd8" alt=""><figcaption><p>Configuring the Credentials and output of the Action</p></figcaption></figure>

When we run this Action, the list of users will be saved in the List `users`.

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FfqJCFW9wQl2KejXfdI37%2Fimage.png?alt=media&amp;token=eaaa245b-8618-43cb-9441-a1ea4c5515c1" alt=""><figcaption><p>A partial listing of the users in the list.</p></figcaption></figure>

We can now use the data in `users` to build on our RunBook.

In step 2, we'll add a simple Action to the Runbook by clicking  `+ Add -> + Action` in the top navigation.

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FydtKc9qp6BiUzfquw244%2Fimage.png?alt=media&amp;token=754b7770-7045-4c3c-813b-64dc8e6e68a8" alt=""><figcaption><p>Modifying the list</p></figcaption></figure>

This code loops through all of the users, and creates another list of the users with "doug" in the name.

Finally, let's send a message to Slack:

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2F7tTkBV1jlbRGbSsvkMuX%2Fimage.png?alt=media&amp;token=44fb2406-2c27-4f73-a674-9a70512b259b" alt=""><figcaption><p>Slack Configuration</p></figcaption></figure>

This Action takes the list of doug\_users, finds the length of the list and sends a message to the "devrel\_doug\_test1" channel announcing the number of users.

<figure><img src="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FAjvPUUk08qiqYujYDNw7%2Fimage.png?alt=media&amp;token=16df554e-8246-4915-a6d5-30d3591b38fd" alt=""><figcaption><p>The Slack Message</p></figcaption></figure>

By naming the output of our Action, we can use that variable in subsequent Actions to manipulate the data, and complete further tasks. &#x20;


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.unskript.com/unskript-documentation/runbooks/xrunbooks/connecting-actions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
