Zoho Desk Workflow Functions: Significant Gaps Around Ticket Comments and Authentication

Zoho Desk Workflow Functions: Significant Gaps Around Ticket Comments and Authentication

Yes - I used AI to summarize my last two days of trying to make this work with Workflows/Custom functions and Zoho Flow before that.


Zoho Desk Workflow Functions: Significant Gaps Around Ticket Comments and Authentication

We've been building an AI-assisted support workflow in Zoho Desk and wanted to share our findings after several days of implementation and debugging.

Goal

Our use case is straightforward:

  1. Ticket is created
  2. Workflow triggers a Custom Function
  3. Function sends Subject + Description to an AI service
  4. AI returns a draft response
  5. Function creates a private/internal ticket comment containing the AI-generated response

Steps 1-4 worked successfully.

Step 5 became unexpectedly difficult.


What Works Well

Workflow Argument Mapping

Passing fields directly into the function works well:

  • Ticket ID
  • Subject
  • Description - note that FREQUENTLY the description returned from the API is null, even though it's not empty in the ticket.

This is much cleaner than retrieving the ticket again via API.

External API Calls

Calling external services from Workflow Functions works well.

Example:

response = invokeurl
[
url :"https://..."
type :POST
parameters:payload.toString()
];

We were able to successfully call an AI service and process the response.

Native Ticket Updates

Native functions such as:

zoho.desk.update(...)

work cleanly and appear to operate within the current workflow context without requiring additional authentication.


Problems We Encountered

1. No Obvious Native Method to Add Ticket Comments

The most obvious function:

zoho.desk.addComment(...)

does not exist in our Workflow Function runtime.

Error:

Not able to find 'addComment' function


2. REST API Comment Creation Requires Authentication

Using:

POST /api/v1/tickets/{ticketId}/comments

works in Postman.

However from a Workflow Function we received:

{
"errorCode":"UNAUTHORIZED",
"message":"You are not authenticated to perform this operation."
}

even though we are already running inside Zoho Desk.


3. Connection Behavior is Inconsistent

A connection that works perfectly during:

Execute Function

may fail during:

Workflow execution

For example:

{
"error":"UnAuthenticated Connection: safdesk"
}

The distinction between:

  • User Context
  • Function Test Context
  • Workflow Runtime Context

is not clearly documented.


4. System Connections Are Difficult to Use

Even after creating a valid system connection:

Credentials of Login User = No
Status = Connected

the Deluge editor reported:

Connection '<name>' does not exist

There appears to be a disconnect between available system connections and what Workflow Functions can actually reference.


5. Documentation Does Not Match Runtime Capabilities

Several examples and APIs are documented, but either:

  • are unavailable in Workflow Functions
  • exist only in other Zoho runtimes
  • have different signatures

The autocomplete list in the actual editor was often more reliable than the documentation.


6. Comment Module Support is Unclear

Functions such as:

zoho.desk.createRelatedRecord(...)

exist.

However there does not appear to be a documented way to create a ticket comment using native Deluge methods.

Attempts using:

"comments"

as a module resulted in validation errors.


Suggested Improvements

High Priority

Add a Native Comment Function

Something as simple as:

zoho.desk.addComment(
orgId,
ticketId,
commentMap
);

would eliminate a huge amount of complexity.


Allow Workflow Functions to Use Desk Context

If a Workflow Function is already executing inside Zoho Desk, it should be able to:

POST /tickets/{ticketId}/comments

without requiring separate OAuth authentication.


Improve Connection Visibility

Provide:

  • Connection test button
  • Runtime connection validation
  • Clear indication of whether a connection works in:
    • Function Testing
    • Workflows
    • Extensions

Documentation Improvements

Provide a specific section covering:

Zoho Desk Workflow Functions

including:

  • supported native methods
  • unsupported methods
  • runtime differences
  • authentication behavior
  • comment creation examples

Business Impact

AI-assisted support workflows are becoming extremely common.

Today it is relatively easy to:

  • Call an AI service
  • Generate a response

But surprisingly difficult to:

  • Create an internal ticket comment containing that response

A native, documented comment API for Workflow Functions would unlock a large class of AI-assisted support automations with significantly less effort.


Has anyone successfully created an internal ticket comment from a Zoho Desk Workflow Function using only native Deluge methods? If so, we'd love to see a working example.