Custom scripts let you deploy reusable code in isolated containers and call them from nodes using secure API endpoints.
Use the Manage Custom Scripts page in Settings to upload, configure, and deploy a complete script project without writing code directly in nodes.
Key Capabilities
| Capability | Description |
|---|
| Task Automation | Automate repetitive or complex tasks that require custom logic. |
| Secure API Integration | Integrate scripts into apps using API endpoints with secure authentication. |
| Customization | Implement logic or workflows tailored to unique business requirements. |
| Data Processing | Transform, filter, or validate data to meet specific operational requirements. |
| Error Handling | Create custom error-checking and fallback mechanisms beyond standard system behavior. |
Deployed scripts can be invoked from:
- The API node endpoint when building a tool flow.
- The Function node in the tool automation flow.
Import and Deploy a Custom Script
- Go to Settings → Manage Custom Scripts, then select + Import new.
- Configure the fields in each section: General Details, Runtime Settings, and Resource Allocation.
- Review your configuration across all sections. Select any section to return and modify values.
- Accept the Terms and Conditions and select Deploy, or select Save as Draft to save the configuration and deploy later.
After successful deployment, a confirmation email is sent to the admin with the credits remaining and total allocation for the account.
General Details
| Field | Description |
|---|
| Script Name | Enter a unique name for the script. |
| Description | Briefly describe the purpose and capabilities of the script. |
| Base Language | Select the language: JavaScript (20.19.0) or Python (3.10.15). |
| Language Version | Select the version. Auto-selected based on the language chosen. |
| Project File | Upload a .zip, .gz, or .tar file up to 1 GB. |
Select Validate to check the file for errors before proceeding. Validation checks include:
-
File matches the sample project structure and allowed format.
-
Main file is not empty.
-
Project file is within the 1 GB limit.
Resolve all errors and warnings before continuing. Click Download sample project to get a .zip folder with sample script definitions as reference.
Custom Script Requirements and Guidelines
| Requirement | Description |
|---|
| Main Entry Point | Include a main.py (Python) or main.js (JavaScript) at the root directory. Only functions defined in this file are exposed via API endpoints or workflow integrations. |
| Modular Code | Organize code across multiple files for better structure. Use additional files for helper functions and import them into main.py or main.js. Only functions in the main file are exposed. |
| Custom Dependencies | Include a requirements.txt (Python) or package.json (JavaScript) at the root directory if your code has external package dependencies. |
| Relative Imports | Use relative imports when importing between files in your project. Refer to the sample files for examples. |
| Environment Variables | Access environment variables in your scripts as follows: Python: import os then os.getenv('<key_name>'). JavaScript: process.env.<key_name> |
Runtime Settings
| Field | Description |
|---|
| Environment Variables | Enter key-value pairs accessible from your script at runtime. Select + Add to add more pairs. Two default variables are available: UPLOADS_DIR (read-only access to files uploaded via Public APIs) and WORKSPACE_DIR (read-write directory for your function’s file operations). |
| Execution Timeout | Set the timeout in seconds. Allowed range: 30–600 seconds. Prevents resource overuse from long-running or infinite-loop scripts. |
The following default environment variables are available:
- UPLOADS_DIR: Read-only access to all files uploaded via the Public APIs. Use this to access data submitted to your account.
- WORKSPACE_DIR: Read-write directory for your function’s file operations. Data that your function stores or modifies is saved here.
Both directories are accessible only while the container is deployed. Once undeployed, these storage locations are no longer available.
Resource Allocation
Define scaling parameters and hardware requirements to ensure the script performs optimally under varying loads.
| Field | Description |
|---|
| Min Replicas | Minimum number of pods per service. Allowed range: 1–10. Default: 1. |
| Max Replicas | Maximum number of pods per service. Must be ≥ Min Replicas. Allowed range: 1–10. Default: 1. |
| Average Compute Utilization | Threshold (%) to trigger auto-scaling per pod. Default: 75. Allowed range: 1–100. Disabled when Min and Max Replicas are equal. |
| Hardware Profile | Select the vCPU and memory configuration for deployment. |
Available hardware profiles:
| Profile | Actual CPU and Memory | Credits per Hour |
|---|
| 1 vCPU, 2 GB memory | 0.7 vCPUs, 1.1 GB memory | 0.07698 |
| 2 vCPUs, 4 GB memory | 1.5 vCPUs, 2.5 GB memory | 0.15396 |
| 2 vCPUs, 8 GB memory | 1.5 vCPUs, 6.5 GB memory | 0.144 |
| 4 vCPUs, 8 GB memory | 3.5 vCPUs, 6 GB memory | 0.30792 |
| 4 vCPUs, 16 GB memory | 3.5 vCPUs, 13.5 GB memory | 0.288 |
Manage Deployed Scripts
Once a script is deployed or saved as a draft, the Manage Custom Scripts page lists all scripts and their statuses.
Script Deployment Statuses
| Status | Description | Overview | Deployment History | Endpoint | API Keys | Redeploy |
|---|
| Draft | Draft copy of the script. Can be modified and deployed later. | Export, Delete, Deploy | Deploy Custom Script | Deploy Custom Script | Create a New API Key | No |
| Deploying | Script is being deployed. A success message appears on completion; a failure message appears if deployment fails. | Export, Delete | Rename deployment version | Endpoint not activated | Create API keys | No |
| Ready to Deploy | Script is configured and ready to deploy. | Export, Delete, Deploy | Rename deployment version | Endpoint not activated | Create API keys | Yes |
| Deployed | Script is successfully deployed. | Redeploy, Undeploy, Export | View configuration and deployment details; rename deployment version | Redeploy script; view endpoint code (cURL, JS, Python); copy script code | Create API keys; manage API keys | Yes |
| Deployment Failed | Script deployment failed. | Deploy, Delete, Export | View configuration and deployment details (except duration); rename deployment version | Endpoint not activated | Create API keys | Yes |
Export a Script
Downloads the .zip folder of the script project to your local system.
- On the Manage Custom Scripts page, select the Ellipses icon under Actions and select Export.
- Alternatively, select the script entry and select Export on the Overview page.
You can view the export status while it is in progress, on completion, or if it fails. You can cancel an export in progress.
Undeploy a Script
Undeploys the script from all its deployed locations on the platform.
- An undeployed script can be redeployed. See Redeploy a Script.
- After redeployment, the script’s data and configurations are restored. You can edit the name and other parameters in the deployment flow.
- If no scripts are deployed, the Function node displays “No custom scripts deployed yet.” Undeployed scripts do not appear in the Script dropdown for the Function node.
To undeploy a script:
- On the Manage Custom Scripts page, select the Ellipses icon under Actions and select Undeploy.
- Alternatively, select the script entry and select Proceed to Undeploy on the Overview page.
- Select Undeploy in the confirmation window.
The script status changes to Ready to Deploy and a success message is displayed.
After a successful undeploy, a confirmation email with the subject line “Your custom script has been undeployed successfully” is sent to the admin, including credits remaining and total allocation for the account.
Delete a Script
Permanently deletes a script, including its configurations and definitions, from the system.
- You cannot delete a deployed script. Undeploy it first.
- Deleted scripts and their configurations cannot be restored.
To delete a script:
-
On the Manage Custom Scripts page, click the Ellipses icon under Actions, then click Delete.
Alternatively, click the script entry and select Proceed to Delete on the Overview page.
-
Click Delete in the confirmation window.
Redeploy a Script
Redeployment lets you update a script’s description, project file, runtime settings, and resource allocation. You cannot change the script name, base language, or version number during redeployment. Redeploy is only available for scripts with the Deployed status.
To redeploy a script:
-
Click the script with the Deployed status on the Manage Custom Scripts page.
-
Click Re-deploy on the Overview page.
-
The import wizard opens with the existing configuration. Update the required fields.
After redeployment, the Overview page is updated with the latest deployment information.
View Script Details
Select any script entry on the Manage Custom Scripts page to open its detail view. The following tabs are available for all script statuses.
Script Overview
The Overview page shows the configuration details of the latest deployed version of a script. To open it, click any script entry on the Manage Custom Scripts page.
The page is available for all script statuses and displays:
Available actions depend on the script’s status. See the Script Deployment Statuses table.
Deployment History
The Deployment History page shows previous and current deployment and undeployment actions for a script. Use it to track version history, deployment statuses, and actions performed.
- Deployment history is available for the following statuses: Deployed, Deployment Failed, Deploying, and Ready to Deploy.
- For scripts in Draft status, the page shows a prompt to deploy the script. Click Deploy custom script and follow the steps in Import and Deploy a Custom Script.
- Undeployment information is shown only when the status is Ready to Deploy.
Endpoint
The Endpoint page shows the activated endpoint code for a deployed script in multiple formats. Copy the code in your preferred format to integrate it into your applications.
The endpoint code is view-only and cannot be edited.
Available formats:
-
cURL: API endpoint information for the script.
-
JavaScript: Payload JSON code in JavaScript format.
-
Python: Payload JSON code in Python format.
For scripts with the Deploying, Deployment Failed, or Ready to Deploy status, the page shows a prompt to deploy the script and activate the endpoint.
API Keys
API keys control access to a deployed script’s endpoint. Create at least one API key before calling a script via an endpoint.
You can create API keys for a script regardless of its deployment status. Keys can only be used after the script is successfully deployed.
To create an API Key:
- Navigate to the API Keys page.
- Click Create a New API Key or Create New Key.
- Enter a unique name for the key. The default name is “Secret Key.”
- Click Generate Key and then Copy and Close.
Your secret API key is shown only once. Save it in a secure location. Do not share it or expose it in client-side code. If you lose the key, you must generate a new one.
Using Custom Scripts in the API Node
To call a deployed custom script from the API node in a tool flow:
-
In the API node configuration, click Request Definition.
-
In the Edit Request dialog, configure the following:
-
Select the request type.
-
Copy the cURL from the Endpoint page of the custom script.
-
Paste it in the text field.
-
In Auth Profiles, select an authentication profile or None (default) if authentication is not required. Learn more about Auth Profiles.
-
In the Headers tab, add key-value pairs. For example, Key:
Content-Type, Value: application/json.
-
In the Body tab (not available for GET requests), select the content type:
- application/x-www-form-urlencoded: File uploads via HTTP POST. Key/value pairs are encoded by the platform.
- application/json: JSON data exchange between servers and web applications.
- application/xml: XML payload for SOAP services using POST, with the option to include node values.
- Custom: Non-standard payload formats, such as for blogs or custom variables.
-
Click Test to send a test request. The API response appears in the Response tab.
-
Click Save.
For more information, see the API node documentation.