---
title: "Work with scripts"
slug: "work-with-scripts"
abstract: "How to create, edit, and enable or disable a web script."
---
# Work with scripts

You can integrate [custom web scripts](https://doc.sitecore.com/ch/en/developers/cloud-dev/scripts.html "Scripts") in your business logic by creating new scripts and editing or enabling existing ones. Depending on your use case, there are [different script types](https://doc.sitecore.com/ch/en/developers/cloud-dev/script-types.html "Script types") with different context properties.

> [!important]
> We recommend that you keep the total script runtime below 10 minutes. After 12 minutes, the script worker considers the script stuck and starts a new worker to relaunch it. This can cause resource depletion and data inconsistency.
>
> When using scripting, you can't change the minimum log level on the default `IMClient.Logger`. You can change it on the **Scripts** page instead. By default, the minimum log level is not set and displays `None`. This defaults to the `Info` log level in the SDK.
>
> The maximum limit of log entries per script is 50.

> [!note]
> When setting up a script, you can use an `HTTP POST` call as shown in the [Read asset metadata](https://doc.sitecore.com/ch/en/developers/cloud-dev/read-asset-metadata.html#setup) example.

## Create a script

To create a script:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Scripts**.
3. On the **Scripts** page, click :mdiPlus: **Script**.
4. In the **Script** dialog, enter a name and a description and [select a script type](https://doc.sitecore.com/ch/en/developers/cloud-dev/script-types.html "Script types").
5. To run the script with the permissions and identity of the user who triggered it, select the **Execute script as user** check box. If this option is not selected, the script is run using default user settings and permissions.
6. If you want to create another script, select the **Create another** check box.
7. Click **Save**. If you selected the **Create another** check box, a **Script** dialog appears where you can create another script. If you are not creating another item, the **Scripts** page opens.

    > [!note]
    > When you create another item, some of the fields are prefilled with values you already defined.

8. On the **Scripts** page, click the new script and then click **Edit** in the upper right-hand corner.
9. Enter your script code in the text area, then click **Build**.
10. If the script builds without errors, click **Done**. If not, fix the errors and build again.
11. To apply your code changes, click **Publish**.

## Edit a script

To edit a script:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Scripts**.
3. On the **Scripts** page, click the script you want to edit and then click **Edit** in the upper right-hand corner.
4. Make any necessary edits and click **Save changes**.
5. Click **Build**.
6. If the script builds without errors, click **Close**. If not, fix the errors and build again.

## Enable or disable a script

To enable or disable a script:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Scripts**.
3. On the **Scripts** page, next to the script you want to enable or disable, turn the **Enable control** switch on or off.