Scripts
Scripts are reusable code functions - written in Python or Ruby - that you can run from workflows, share with your team, and assign to projects. They work alongside prompts and workflows as a third type of tool in your library.
Use a script when you need deterministic code logic: data transformation, API calls, formatting, calculations. Anything where you want to write exact code rather than give an instruction to a model.
Creating a Script
Navigate to Scripts in the sidebar and click New Script.
Fill in:
Name - What your team will see in the library.
Language - Python or Ruby. This sets the default code template and determines the runtime.
The editor opens with a starter function:
# Python
def run_aisle(param1, param2):
# your code here
return result
# Ruby
def run_aisle(param1:, param2:)
# your code here
end
The function must be named run_aisle. Parameters defined in the function signature become the script's inputs automatically - you do not need to configure them separately.
Input and Output
Inputs are detected from your function's parameters. Rename the parameters in the code and the input config updates to match. Each input has a type: string, number, or array.
Output is the return value of run_aisle. Set the output type to match what your code returns: string, number, or array.
When a script is used as a workflow node, the output becomes a variable available to subsequent nodes.
Testing
Click Test to open a test modal. Enter values for each input parameter and run the script. The output and any execution logs appear immediately.
Test with realistic data before publishing. Edge cases - empty strings, nulls, unexpected array shapes - are worth checking before the script runs in a live workflow.
Publishing
Changes to a script create a new revision. Click Publish to save a revision.
The revision history is available under the Versions tab. You can see what changed between revisions and switch back to an earlier one.
Sharing
By default a script is private to you. To share it:
Navigate to the script and click Sharing. Set the access level:
- View - others can run the script but not edit it
- Edit - others can modify and publish new revisions
You can also share with specific users rather than the whole organization.
Shared scripts appear in teammates' script libraries and can be used in their workflows.
Using Scripts in Workflows
Scripts appear as a node type in the workflow builder. Select a script node, choose your script, and connect it to the workflow. Input variables are mapped from upstream node outputs.
Scripts can also be assigned to Projects, where they appear in the Tools section and are available via @ mention in project chats.
Logs
Every script execution is logged. Open the Logs tab on any script to see execution history: timestamp, status, inputs, output, and duration.