How to connect
What syncs
- Accounts — your Vitally accounts appear in Zudo with name, MRR, and other standard fields
- Account traits — choose which custom traits to import in the connection settings under Custom Account Traits
- Custom objects — additional Vitally data associated with accounts
Webhook automations
Webhook actions let you run custom JavaScript when a Vitally Playbook fires. Use them to automatically update account traits based on events — like advancing a renewal date when a subscription renews, or stamping a trait with today’s date when a Playbook condition is met.Setting up a webhook action
Create the action in Zudo
Go to Settings → Connections, expand your Vitally connection, and find the Playbook Webhook Actions section. Click + Add Action.Fill in:
- Name — a descriptive label (e.g., “Auto-Renewal Handler”)
- Description — optional, what the action does
- JavaScript code — your automation logic (see examples below)
- Enabled — toggle to activate or pause the action
Copy the webhook URL
Each action gets a unique URL. Click the copy button on the action card to copy it.
The JavaScript sandbox
Your code runs in a secure sandbox. Two variables are available:account — the full Vitally account fetched fresh from the API at the time of the webhook call. Access traits via account.traits:
payload — the raw webhook payload sent by Vitally. Note that traits appear at the top level of payload.match.account, not nested under .traits:
Use
account.traits when you need the most up-to-date values. Use payload.match.account when you need the trait values at the moment the Playbook was triggered.Helper functions
The sandbox includes built-in helpers so you don’t need to write date math from scratch.Date helpers
| Function | What it does | Example |
|---|---|---|
addMonths(date, months) | Add months to a date | addMonths("2026-01-31", 1) → "2026-02-28" |
addDays(date, days) | Add days to a date | addDays("2026-01-15", 30) → "2026-02-14" |
addYears(date, years) | Add years to a date | addYears("2026-01-15", 1) → "2027-01-15" |
today() | Today’s date as an ISO string | today() → "2026-02-04" |
now() | Current datetime as an ISO string | now() → "2026-02-04T12:30:45.123Z" |
parseDate(date) | Parse any date string to ISO format | parseDate("Jan 15, 2026") → "2026-01-15" |
isPast(date) | Check if a date is in the past | isPast("2025-01-01") → true |
isFuture(date) | Check if a date is in the future | isFuture("2027-01-01") → true |
diffDays(date1, date2) | Days between two dates | diffDays("2026-01-01", "2026-01-15") → 14 |
Interval helpers
| Function | What it does | Example |
|---|---|---|
intervalToMonths(interval) | Convert an interval name to a number of months | intervalToMonths("annual") → 12 |
addInterval(date, interval) | Add a named interval to a date | addInterval("2026-01-15", "annual") → "2027-01-15" |
monthly, month to month, quarterly, semi-annual, semiannual, bi-annual, annual, yearly, biennial, 2-year, triennial, 3-year.
Return format
Return{ traits: { key: value } } to update traits on the account in Vitally. Return null to skip the update for this trigger.
Code examples
Auto-renewal: calculate next expiration date
Set a date trait to today
Conditional update
Common errors
| Error | Cause | Fix |
|---|---|---|
Webhook action not found | The URL token doesn’t match any action | Check that you copied the correct webhook URL |
Action is disabled | The action is toggled off | Enable the action in Settings → Connections |
Connection is disabled | The Vitally connection itself is disabled | Re-enable the Vitally connection |
Missing account in payload | Vitally sent a malformed webhook | Check your Playbook’s webhook configuration in Vitally |
Execution timed out | Your code took longer than 5 seconds | Simplify your code and remove any loops |
Invalid date: ... | A bad date value was passed to a helper | Check that your date traits contain valid date strings |
Security
- Code runs in an isolated sandbox with no access to the filesystem, network, or external modules
- Input objects (
accountandpayload) are read-only - Execution times out after 5 seconds
- Each action has a unique URL token; regenerate it by deleting and recreating the action
