> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/installing-custom-scripts.md).

# Installing custom scripts

## Introduction

Creating a script is a two-stage process:

1. **Tell us about your script** — set the basics: name, type, language and runtime.
2. **Build & test** — write the script (manually or [with AI](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/creating-and-testing-custom-scripts/creating-a-script-with-ai)), and [test it](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/creating-and-testing-custom-scripts/testing-scripts) with your own sample inputs.

When you're happy with a script, it's ready to be [deployed](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/deploying-scripts-and-managing-versions) and used in process flows and connectors.

### Need to know

* The maximum memory size for a custom script is 512MB.
* The maximum size of a custom script is 4GB.
* Script names must be unique — you can't add two scripts with the same name.
* A script can hold up to **10 versions**. Once the limit is reached, you must delete old versions before new ones can be added.
* Saving and deploying are separate actions — you can save versions of a script as often as you like without affecting anything that's live.

### Creating a new script

Follow the steps below:

**Step 1**\
Log in to the [Patchworks dashboard](https://app.wearepatchworks.com/scripts) and select `Process Flows` from the left-hand navigation menu, followed by `Scripts`.

**Step 2**\
Choose to create a new script — the `tell us about your script` page is displayed:

<div data-with-frame="true"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fc9SJ34QalOEXgaqei36A%2FScreen%201.png?alt=media&amp;token=1aba8245-fce9-439c-9842-d0bc6e2dbc9d" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
Complete the fields summarised below:

| Field           | Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name            | A unique name for your script.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Description     | A short summary of what the script does — shown in the script library.                                                                                                                                                                                                                                                                                                                                                                                  |
| Script type     | The [type of script](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting#script-types) you're building: `General`, `Pre-auth`, `Post-auth`, `Pre-request`, `Post-request` or `Pagination`. The type sets the starter template and the inputs the script is written against — so you start from a shape that matches the job. It's a guide, not a restriction: it doesn't limit where the script can be attached later. |
| Language        | Your preferred coding language — see [supported languages](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting#supported-languages).                                                                                                                                                                                                                                                                                   |
| Runtime version | The runtime that the script runs on — for example, `Node 24` for JavaScript.                                                                                                                                                                                                                                                                                                                                                                            |

{% hint style="warning" %}
Choose your language carefully. Once you save a version of the script, its language can no longer be changed. You CAN change the runtime version at any time.&#x20;
{% endhint %}

**Step 4**\
Click `next` — your script is created with a starter template for the chosen type, and the `build & test` page is displayed.

### Building & testing your script

From the `build & test` page, you can work however suits you best — the pages below walk through each approach:

* [Creating a script manually](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/creating-and-testing-custom-scripts/creating-a-script-manually)
* [Creating a script with AI](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/creating-and-testing-custom-scripts/creating-a-script-with-ai)
* [Testing scripts](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/creating-and-testing-custom-scripts/testing-scripts)

Once you're happy with your script, see [Deploying scripts & managing versions](https://doc.wearepatchworks.com/product-documentation/developer-hub/custom-scripting/deploying-scripts-and-managing-versions) to release it.
