Overview
Custom Functions extend WorkDrive workflows by enabling advanced automation that goes beyond default workflow actions like share, move, copy, update fields, or restrict access.
With Custom Functions, you can:
- Run Deluge scripts to automate complex file management logic
- Connect WorkDrive to other Zoho or third-party applications
- Send or receive data via REST APIs using WorkDrive Connections
- Trigger advanced, multi-step workflow actions automatically
Whenever a file or folder meets the workflow criteria, WorkDrive executes the associated Custom Function and performs the scripted actions automatically.
Custom Functions are built using the Deluge Scripting Language, giving developers complete flexibility to process data, update WorkDrive content, and communicate with external services.
Create Custom Functions
Custom Functions in WorkDrive are written in Deluge and stored inside the Admin Console > Custom Functions section. These functions can then be linked to any workflow rule in your Team.
Note: Only Team Admins can create and manage custom functions.
To create a custom function:
- Go to Admin Console > Custom Functions.
- Click + New Function.

- In the create function form, provide:
- Function Name (Used in Code)
Example: calculate_storage_cost
Note: Function name must begin with a letter or underscore, can include only letters, numbers, or underscores, and must not exceed 50 characters.
- Display Name (Visible in listings)
Example: Calculate Storage Cost
- Description (Optional)
Add a short explanation of what your function does.
- Click Create to open the Deluge script editor.
- In the editor, write the function logic. (See Program Custom Functions below)
- Click Save to store your changes.
Note: A Custom Function must later be associated with a Workflow Rule to run automatically.
Program Custom Functions
Custom Functions are powered by Deluge (Data Enriched Language for the Universal Grid Environment). You can use Deluge to read workflow data, perform calculations, call WorkDrive APIs, or communicate with third-party services via Connections.
Using the Deluge Script Editor
The WorkDrive Custom Functions editor includes:
- A script-writing pane
- Refer Field suggestions for dynamic parameters
- Automatic syntax validation
- Support for arguments (string and int types)
- Console logs during test execution
Test Custom Functions
Before associating a Custom Function with a workflow, you can test it directly from the function editor.
To test a custom function:
- Open the function in Admin Console > Custom Functions.
- Click Save and Test.

- If your function has declared arguments, a dialog will appear to enter test values.
- Click Confirm to execute the function.
- View the results in the Console pane:
- Execution Status (Success / Failed)
- Time taken
- Logs and debug output
This helps validate logic, detect API errors, and ensure the function behaves as expected.
Associate Custom Functions with a Workflow Rule
The custom function that you create should be associated with a workflow rule. Whenever a record matches the criteria in a workflow rule and the workflow rule is triggered, the associated custom function will also be automatically executed.
To associate custom function to a workflow rule
- Go to Admin Console > Workflows.
- Create a new workflow or edit an existing one.
- Under Other Actions, choose Execute a custom function.

- Select your function from the list.
- If the function has arguments:
Map each argument to a static value or use dynamic workflow values via the # selector. Click here to refer the supported workflow dynamic values

- Click Save.
Manage Custom Functions
All custom functions you create are listed in the Custom Functions home page.
- Open the custom function window by accessing Admin Console > Custom Functions.
- Click on the More actions icon (...) next to the function name to view the list of available manage options.
- Available options:
- Edit Function: Modify the function, script, or metadata
- Delete: Remove the function (if not associated with a workflow)
Notes:
- A custom function cannot be deleted if it is currently associated with a workflow.
- You must remove it from all workflows before deleting it.
Limitations:
- Currently, you can create a maximum of 50 custom functions per team.
- Custom functions must use the void return type; other return types are not supported.
- Custom functions can only belong to the automation category.
- Function parameters must be of type string or int; no other parameter types are allowed.
- In automated workflows, all actions run using the permissions of the Workflow Creator. Custom Functions do not follow workflow-level permission conditions in automated workflows.
- All Custom Function actions (including external API calls) run with the permissions of the user who configured the function and created the associated connections.
Also read:
- How to create Connections in WorkDrive