Build AI Coworkers
Code library
Create and manage reusable JavaScript scripts that workflows and AI Coworkers can run.
Some jobs don't have a native workflow action or MCP tool yet, such as resetting a password in a particular way or reassigning a pending approver to their manager. The Code library is where you keep JavaScript scripts for those jobs, so you write a script once and run it from both your workflows and your AI Coworkers.
To open it, go to AI Workforce > AI Registry > Code library.
What's in the library
The library lists every script in your organization, with its Title, Status, Last modified and Created by details. Use Search or the filter to find a script, and the three-dot menu (⋮) on a row to act on it.
-
Draft scripts are still being worked on and aren't available to run yet.
-
Published scripts are live. A published script can also show Has draft when someone is editing a new version that hasn't been published.
Atomicwork adds some scripts for you, which show System as their creator. For example, Okta — Reset password issues a one-time Okta password reset link and unlocks the account first if it's locked out, and Entra ID — Reset password resets an employee's Entra ID (Azure AD) password to a temporary one that they must change at next sign-in.
Create a script
Go to AI Workforce > AI Registry > Code library and click Create. A new script starts as a draft, and becomes available to workflows and AI Coworkers once it's published.
We'd recommend giving each script a description that says what it changes and what it returns. That's what people, and Service Assist, read when deciding whether to reuse it.
Write scripts with Service Assist
Click Service Assist on the Code library page to have Service Assist write, explain or fix a script from a plain-language description. When you open a script, the Service Assist panel opens with it. You can also ask about the library as a whole, for example "What do these scripts cover?" See Service Assist.
Related articles
- Execute code action: running custom code inside a workflow.
- Writing code scripts for access provisioning: scripts that grant or revoke access to an entitlement, and the
iga_contextthey receive. - Setting up an AI Coworker