From bb42c4dccb0e72aeb72d9fb3a9080cacdc312176 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 17 Apr 2026 19:29:18 -0700 Subject: [PATCH 1/2] fix(fireflies): support V2 webhook payload format for meetingId mapping Fireflies V2 webhooks use snake_case field names (meeting_id, event, client_reference_id) instead of camelCase (meetingId, eventType, clientReferenceId). The formatInput handler now auto-detects V1 vs V2 payloads and maps fields correctly, fixing empty meetingId on V2 webhooks. Co-Authored-By: Claude Opus 4.6 --- apps/sim/blocks/blocks/fireflies.ts | 4 ++++ apps/sim/lib/webhooks/providers/fireflies.ts | 16 +++++++++++++--- .../triggers/fireflies/transcription_complete.ts | 10 +++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/sim/blocks/blocks/fireflies.ts b/apps/sim/blocks/blocks/fireflies.ts index b98f626f499..a7d045e8925 100644 --- a/apps/sim/blocks/blocks/fireflies.ts +++ b/apps/sim/blocks/blocks/fireflies.ts @@ -595,6 +595,10 @@ Return ONLY the summary text - no quotes, no labels.`, meetingId: { type: 'string', description: 'Meeting/transcript ID from webhook' }, eventType: { type: 'string', description: 'Webhook event type' }, clientReferenceId: { type: 'string', description: 'Custom reference ID if set during upload' }, + timestamp: { + type: 'number', + description: 'Unix timestamp in milliseconds when the event was fired', + }, }, triggers: { enabled: true, diff --git a/apps/sim/lib/webhooks/providers/fireflies.ts b/apps/sim/lib/webhooks/providers/fireflies.ts index f3245d5cd3c..7a2f02d52a8 100644 --- a/apps/sim/lib/webhooks/providers/fireflies.ts +++ b/apps/sim/lib/webhooks/providers/fireflies.ts @@ -45,11 +45,21 @@ function validateFirefliesSignature(secret: string, signature: string, body: str export const firefliesHandler: WebhookProviderHandler = { async formatInput({ body }: FormatInputContext): Promise { const b = body as Record + + // Fireflies V2 webhooks use snake_case field names and "event" instead of "eventType" + const isV2 = typeof b.meeting_id === 'string' || typeof b.event === 'string' + + const meetingId = ((isV2 ? b.meeting_id : b.meetingId) || '') as string + const eventType = ((isV2 ? b.event : b.eventType) || 'Transcription completed') as string + const clientReferenceId = ((isV2 ? b.client_reference_id : b.clientReferenceId) || '') as string + const timestamp = b.timestamp ? Number(b.timestamp) : null + return { input: { - meetingId: (b.meetingId || '') as string, - eventType: (b.eventType || 'Transcription completed') as string, - clientReferenceId: (b.clientReferenceId || '') as string, + meetingId, + eventType, + clientReferenceId, + ...(timestamp !== null ? { timestamp } : {}), }, } }, diff --git a/apps/sim/triggers/fireflies/transcription_complete.ts b/apps/sim/triggers/fireflies/transcription_complete.ts index 37baf533892..49d3e1fe52a 100644 --- a/apps/sim/triggers/fireflies/transcription_complete.ts +++ b/apps/sim/triggers/fireflies/transcription_complete.ts @@ -38,10 +38,10 @@ export const firefliesTranscriptionCompleteTrigger: TriggerConfig = { defaultValue: [ 'Go to app.fireflies.ai/settings', 'Navigate to the Developer settings tab', - 'In the Webhook section, paste the Webhook URL above', + 'In the Webhook or Webhooks V2 section, paste the Webhook URL above', 'Enter a Secret (16-32 characters) and save it here as well', 'Click Save in Fireflies to activate the webhook', - 'Your workflow will now trigger when any meeting transcription completes', + 'Both Webhook V1 and V2 formats are supported automatically', ] .map( (instruction, index) => @@ -59,12 +59,16 @@ export const firefliesTranscriptionCompleteTrigger: TriggerConfig = { }, eventType: { type: 'string', - description: 'The type of event (Transcription completed)', + description: 'The type of event (e.g. Transcription completed, meeting.transcribed)', }, clientReferenceId: { type: 'string', description: 'Custom reference ID if set during upload', }, + timestamp: { + type: 'number', + description: 'Unix timestamp in milliseconds when the event was fired (V2 webhooks)', + }, }, webhook: { From 2586e7dc19123d68e16365ab4cdd148091949309 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 17 Apr 2026 19:38:27 -0700 Subject: [PATCH 2/2] fix(fireflies): guard against NaN timestamp, use stricter V2 detection Address PR review feedback: - Use Number.isFinite guard to prevent NaN timestamp propagation - Use AND instead of OR for V2 detection since both meeting_id and event are required fields in every V2 payload Co-Authored-By: Claude Opus 4.6 --- apps/sim/lib/webhooks/providers/fireflies.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/sim/lib/webhooks/providers/fireflies.ts b/apps/sim/lib/webhooks/providers/fireflies.ts index 7a2f02d52a8..0897a7ff161 100644 --- a/apps/sim/lib/webhooks/providers/fireflies.ts +++ b/apps/sim/lib/webhooks/providers/fireflies.ts @@ -46,13 +46,15 @@ export const firefliesHandler: WebhookProviderHandler = { async formatInput({ body }: FormatInputContext): Promise { const b = body as Record - // Fireflies V2 webhooks use snake_case field names and "event" instead of "eventType" - const isV2 = typeof b.meeting_id === 'string' || typeof b.event === 'string' + // Fireflies V2 webhooks use snake_case field names and "event" instead of "eventType". + // Both meeting_id and event are required in every V2 payload, so AND is the correct check. + const isV2 = typeof b.meeting_id === 'string' && typeof b.event === 'string' const meetingId = ((isV2 ? b.meeting_id : b.meetingId) || '') as string const eventType = ((isV2 ? b.event : b.eventType) || 'Transcription completed') as string const clientReferenceId = ((isV2 ? b.client_reference_id : b.clientReferenceId) || '') as string - const timestamp = b.timestamp ? Number(b.timestamp) : null + const rawTimestamp = b.timestamp != null ? Number(b.timestamp) : null + const timestamp = rawTimestamp !== null && Number.isFinite(rawTimestamp) ? rawTimestamp : null return { input: {