Create a new script
All scripts in Sitecore Content Hub are restricted. Unrestricted scripts are obsolete.
We recommend that you keep the total script run time 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 starvation and data inconsistency.
Go the the Manage page, type 'scripts' in the search bar, and select Scripts:
Click + Script:
In the pop-up screen, enter a Name, and select a Script type from the list:
When your script is created, it appears in the scripts list:
Click More options, then click Edit:
Enter your script code in the text area, then click Build:
Wait for the application to finish building your script:
![Wait for build to finish]
If the build fails, the error message indicates the errors in your script:
In this case, the script uses a context property that does not exist for the 'Metadata Processing' script type.
If the build succeeds, it means your script has no errors. Click Done:
The Publish button is only available after the script is built.
Publishing the script makes the current version of the code active. Make sure to publish the script for the code changes to take effect.
Click the arrow to get back to the Scripts screen:
To enable your script, switch the toggle:
Enabling your script makes it available for use.
Can we improve this article ? Provide feedback