Skip to content

Latest commit

 

History

History
273 lines (174 loc) · 7.17 KB

File metadata and controls

273 lines (174 loc) · 7.17 KB
title Trigger Registry
description Trigger Registry protocol schemas

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}

Trigger Registry Protocol

Lightweight automation triggers for simple integrations.

Inspired by Zapier, n8n, and Workato connector architectures.

When to use Trigger Registry vs. Integration Connector?

Use [automation/trigger-registry.zod.ts](/docs/references/automation/trigger-registry) when:

  • Building simple automation triggers (e.g., "when Slack message received, create task")

  • No complex authentication needed (simple API keys, basic auth)

  • Lightweight, single-purpose integrations

  • Quick setup with minimal configuration

  • Webhook-based or polling triggers for automation workflows

Use [integration/connector.zod.ts](/docs/references/integration/connector) when:

  • Building enterprise-grade connectors (e.g., Salesforce, SAP, Oracle)

  • Complex OAuth2/SAML authentication required

  • Bidirectional sync with field mapping and transformations

  • Webhook management and rate limiting required

  • Full CRUD operations and data synchronization

Use Cases

  1. Simple Automation Triggers
  • Slack notifications on record updates

  • Twilio SMS on workflow events

  • SendGrid email templates

  1. Lightweight Operations
  • Single-action integrations (send, notify, log)

  • No bidirectional sync required

  • Webhook receivers for incoming events

  1. Quick Integrations
  • Payment webhooks (Stripe, PayPal)

  • Communication triggers (Twilio, SendGrid, Slack)

  • Simple API calls to third-party services

See also: https://zapier.com/developer/documentation/v2/

See also: https://docs.n8n.io/integrations/creating-nodes/

See also: ../../integration/connector.zod.ts for enterprise connectors

@example

const slackNotifier: Connector = \{

id: 'slack_notify',

name: 'Slack Notification',

category: 'communication',

authentication: \{

type: 'apiKey',

fields: [\{ name: 'webhook_url', label: 'Webhook URL', type: 'url' \}]

\},

operations: [

\{ id: 'send_message', name: 'Send Message', type: 'action' \}

]

\}
**Source:** `packages/spec/src/automation/trigger-registry.zod.ts`

TypeScript Usage

import { AuthField, Authentication, AuthenticationType, ConnectorCategory, ConnectorInstance, ConnectorOperation, OAuth2Config, OperationParameter, OperationType } from '@objectstack/spec/automation';
import type { AuthField, Authentication, AuthenticationType, ConnectorCategory, ConnectorInstance, ConnectorOperation, OAuth2Config, OperationParameter, OperationType } from '@objectstack/spec/automation';

// Validate data
const result = AuthField.parse(data);

AuthField

Properties

Property Type Required Description
name string Field name (snake_case)
label string Field label
type Enum<'text' | 'password' | 'url' | 'select'> Field type
description string optional Field description
required boolean Required field
default string optional Default value
options { label: string; value: string }[] optional Select field options
placeholder string optional Placeholder text

Authentication

Properties

Property Type Required Description
type Enum<'none' | 'apiKey' | 'basic' | 'bearer' | 'oauth1' | 'oauth2' | 'custom'> Authentication type
fields { name: string; label: string; type: Enum<'text' | 'password' | 'url' | 'select'>; description?: string; … }[] optional Authentication fields
oauth2 { authorizationUrl: string; tokenUrl: string; scopes?: string[]; clientIdField: string; … } optional OAuth 2.0 configuration
test { url?: string; method: Enum<'GET' | 'POST' | 'PUT' | 'DELETE'> } optional Authentication test configuration

AuthenticationType

Allowed Values

  • none
  • apiKey
  • basic
  • bearer
  • oauth1
  • oauth2
  • custom

ConnectorCategory

Allowed Values

  • crm
  • payment
  • communication
  • storage
  • analytics
  • database
  • marketing
  • accounting
  • hr
  • productivity
  • ecommerce
  • support
  • devtools
  • social
  • other

ConnectorInstance

Properties

Property Type Required Description
id string Instance ID
connectorId string Connector ID
name string Instance name
description string optional Instance description
credentials Record<string, any> Encrypted credentials
config Record<string, any> optional Additional config
active boolean Instance active status
createdAt string optional Creation time
lastTestedAt string optional Last test time
testStatus Enum<'unknown' | 'success' | 'failed'> Connection test status

ConnectorOperation

Properties

Property Type Required Description
id string Operation ID (snake_case)
name string Operation name
description string optional Operation description
type Enum<'read' | 'write' | 'delete' | 'search' | 'trigger' | 'action'> Operation type
inputSchema { name: string; label: string; description?: string; type: Enum<'string' | 'number' | 'boolean' | 'array' | 'object' | 'date' | 'file'>; … }[] optional Input parameters
outputSchema Record<string, any> optional Output schema
sampleOutput any optional Sample output
supportsPagination boolean Supports pagination
supportsFiltering boolean Supports filtering

OAuth2Config

Properties

Property Type Required Description
authorizationUrl string Authorization endpoint URL
tokenUrl string Token endpoint URL
scopes string[] optional OAuth scopes
clientIdField string Client ID field name
clientSecretField string Client secret field name

OperationParameter

Properties

Property Type Required Description
name string Parameter name
label string Parameter label
description string optional Parameter description
type Enum<'string' | 'number' | 'boolean' | 'array' | 'object' | 'date' | 'file'> Parameter type
required boolean Required parameter
default any optional Default value
validation Record<string, any> optional Validation rules
dynamicOptions string optional Function to load dynamic options

OperationType

Allowed Values

  • read
  • write
  • delete
  • search
  • trigger
  • action