import { AirtableIcon } from '@/components/icons'
import type { TriggerConfig } from '@/triggers/types'
export const airtableWebhookTrigger: TriggerConfig = {
id: 'airtable_webhook',
name: 'Airtable Webhook',
provider: 'airtable',
description:
'Trigger workflow from Airtable record changes like create, update, and delete events (requires Airtable credentials)',
version: '1.0.0',
icon: AirtableIcon,
subBlocks: [
{
id: 'triggerCredentials',
title: 'Credentials',
type: 'oauth-input',
description: 'This trigger requires airtable credentials to access your account.',
serviceId: 'airtable',
requiredScopes: [],
required: true,
mode: 'trigger',
},
{
id: 'baseId',
title: 'Base ID',
type: 'short-input',
placeholder: 'appXXXXXXXXXXXXXX',
description: 'The ID of the Airtable Base this webhook will monitor.',
required: true,
mode: 'trigger',
},
{
id: 'tableId',
title: 'Table ID',
type: 'short-input',
placeholder: 'tblXXXXXXXXXXXXXX',
description: 'The ID of the table within the Base that the webhook will monitor.',
required: true,
mode: 'trigger',
},
{
id: 'includeCellValues',
title: 'Include Full Record Data',
type: 'switch',
description: 'Enable to receive the complete record data in the payload, not just changes.',
defaultValue: false,
mode: 'trigger',
},
{
id: 'triggerInstructions',
title: 'Setup Instructions',
hideFromPreview: true,
type: 'text',
defaultValue: [
'Connect your Airtable account using the "Select Airtable credential" button above.',
'Ensure you have provided the correct Base ID and Table ID above.',
'You can find your Base ID and Table ID in the Airtable URL: https://airtable.com/[baseId]/[tableId]/.... See Finding Airtable IDs for details.',
'The webhook will trigger whenever records are created, updated, or deleted in the specified table.',
'Make sure your Airtable account has appropriate permissions for the specified base.',
]
.map(
(instruction, index) =>
`