diff --git a/apps/sim/blocks/blocks/grain.ts b/apps/sim/blocks/blocks/grain.ts
index 01e52e083c..97ea198475 100644
--- a/apps/sim/blocks/blocks/grain.ts
+++ b/apps/sim/blocks/blocks/grain.ts
@@ -2,6 +2,7 @@ import { GrainIcon } from '@/components/icons'
import type { BlockConfig } from '@/blocks/types'
import { AuthMode } from '@/blocks/types'
import { getTrigger } from '@/triggers'
+import { grainTriggerOptions } from '@/triggers/grain/utils'
export const GrainBlock: BlockConfig = {
type: 'grain',
@@ -207,13 +208,21 @@ export const GrainBlock: BlockConfig = {
value: ['grain_delete_hook'],
},
},
- // Trigger SubBlocks
- ...getTrigger('grain_recording_created').subBlocks,
- ...getTrigger('grain_recording_updated').subBlocks,
- ...getTrigger('grain_highlight_created').subBlocks,
- ...getTrigger('grain_highlight_updated').subBlocks,
- ...getTrigger('grain_story_created').subBlocks,
- ...getTrigger('grain_webhook').subBlocks,
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_webhook',
+ required: true,
+ },
+ ...getTrigger('grain_recording_created').subBlocks.slice(1),
+ ...getTrigger('grain_recording_updated').subBlocks.slice(1),
+ ...getTrigger('grain_highlight_created').subBlocks.slice(1),
+ ...getTrigger('grain_highlight_updated').subBlocks.slice(1),
+ ...getTrigger('grain_story_created').subBlocks.slice(1),
+ ...getTrigger('grain_webhook').subBlocks.slice(1),
],
tools: {
access: [
diff --git a/apps/sim/triggers/grain/highlight_created.ts b/apps/sim/triggers/grain/highlight_created.ts
index 12ab02d260..4301187950 100644
--- a/apps/sim/triggers/grain/highlight_created.ts
+++ b/apps/sim/triggers/grain/highlight_created.ts
@@ -1,6 +1,6 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
-import { buildHighlightOutputs, grainSetupInstructions } from './utils'
+import { buildHighlightOutputs, grainSetupInstructions, grainTriggerOptions } from './utils'
export const grainHighlightCreatedTrigger: TriggerConfig = {
id: 'grain_highlight_created',
@@ -11,6 +11,15 @@ export const grainHighlightCreatedTrigger: TriggerConfig = {
icon: GrainIcon,
subBlocks: [
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_highlight_created',
+ required: true,
+ },
{
id: 'apiKey',
title: 'API Key',
@@ -25,42 +34,6 @@ export const grainHighlightCreatedTrigger: TriggerConfig = {
value: 'grain_highlight_created',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_created',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_created',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_created',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',
diff --git a/apps/sim/triggers/grain/highlight_updated.ts b/apps/sim/triggers/grain/highlight_updated.ts
index cf8e771589..e4a3b7eb65 100644
--- a/apps/sim/triggers/grain/highlight_updated.ts
+++ b/apps/sim/triggers/grain/highlight_updated.ts
@@ -1,6 +1,6 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
-import { buildHighlightOutputs, grainSetupInstructions } from './utils'
+import { buildHighlightOutputs, grainSetupInstructions, grainTriggerOptions } from './utils'
export const grainHighlightUpdatedTrigger: TriggerConfig = {
id: 'grain_highlight_updated',
@@ -11,6 +11,15 @@ export const grainHighlightUpdatedTrigger: TriggerConfig = {
icon: GrainIcon,
subBlocks: [
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_highlight_updated',
+ required: true,
+ },
{
id: 'apiKey',
title: 'API Key',
@@ -25,42 +34,6 @@ export const grainHighlightUpdatedTrigger: TriggerConfig = {
value: 'grain_highlight_updated',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_updated',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_updated',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_highlight_updated',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',
diff --git a/apps/sim/triggers/grain/recording_created.ts b/apps/sim/triggers/grain/recording_created.ts
index 4085f0c751..6877ee6993 100644
--- a/apps/sim/triggers/grain/recording_created.ts
+++ b/apps/sim/triggers/grain/recording_created.ts
@@ -1,6 +1,6 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
-import { buildRecordingOutputs, grainSetupInstructions } from './utils'
+import { buildRecordingOutputs, grainSetupInstructions, grainTriggerOptions } from './utils'
export const grainRecordingCreatedTrigger: TriggerConfig = {
id: 'grain_recording_created',
@@ -11,6 +11,15 @@ export const grainRecordingCreatedTrigger: TriggerConfig = {
icon: GrainIcon,
subBlocks: [
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_recording_created',
+ required: true,
+ },
{
id: 'apiKey',
title: 'API Key',
@@ -25,42 +34,6 @@ export const grainRecordingCreatedTrigger: TriggerConfig = {
value: 'grain_recording_created',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_created',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_created',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_created',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',
diff --git a/apps/sim/triggers/grain/recording_updated.ts b/apps/sim/triggers/grain/recording_updated.ts
index 799424f2e2..1e3130371f 100644
--- a/apps/sim/triggers/grain/recording_updated.ts
+++ b/apps/sim/triggers/grain/recording_updated.ts
@@ -1,6 +1,6 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
-import { buildRecordingOutputs, grainSetupInstructions } from './utils'
+import { buildRecordingOutputs, grainSetupInstructions, grainTriggerOptions } from './utils'
export const grainRecordingUpdatedTrigger: TriggerConfig = {
id: 'grain_recording_updated',
@@ -11,6 +11,15 @@ export const grainRecordingUpdatedTrigger: TriggerConfig = {
icon: GrainIcon,
subBlocks: [
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_recording_updated',
+ required: true,
+ },
{
id: 'apiKey',
title: 'API Key',
@@ -25,42 +34,6 @@ export const grainRecordingUpdatedTrigger: TriggerConfig = {
value: 'grain_recording_updated',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_updated',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_updated',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_recording_updated',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',
diff --git a/apps/sim/triggers/grain/story_created.ts b/apps/sim/triggers/grain/story_created.ts
index e9b7306b83..f3250e5fab 100644
--- a/apps/sim/triggers/grain/story_created.ts
+++ b/apps/sim/triggers/grain/story_created.ts
@@ -1,6 +1,6 @@
import { GrainIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
-import { buildStoryOutputs, grainSetupInstructions } from './utils'
+import { buildStoryOutputs, grainSetupInstructions, grainTriggerOptions } from './utils'
export const grainStoryCreatedTrigger: TriggerConfig = {
id: 'grain_story_created',
@@ -11,6 +11,15 @@ export const grainStoryCreatedTrigger: TriggerConfig = {
icon: GrainIcon,
subBlocks: [
+ {
+ id: 'selectedTriggerId',
+ title: 'Trigger Type',
+ type: 'dropdown',
+ mode: 'trigger',
+ options: grainTriggerOptions,
+ value: () => 'grain_story_created',
+ required: true,
+ },
{
id: 'apiKey',
title: 'API Key',
@@ -25,42 +34,6 @@ export const grainStoryCreatedTrigger: TriggerConfig = {
value: 'grain_story_created',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_story_created',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_story_created',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_story_created',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',
diff --git a/apps/sim/triggers/grain/utils.ts b/apps/sim/triggers/grain/utils.ts
index 3c77dd026f..1d371f9cbb 100644
--- a/apps/sim/triggers/grain/utils.ts
+++ b/apps/sim/triggers/grain/utils.ts
@@ -19,7 +19,6 @@ export function grainSetupInstructions(eventType: string): string {
const instructions = [
'Enter your Grain API Key (Personal Access Token) above.',
'You can find or create your API key in Grain at Settings > Integrations > API.',
- 'Optionally configure filters to narrow which recordings trigger the webhook.',
`Click "Save Configuration" to automatically create the webhook in Grain for ${eventType} events.`,
'The webhook will be automatically deleted when you remove this trigger.',
]
@@ -40,75 +39,61 @@ export function buildRecordingOutputs(): Record {
return {
type: {
type: 'string',
- description: 'Event type (recording_added)',
+ description: 'Event type',
},
user_id: {
type: 'string',
description: 'User UUID who triggered the event',
},
data: {
- type: 'object',
- description: 'Recording data object',
- },
- 'data.id': {
- type: 'string',
- description: 'Recording UUID',
- },
- 'data.title': {
- type: 'string',
- description: 'Recording title',
- },
- 'data.start_datetime': {
- type: 'string',
- description: 'ISO8601 start timestamp',
- },
- 'data.end_datetime': {
- type: 'string',
- description: 'ISO8601 end timestamp',
- },
- 'data.duration_ms': {
- type: 'number',
- description: 'Duration in milliseconds',
- },
- 'data.media_type': {
- type: 'string',
- description: 'audio, transcript, or video',
- },
- 'data.source': {
- type: 'string',
- description: 'Recording source (zoom, meet, teams, etc.)',
- },
- 'data.url': {
- type: 'string',
- description: 'URL to view in Grain',
- },
- 'data.thumbnail_url': {
- type: 'string',
- description: 'Thumbnail URL (nullable)',
- },
- 'data.tags': {
- type: 'array',
- description: 'Array of tag strings',
- },
- 'data.teams': {
- type: 'array',
- description: 'Teams the recording belongs to',
- },
- 'data.meeting_type': {
- type: 'object',
- description: 'Meeting type info (nullable)',
- },
- 'data.highlights': {
- type: 'array',
- description: 'Highlights (if configured in hook)',
- },
- 'data.participants': {
- type: 'array',
- description: 'Participants (if configured in hook)',
- },
- 'data.ai_summary': {
- type: 'object',
- description: 'AI summary (if configured in hook)',
+ id: {
+ type: 'string',
+ description: 'Recording UUID',
+ },
+ title: {
+ type: 'string',
+ description: 'Recording title',
+ },
+ start_datetime: {
+ type: 'string',
+ description: 'ISO8601 start timestamp',
+ },
+ end_datetime: {
+ type: 'string',
+ description: 'ISO8601 end timestamp',
+ },
+ duration_ms: {
+ type: 'number',
+ description: 'Duration in milliseconds',
+ },
+ media_type: {
+ type: 'string',
+ description: 'audio, transcript, or video',
+ },
+ source: {
+ type: 'string',
+ description: 'Recording source (zoom, meet, local_capture, etc.)',
+ },
+ url: {
+ type: 'string',
+ description: 'URL to view in Grain',
+ },
+ thumbnail_url: {
+ type: 'string',
+ description: 'Thumbnail URL (nullable)',
+ },
+ tags: {
+ type: 'array',
+ description: 'Array of tag strings',
+ },
+ teams: {
+ type: 'array',
+ description: 'Array of team objects',
+ },
+ meeting_type: {
+ type: 'object',
+ description: 'Meeting type info with id, name, scope (nullable)',
+ },
},
} as Record
}
@@ -128,52 +113,50 @@ export function buildHighlightOutputs(): Record {
description: 'User UUID who triggered the event',
},
data: {
- type: 'object',
- description: 'Highlight data object',
- },
- 'data.id': {
- type: 'string',
- description: 'Highlight UUID',
- },
- 'data.recording_id': {
- type: 'string',
- description: 'Parent recording UUID',
- },
- 'data.text': {
- type: 'string',
- description: 'Highlight title/description',
- },
- 'data.transcript': {
- type: 'string',
- description: 'Transcript text of the clip',
- },
- 'data.speakers': {
- type: 'array',
- description: 'Array of speaker names',
- },
- 'data.timestamp': {
- type: 'number',
- description: 'Start timestamp in ms',
- },
- 'data.duration': {
- type: 'number',
- description: 'Duration in ms',
- },
- 'data.tags': {
- type: 'array',
- description: 'Array of tag strings',
- },
- 'data.url': {
- type: 'string',
- description: 'URL to view in Grain',
- },
- 'data.thumbnail_url': {
- type: 'string',
- description: 'Thumbnail URL',
- },
- 'data.created_datetime': {
- type: 'string',
- description: 'ISO8601 creation timestamp',
+ id: {
+ type: 'string',
+ description: 'Highlight UUID',
+ },
+ recording_id: {
+ type: 'string',
+ description: 'Parent recording UUID',
+ },
+ text: {
+ type: 'string',
+ description: 'Highlight title/description',
+ },
+ transcript: {
+ type: 'string',
+ description: 'Transcript text of the clip',
+ },
+ speakers: {
+ type: 'array',
+ description: 'Array of speaker names',
+ },
+ timestamp: {
+ type: 'number',
+ description: 'Start timestamp in ms',
+ },
+ duration: {
+ type: 'number',
+ description: 'Duration in ms',
+ },
+ tags: {
+ type: 'array',
+ description: 'Array of tag strings',
+ },
+ url: {
+ type: 'string',
+ description: 'URL to view in Grain',
+ },
+ thumbnail_url: {
+ type: 'string',
+ description: 'Thumbnail URL',
+ },
+ created_datetime: {
+ type: 'string',
+ description: 'ISO8601 creation timestamp',
+ },
},
} as Record
}
@@ -193,24 +176,22 @@ export function buildStoryOutputs(): Record {
description: 'User UUID who triggered the event',
},
data: {
- type: 'object',
- description: 'Story data object',
- },
- 'data.id': {
- type: 'string',
- description: 'Story UUID',
- },
- 'data.title': {
- type: 'string',
- description: 'Story title',
- },
- 'data.url': {
- type: 'string',
- description: 'URL to view in Grain',
- },
- 'data.created_datetime': {
- type: 'string',
- description: 'ISO8601 creation timestamp',
+ id: {
+ type: 'string',
+ description: 'Story UUID',
+ },
+ title: {
+ type: 'string',
+ description: 'Story title',
+ },
+ url: {
+ type: 'string',
+ description: 'URL to view in Grain',
+ },
+ created_datetime: {
+ type: 'string',
+ description: 'ISO8601 creation timestamp',
+ },
},
} as Record
}
diff --git a/apps/sim/triggers/grain/webhook.ts b/apps/sim/triggers/grain/webhook.ts
index 88f968682c..d41f21433a 100644
--- a/apps/sim/triggers/grain/webhook.ts
+++ b/apps/sim/triggers/grain/webhook.ts
@@ -34,42 +34,6 @@ export const grainWebhookTrigger: TriggerConfig = {
value: 'grain_webhook',
},
},
- {
- id: 'includeHighlights',
- title: 'Include Highlights',
- type: 'switch',
- description: 'Include highlights/clips in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_webhook',
- },
- },
- {
- id: 'includeParticipants',
- title: 'Include Participants',
- type: 'switch',
- description: 'Include participant list in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_webhook',
- },
- },
- {
- id: 'includeAiSummary',
- title: 'Include AI Summary',
- type: 'switch',
- description: 'Include AI-generated summary in webhook payload.',
- defaultValue: false,
- mode: 'trigger',
- condition: {
- field: 'selectedTriggerId',
- value: 'grain_webhook',
- },
- },
{
id: 'triggerInstructions',
title: 'Setup Instructions',