Global Freshworks Platform 3.0 reference app covering every documented serverless pattern and all product events across six modules. Event simulation runs entirely through the FDK test UI — no product UI required for product-event testing.
| Platform | 3.0 global app |
| Primary surface | Event simulator at http://localhost:10001/web/test |
| Optional surface | full_page_app (SMI + Jobs demo) |
| Node | 24.11.1 |
| FDK | 10.1.2 |
This sample registers every serverless event documented for the modules below, with matching handlers in server/server.js and simulation payloads in server/test_data/.
Use it to:
- Simulate events locally — pick a module and event at
/web/test, click Simulate, read[FinSecure]logs in thefdk runterminal. - Learn serverless patterns — SMI, Jobs, scheduled events, external events, and Freshcaller routing automation.
- Validate manifest wiring —
fdk validate+npm testassert every event, handler, and payload file.
Business context for the FinSecure Banking story: usecase.md.
| Pattern | Where | Docs |
|---|---|---|
| App set-up events | onAppInstall, afterAppUpdate, onAppUninstall |
App set-up |
| Scheduled events | $schedule.create/fetch/update/delete on install + SMI |
Scheduled events |
| External events | generateTargetUrl() + onExternalEvent |
External events |
| Server method invocation (SMI) | 5 functions + full-page demo UI | SMI |
| Jobs | bulkTicket job + $job.get/history |
Jobs |
| Routing automation | actions.json Freshcaller IVR callbacks |
Routing automation |
| Module | Events | Count |
|---|---|---|
| Common | onAppInstall, afterAppUpdate, onAppUninstall, onScheduledEvent, onExternalEvent |
5 |
| Support agent | onAgent*, onAgentStatus*, onAgentAvailabilityUpdate, onGroup* |
10 |
| Support company | onCompanyCreate, onCompanyUpdate, onCompanyDelete |
3 |
| Support ticket | onTicket*, onConversation*, onCannedResponse*, onTicketField*, onTimeEntry* |
14 |
| Service ticket | onTicketCreate, onTicketUpdate, onConversationCreate |
3 |
| Chat conversation | onConversation*, onMessageCreate, onAgentActivityCreate |
4 |
| Call | onCallCreate, onCallUpdate |
2 |
| Requirement | Link |
|---|---|
| Node.js 24.x | nodejs.org |
| FDK 10.1.2 | Freshworks CLI setup |
| Chrome (latest) | Required for FDK event simulation |
| Dev account | Freshdesk, Freshservice, and/or Freshcaller depending on modules tested |
Enable global apps before validating:
fdk config set global_apps.enabled truecd usecase+migration/serverless-app-samples
npm install
fdk validate
npm testExpected: 0 platform errors from fdk validate; 49 unit tests pass.
fdk run| URL | Purpose |
|---|---|
| http://localhost:10001/system_settings | Select modules + account URLs |
| http://localhost:10001/custom_configs | Install the app (triggers onAppInstall) |
| http://localhost:10001/web/test | Simulate events and routing actions |
Docs: Test your app
On system settings:
-
Select the modules to test — check all six product modules:
support_agentsupport_companysupport_ticketservice_ticketchat_conversationcall
-
Enter account URLs for each selected module (e.g.
https://<domain>.freshdesk.com). -
For Service ticket, choose product type ITSM or MSP and enter your Freshservice URL.
-
Click Continue, then install at custom configs.
Subscribed modules after install: support_ticket, support_company, support_agent, call, service_ticket, chat_conversation.
Simulation compatibility: Freshdesk · Freshsales · Freshsales Suite · Freshdesk Contact Center · Freshchat · Freshservice · Freshmarketer
Restart
fdk runafter changingmanifest.jsonso new events appear in the dropdown.
Open http://localhost:10001/web/test.
- Select type:
events - Select module from the dropdown (only modules registered in
manifest.jsonand selected in system settings appear) - Select an event — the payload auto-loads from
server/test_data/<module>/ - Click Simulate — button shows Success when the handler runs
- Check the
fdk runterminal for[FinSecure] <eventName>log lines
| Event | Handler | Test payload |
|---|---|---|
onAppInstall |
onAppInstallHandler |
common/onAppInstall.json |
afterAppUpdate |
afterAppUpdateHandler |
common/afterAppUpdate.json |
onAppUninstall |
onAppUninstallHandler |
common/onAppUninstall.json |
onScheduledEvent |
onScheduledEventHandler |
common/onScheduledEvent.json |
onExternalEvent |
onExternalEventHandler |
common/onExternalEvent.json |
onAppInstall creates two schedules ($schedule.create) and an external-event URL (generateTargetUrl()). onAppUninstall deletes both schedules.
| Group | Events |
|---|---|
| onAgent | onAgentCreate, onAgentUpdate, onAgentDelete |
| onAgentStatus | onAgentStatusCreate, onAgentStatusUpdate, onAgentStatusDelete |
| onAgentAvailability | onAgentAvailabilityUpdate |
| onGroup | onGroupCreate, onGroupUpdate, onGroupDelete |
Payloads: server/test_data/support_agent/ · Docs: onAgent · onAgentStatus · onAgentAvailabilityUpdate · onGroup
onCompanyCreate · onCompanyUpdate · onCompanyDelete
Payloads: server/test_data/support_company/ · Docs: onCompany
| Group | Events |
|---|---|
| onTicket | onTicketCreate, onTicketUpdate, onTicketDelete |
| onConversation | onConversationCreate, onConversationUpdate, onConversationDelete |
| onCannedResponse | onCannedResponseCreate, onCannedResponseUpdate, onCannedResponseDelete |
| onTicketField | onTicketFieldCreate, onTicketFieldDelete |
| onTimeEntry | onTimeEntryCreate, onTimeEntryUpdate, onTimeEntryDelete |
Payloads: server/test_data/support_ticket/ · Docs: Product events
onTicketUpdateis not fired when an agent replies — those triggeronConversationCreate/onConversationUpdate.
onTicketCreate · onTicketUpdate · onConversationCreate
Payloads: server/test_data/service_ticket/ · Docs: onTicket · onConversation
Freshservice payloads include ITSM fields such as urgency (tickets) and ticket_workspace_id (conversations).
onConversationCreate · onConversationUpdate · onMessageCreate · onAgentActivityCreate
Payloads: server/test_data/chat_conversation/ · Docs: onConversation · onMessageCreate · onAgentActivityCreate
Chat
onConversation*handlers (onChatConversation*Callback) are separate from Freshdesk ticket conversation handlers because payloads differ.
onCallCreate · onCallUpdate
Payloads: server/test_data/call/ · Docs: onCall
Local simulation does not mutate real product data. Publish as a custom app to verify live triggers.
- Open http://localhost:10001/web/test.
- Select type:
actions. - Choose validateUserMultipleDigits or validateIncomingCaller.
- Edit the payload if needed (defaults in
server/test_data/actions/). - Click Simulate — expect Success when
renderData(null, { data: { response: … } })returns.
| Input | Expected response |
|---|---|
{ "input": "11" } |
response: "valid" (VIP IVR code) |
{ "input": "+15551234567" } |
response: "vip" with app_variables.caller_type |
Docs: Routing automation
The app includes a full-page demo UI for SMI and Jobs — not required for event simulation.
- With
fdk runactive, open Freshdesk dev mode:https://<your-domain>.freshdesk.com/a/?dev=true - Launch FinSecure Serverless Demo from the Apps menu.
- Use the dashboard buttons:
| Button | API |
|---|---|
| Invoke smiEcho | client.request.invoke('smiEcho', …) |
| Fetch schedule | fetchScheduleDetails → $schedule.fetch |
| Update schedule | updateScheduleDemo → $schedule.update |
| Run bulkTicket job | client.job.invoke('bulkTicket', tag, options) |
| Poll latest job | client.job.get(jobId) |
| List job history | listJobHistory → $job.history |
Jobs are not supported for Freshdesk-related modules in production. This sample declares jobs under
commonand exercises them from the full-page app.
smiEcho · fetchScheduleDetails · updateScheduleDemo · getJobDetails · listJobHistory
bulkTicket — uses $job.updateStatusMessage() for progress; no renderData.
| Schedule | Type | Purpose |
|---|---|---|
finsecure_sla_scan |
Recurring (15 min) | SLA breach scan tick |
task_reminder |
One-time | Docs-style task_id reminder |
| API | Where used |
|---|---|
$schedule.create |
onAppInstallHandler |
$schedule.fetch / $schedule.update |
SMI helpers |
$schedule.delete |
onAppUninstallHandler |
generateTargetUrl |
onAppInstallHandler |
renderData |
SMI, app set-up, routing actions |
$job.updateStatusMessage |
bulkTicket job |
client.request.invoke / client.job.invoke |
app/scripts/app.js |
serverless-app-samples/
├── serverless-banner.png # Event simulator overview (this README)
├── actions.json # Freshcaller routing automation
├── manifest.json # All modules, events, SMI, jobs
├── app/
│ ├── index.html # Optional full-page SMI + Jobs demo
│ ├── scripts/app.js
│ ├── styles/style.css
│ └── icon.svg
├── server/
│ ├── server.js # All serverless handlers
│ ├── lib/handle-response.js
│ └── test_data/ # One JSON payload per event
│ ├── common/
│ ├── support_agent/
│ ├── support_company/
│ ├── support_ticket/
│ ├── service_ticket/
│ ├── chat_conversation/
│ ├── call/
│ └── actions/
├── config/iparams.json # Empty — no install fields
├── tests/server.test.js
├── usecase.md
└── README.md
fdk validate # Platform + lint check
fdk run # Local dev server (port 10001)
npm test # Vitest unit tests (49 tests)
fdk pack # Submission package- Confirm the module is checked on system settings.
- Restart
fdk runaftermanifest.jsonchanges.
- Edit the payload JSON — invalid data causes simulation failure.
- Match handler names exactly between
manifest.jsonandserver/server.js.
- Function name must match between
manifest.json→modules.common.functionsandserver/server.js. - Restart
fdk runafter manifest changes.
- Local simulation does not create real schedules in production. Use
onAppInstallduringfdk runfor$schedule.create, or publish as a custom app.
- Ensure
actions.jsoncallback names matchserver/server.jsexports. - Payload must include
"input"string peractions.jsonschema.
- Serverless apps overview
- App set-up events
- Scheduled events
- External events
- Server method invocation
- Configure jobs
- Routing automation
- Support ticket product events
- Service ticket product events
- Support agent product events
- Support company product events
- Chat conversation product events
- Call product events
- Rate limits and constraints
See also usecase.md for FinSecure business scenarios.
