Zoho CRM Workflow Automation: Activate & Deactivate Workflows Using API

Zoho CRM Workflow Automation: Activate & Deactivate Workflows Using API

Zoho has now enabled:
โœ… Activate / Deactivate workflows using API
โœ… Schedule workflow activation & deactivation
This is extremely useful for real-world automation use cases ๐Ÿ’ก

๐Ÿงฉ My Use Case

I created a scheduled automation that:
โ˜€๏ธ Activates workflows in the morning
๐ŸŒ™ Deactivates workflows in the evening

This gives full control over when workflows should run โ€” something Iโ€™ve needed for months, and now I finally have the right path! ๐Ÿ™Œ

๐Ÿง‘โ€๐Ÿ’ป Sample Deluge Code
Below is the code Iโ€™m using to deactivate multiple workflow rules via API (can be scheduled easily):

workflowIds = List();
workflowIds.add("3719371000359745649");
workflowIds.add("3719371000359745731");
workflowIds.add("3719371000359745797");
workflowIds.add("3719371000364951166");
for each workflowId in workflowIds
{
workflowRulesList = List();
workflowRule = Map();
workflowRule.put("id", workflowId);
statusMap = Map();
statusMap.put("active", false); // set true to activate
statusMap.put("delete_schedule_action", false);
workflowRule.put("status", statusMap);
workflowRulesList.add(workflowRule);
finalMap = Map();
finalMap.put("workflow_rules", workflowRulesList);
WorkflowUpdate = invokeurl
[
type :PUT
parameters: finalMap.toString()
connection:"newcrm"
];
info WorkflowUpdate;
}

๐Ÿš€ Why This Matters
Better control over automations
Cleaner business logic
Perfect for time-based workflow management

Thanks
Saurav Nigota
Zoho Certified Developer || Shuraa Business Setup