# Create Custom Actions

While unSkript offers many Actions for your xRunBooks, it's probable that you'll want to create your own, or perhaps modify an existing Action for your specific needs.

For this, you can create a custom Action.  You can also create actions with ChatGPT using our [Action GenAI](/unskript-documentation/actions/create-actions-with-ai.md) feature.

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

## Modify an Existing Action

You can modify the source code of a built-in Action to create your custom action.&#x20;

> For example, Perhaps the **List all AWS IAM Users** returns a list of usernames:
>
> ![](/files/LbRGA2xhtE1jCX1onjTf)

What if we'd like to also retrieve the Arn for each user? We can just modify the existing code:

```
        for x in response['Users']:
            #users_list.append(x['UserName'])
            users_list.append({"name":x['UserName'], "arn":x['Arn']})
```

We have commented out the original code that returns just the name, and repalced it with a dictionary with the name and Arn values for each User in the list:

<figure><img src="/files/r7C5HQQqWeU68tvOT0YQ" alt=""><figcaption><p>Action Updated with refined code for your use case!</p></figcaption></figure>

## Creating a New Action: With Connector

Each Connector has a "handle" Action that has the basic connectivity built in.  Building on this Action allows you to make the API calls into your service as needed.

In the example below, the AWS boto3 handle Action is used as a base to create a new AWS Action to fetch all EC2 instances for that region.

![](/files/4tFBNi8rUtfZNKqdlkaG)

The custom action can be renamed and saved as a new Action to fit your Task.&#x20;

![Save As](/files/SRw3gEDs9je1dKRTlRtN)

Fill out the details to save the new Action.

![](/files/QPVlmuxj5kyfdMjTSt5c)

You can view all your Custom Actions in the Actions tab under myActions.

![](/files/nsO1eBfkWmOM6Zwdm93o)


---

# Agent Instructions: 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:

```
GET https://docs.unskript.com/unskript-documentation/actions/create-custom-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
