Deluge is Zoho’s scripting language for custom functions, and it fills the gaps that point-and-click workflows cannot. The 10 Zoho Deluge examples below, from duplicate checks to auto-created Zoho Books invoices and inbound webhooks, typically take 2–16 hours each for an experienced developer to build and test.
Each example includes the trigger, the core Deluge tasks and a short snippet you can adapt. They are written for Zoho CRM, but the same patterns work in Zoho Books, Desk and Creator with small changes to the integration tasks.
Key takeaways
- Use Deluge when workflows run out: cross-module updates, calculations, external APIs and multi-app actions all need a custom function.
- Five tasks do most of the work: getRecordById, searchRecords, createRecord, updateRecord and invokeurl.
- Connections keep scripts secure: authenticate to Zoho apps and third-party APIs with named connections, not hard-coded tokens.
- Respect the limits: Zoho CRM functions have execution-time and daily call limits, so bulk jobs need batching or schedules.
What is Zoho Deluge and when should you use it?
Deluge (Data Enriched Language for the Universal Grid Environment) is a low-code scripting language built into Zoho apps. In Zoho CRM you use it for custom functions triggered by workflow rules, Blueprint transitions, buttons, schedules or REST API calls. See the official introduction to Deluge for syntax basics.
Use native workflow rules first. Reach for Deluge when you need logic a field update cannot express, or data from another module or system. Our guide to what you can build on Zoho’s low-code platform explains where Deluge fits alongside Creator apps.
- Update related records, such as rolling deal values up to an account
- Run calculations or rules that formula fields cannot handle
- Call external APIs for enrichment, messaging or ERP updates
- Create records in other Zoho apps, such as Books, Projects or Desk
- Receive data from outside systems through a function exposed as an API
Which 10 Deluge automations are worth building first?
These are the automations that come up most in Zoho CRM projects. Each one removes a manual step that reps or admins would otherwise repeat daily.
| Automation | Trigger | Key Deluge task | Typical effort |
|---|---|---|---|
| Duplicate lead check | Lead created | searchRecords | 2–4 hours |
| Stage-based tasks | Deal stage change | createRecord | 2–3 hours |
| Won deal to Books invoice | Deal won | zoho.books.createRecord | 6–12 hours |
| Account revenue roll-up | Deal edited | getRelatedRecords | 3–5 hours |
| Inbound lead webhook | External POST | Function as REST API | 6–16 hours |
How do you stop duplicates and route leads with Deluge?
1. Duplicate check on new leads
Native duplicate rules block exact matches, but they cannot check a lead against existing contacts and then tag or merge it. A workflow on lead creation passes the lead ID to this function. Snippet: lead = zoho.crm.getRecordById("Leads", leadId); found = zoho.crm.searchRecords("Contacts", "(Email:equals:" + lead.get("Email") + ")"); if(found.size() > 0) { zoho.crm.updateRecord("Leads", leadId, {"Lead_Status":"Existing Contact"}); }
2. Rule-based lead assignment
Assignment rules handle simple criteria. Deluge handles rules like “route by country, then by product line, then to whoever has the fewest open leads”. The function counts open leads per rep with searchRecords and writes the chosen user ID to the Owner field with updateRecord.
3. Lead enrichment from an external API
Call an enrichment or company-data API when a lead arrives and fill industry, size or location. Snippet: resp = invokeurl [ url: enrichUrl + domain type: GET connection: "enrichment_api" ]; zoho.crm.updateRecord("Leads", leadId, {"Industry": resp.get("industry")});
How can Deluge automate deal follow-up and reporting?
4. Stage-based task creation
When a deal moves to Proposal, create a follow-up task three days later linked to the deal. Snippet: task = {"Subject":"Follow up on proposal", "Due_Date": today.addDay(3), "What_Id": dealId, "$se_module":"Deals", "Owner": ownerId}; zoho.crm.createRecord("Tasks", task);
5. Account revenue roll-up
Rollup summary fields cover simple totals in some editions, but conditional or multi-currency roll-ups need code. This function sums won deals and writes the total to a custom field. Snippet: deals = zoho.crm.getRelatedRecords("Deals", "Accounts", accountId); total = 0; for each d in deals { if(d.get("Stage") == "Closed Won") { total = total + d.get("Amount"); } } zoho.crm.updateRecord("Accounts", accountId, {"Won_Revenue": total});
6. Nightly stale-deal alerts
A scheduled function runs each night, searches for open deals with no activity in 14 days and sends each owner one summary email with sendmail. Schedules are the right home for bulk jobs because they run outside user actions.
If you are deciding between a scripted rule and an enforced process, read our comparison of Zoho CRM Blueprint vs workflow automation. Blueprint transitions can also call Deluge functions.
How does Deluge connect Zoho CRM to other Zoho apps?
7. Won deal to Zoho Books invoice
When a deal is won, find or create the customer in Zoho Books, then create a draft invoice with the deal’s products. Snippet: inv = {"customer_id": booksCustomerId, "line_items": lineItems}; res = zoho.books.createRecord("invoices", orgId, inv, "books_connection"); The Books invoice ID is written back to the deal so finance and sales see the same status.
8. Deal to Zoho Projects kickoff
A button on the deal creates a project from a template, adds the account manager and posts the scope from deal fields. This removes the handover email that usually loses details between sales and delivery.
For cross-app flows with many steps or non-Zoho tools, Zoho Flow may be simpler to maintain than code. See how to automate cross-app workflows with Zoho Flow.
How does Deluge handle webhooks and external systems?
9. Function as an inbound webhook
Zoho CRM lets you expose a standalone function as a REST API with an API key or OAuth. Websites, landing pages, portals or ecommerce stores can POST leads straight into it, and the function validates, deduplicates and creates the record in one step.
10. WhatsApp or SMS notifications through a provider API
On a stage change, call your messaging provider with invokeurl to send an approved template, such as a site-visit confirmation. Store the provider’s message ID on the record so replies can be matched later.
Careful matching logic is what keeps a two-way sync free of duplicates, as shown in our duplicate-safe Apollo.io and Zoho CRM integration case study. For store and ERP connections, see integrating Zoho with Shopify, WooCommerce and ERPs.
What are the best practices and limits for Deluge scripts?
Deluge is forgiving to write but easy to break at scale. Zoho publishes Deluge function limits for Zoho CRM, including a one-minute execution time per function, plus general Deluge limitations on statements, emails and webhook calls.
- Use named connections for every Zoho and external API call; never paste tokens into code.
- Pass record IDs as arguments and fetch fresh data inside the function.
- Check responses before updating records, and log failures with info statements or a log module.
- Batch bulk work in schedules and paginate searches instead of looping over thousands of records.
- Test in a sandbox where your edition supports it, and document each function’s trigger and owner.
Custom code also needs owners after go-live. A managed Zoho support plan should cover monitoring failed functions and updating scripts when Zoho changes APIs.
Should you build Deluge automations yourself or hire a developer?
Simple functions, such as creating a task or updating a field, are a good way for admins to learn Deluge. Anything that writes to finance data, talks to external APIs or runs on thousands of records deserves a developer and a test plan.
If your requirement is closer to a full application than a script, compare options in our guide to building in Zoho Creator vs buying software.
Why choose Amwhiz for Zoho Deluge development?
Amwhiz is a Zoho Authorized Partner with in-house developers who write, test and maintain Deluge functions across Zoho CRM, Books, Desk and Creator. We start with native automation, script only what needs code, use secure connections for every integration and hand over documentation your admins can follow. Because we also build Shopify, WhatsApp and custom API integrations, your Zoho functions can talk to the rest of your stack.
Have a Zoho process that workflows cannot handle? Share it with Amwhiz’s Zoho development team and get a scoped Deluge estimate.
Talk to a Zoho expert
Book a free 30-minute call with our Zoho team to review your setup and the fastest path to go-live.
Book a free consultationFrequently asked questions
What is Deluge in Zoho?
Deluge is Zoho’s built-in scripting language. It powers custom functions in Zoho CRM, Books, Desk, Creator and other apps, letting you automate logic that standard workflows cannot handle.
Is Deluge hard to learn?
The basics are approachable for admins with some logic or spreadsheet formula experience. Integrations, error handling and bulk processing take more experience to get right.
Can Deluge call external APIs?
Yes. The invokeurl task sends GET, POST, PUT and other requests to external APIs, ideally through a named connection that stores authentication securely.
Where do Deluge functions run in Zoho CRM?
Functions can be triggered by workflow rules, Blueprint transitions, buttons, schedules and related-list actions. Standalone functions can also be exposed as REST APIs for other systems to call.
Are there limits on Deluge custom functions?
Yes. Zoho sets limits on execution time, statements executed, emails sent and webhook calls, and some limits vary by product and edition. Bulk jobs should be batched and scheduled.