Working with Custom Functions

Working with Custom Functions

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:
  1. Run Deluge scripts to automate complex file management logic
  2. Connect WorkDrive to other Zoho or third-party applications
  3. Send or receive data via REST APIs using WorkDrive Connections
  4. 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.
NotesNote: Only Team Admins can create and manage custom functions.


To create a custom function:
  1. Go to Admin Console > Custom Functions.
  2. Click + New Function.



  3. In the create function form, provide:
    1. 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.

    2. Display Name (Visible in listings)
      Example: Calculate Storage Cost

    3. Description (Optional)
      Add a short explanation of what your function does.


  4. Click Create to open the Deluge script editor.
  5. In the editor, write the function logic. (See Program Custom Functions below)
  6. Click Save to store your changes.
Notes
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:
  1. A script-writing pane
  2. Refer Field suggestions for dynamic parameters
  3. Automatic syntax validation
  4. Support for arguments (string and int types)
  5. 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:
  1. Open the function in Admin Console > Custom Functions.
  2. Click Save and Test.


  3. If your function has declared arguments, a dialog will appear to enter test values.
  4. Click Confirm to execute the function.
  5. View the results in the Console pane:
    1. Execution Status (Success / Failed)
    2. Time taken
    3. 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
  1. Go to Admin Console > Workflows.
  2. Create a new workflow or edit an existing one.
  3. Under Other Actions, choose Execute a custom function.



  4. Select your function from the list.
  5. 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



  6. Click Save.

Manage Custom Functions

All custom functions you create are listed in the Custom Functions home page.
  1. Open the custom function window by accessing Admin Console > Custom Functions.
  2. Click on the More actions icon (...) next to the function name to view the list of available manage options.
  3. Available options:
    1. Edit Function: Modify the function, script, or metadata
    2. Delete: Remove the function (if not associated with a workflow)
Notes
Notes:
  1. A custom function cannot be deleted if it is currently associated with a workflow.
  2. You must remove it from all workflows before deleting it.

Limitations

  1. Currently, you can create a maximum of 50 custom functions per team.
  2. Custom functions must use the void return type; other return types are not supported.
  3. Custom functions can only belong to the automation category.
  4. Function parameters must be of type string or int; no other parameter types are allowed.
  5. 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.
  6. All Custom Function actions (including external API calls) run with the permissions of the user who configured the function and created the associated connections.

Deluge Limits

Apart from the number of function calls made in a certain time duration, a few aspects such as the number of lines in a function, timeouts, etc affect the performance of each function. The following table shows the limits applied to Deluge functions based on their functionality:

Functionality

Description

Limits

Execution Time

Function should be executed within the specified time.

1 minute

Response Limit

Function should return the response within a particular size.

10 MB

Lines of execution

Function is executed based on the number of lines in the code.

200,000

Send Mail

You can send emails using the send mail syntax.

1000/day

Webhooks

GET and POST URLs

50,000 requests/day

Download Limit

The maximum file size supported for downloading and processing within a custom function is 5 MB.

5 MB


Also read:
  1. How to create Connections in WorkDrive


        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG


                                      All-in-one knowledge management and training platform for your employees and customers.

                                                Create. Review. Publish.

                                                Write, edit, collaborate on, and publish documents to different content management platforms.

                                                Get Started Now




                                                                  You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                      Manage your brands on social media


                                                                        • Desk Community Learning Series


                                                                        • Digest


                                                                        • Functions


                                                                        • Meetups


                                                                        • Kbase


                                                                        • Resources


                                                                        • Glossary


                                                                        • Desk Marketplace


                                                                        • MVP Corner


                                                                        • Word of the Day


                                                                        • Ask the Experts


                                                                          Zoho Sheet Resources

                                                                           

                                                                              Zoho Forms Resources


                                                                                Secure your business
                                                                                communication with Zoho Mail


                                                                                Mail on the move with
                                                                                Zoho Mail mobile application

                                                                                  Stay on top of your schedule
                                                                                  at all times


                                                                                  Carry your calendar with you
                                                                                  Anytime, anywhere




                                                                                        Zoho Sign Resources

                                                                                          Sign, Paperless!

                                                                                          Sign and send business documents on the go!

                                                                                          Get Started Now




                                                                                                  Zoho TeamInbox Resources





                                                                                                            Zoho DataPrep Demo

                                                                                                            Get a personalized demo or POC

                                                                                                            REGISTER NOW


                                                                                                              Design. Discuss. Deliver.

                                                                                                              Create visually engaging stories with Zoho Show.

                                                                                                              Get Started Now








                                                                                                                                  • Related Articles

                                                                                                                                  • Custom Domain - Upload, Download, & Preview Errors

                                                                                                                                    While using the Custom Domain feature in WorkDrive, you may experience an instance where user actions like upload, download, or preview may not work, with other functions working properly. Since domains are different for Custom domain enabled orgs, ...
                                                                                                                                  • Working with Connections

                                                                                                                                    Overview Connections let you integrate Zoho WorkDrive with third-party or Zoho services using OAuth 2.0 authorization. WorkDrive manages the entire OAuth flow, including authorization, access tokens, refresh tokens, and secure storage. This keeps ...
                                                                                                                                  • Workflow custom fields

                                                                                                                                    Workflow custom fields are versatile tools designed to collect feedback and assignees' or approvers' data, and gather critical information during workflow transitions. The following is a list of the available workflow fields in WorkDrive, along with ...
                                                                                                                                  • Create a custom Workflow

                                                                                                                                    Boost productivity, save time, and minimize errors by automating your routine business processes with WorkDrive Workflow. This feature allows you to streamline repetitive tasks such as approvals, data collection, and task assignments, enabling more ...
                                                                                                                                  • Add a custom audio cover image

                                                                                                                                    Zoho WorkDrive allows you to modify the default system-generated cover image to a custom cover image for your audio files. The updated image will appear in all audio preview (including external users' view and embedded view), and as a thumbnail in ...
                                                                                                                                    Wherever you are is as good as
                                                                                                                                    your workplace

                                                                                                                                      Resources

                                                                                                                                      Videos

                                                                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                      eBooks

                                                                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                      Webinars

                                                                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                      CRM Tips

                                                                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                                                                        Zoho Show Resources