Harivonjy Rica

Zoho8 min read

Zoho Catalyst in production: what the documentation leaves out.

Deploying your first function on Catalyst takes a few minutes. Keeping it running calmly for months takes a few habits. Here are the five I apply on every project.

Catalyst is a handy serverless platform when your systems already revolve around Zoho: functions, database, storage and authentication sit right next to the CRM. That convenience is also the trap. You write code fast, you deploy fast, and the production questions show up later, at the worst possible moment.

01Separate environments from day one

Catalyst gives you a development environment and a production environment. Use both for real: every change goes through development first, with test data, before it gets promoted.

  • Never test on real data. A webhook wired to the production CRM by mistake can change hundreds of records.
  • One configuration per environment, and no hardcoded value that points to production.
  • A dedicated service account for each integration, with only the permissions it needs.

02Idempotent functions

A webhook can arrive twice. A function can fail halfway through and get retried. If your code creates an invoice, a task or an email, it has to give the same result whether it runs once or three times.

// Handle a won deal: safe to replay, no duplicates
export async function onDealWon(event, store) {
  const key = `deal:${event.dealId}:won`
  if (await store.has(key)) return { status: 'ignored' }

  await createInvoice(event)
  await store.put(key, Date.now())
  return { status: 'done' }
}

Build the idempotency key from the business identifier (the deal, in this case), and not from a technical ID generated on each call. Store it in a dedicated table in the Catalyst database along with the processing date, so it doubles as a log.

Remember

Before you write a function, ask yourself: "what happens if it runs twice?" If the answer worries you, add an idempotency key.

03Secrets and configuration

API tokens, webhook signing keys, third-party credentials: none of this belongs in the Git repository. Put them in each function's environment variables, and verify the signature of incoming webhooks before doing anything else.

  • A different secret for each environment.
  • Scheduled, documented rotation of sensitive tokens.
  • Secret scanning in CI to catch a leak before the merge.

04Log so you can diagnose

When a salesperson tells you that "an invoice didn't go out", you should be able to find out what happened in two minutes. Log every important step with the related business ID, and never write personal data or secrets to the logs.

log('invoice.created', { dealId, invoiceId, durationMs })
log('invoice.skipped', { dealId, reason: 'already-processed' })

Short, structured messages are easy to filter in the Catalyst console logs, and easy to hook up to an alert the day you need one.

05Deploy from CI, not from a laptop

The Catalyst CLI lets you deploy from any machine. That's handy in development and risky in production, because sooner or later someone deploys a local version that was never committed. Make the CI pipeline the only way into production.

# Pipeline steps, in order
- lint and type checks
- tests, unit and integration (test data)
- scan dependencies and secrets
- deploy to development, then promote to production after approval

06My takeaways

None of these habits are specific to Catalyst. They are the basics of any serverless platform, but being so close to the CRM makes mistakes more visible and more expensive. With separate environments, functions you can replay, protected secrets, useful logs and automated deployment, Catalyst handles production well for your Zoho integrations.

Contactreply within 24 h

Got a project in mind?
Let's talk.

Describe what you need in a few lines. I reply within 24 h from Antananarivo (GMT+3).

  • contact.harivonjy@gmail.com
  • +261 34 42 735 90
  • Antananarivo · --:-- EAT