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..0897a7ff161 100644 --- a/apps/sim/lib/webhooks/providers/fireflies.ts +++ b/apps/sim/lib/webhooks/providers/fireflies.ts @@ -45,11 +45,23 @@ 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". + // 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 rawTimestamp = b.timestamp != null ? Number(b.timestamp) : null + const timestamp = rawTimestamp !== null && Number.isFinite(rawTimestamp) ? rawTimestamp : 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: {