Trigger Registry
Trigger Registry protocol schemas
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 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 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
- Simple Automation Triggers
-
Slack notifications on record updates
-
Twilio SMS on workflow events
-
SendGrid email templates
- Lightweight Operations
-
Single-action integrations (send, notify, log)
-
No bidirectional sync required
-
Webhook receivers for incoming events
- Quick Integrations
-
Payment webhooks (Stripe, PayPal)
-
Communication triggers (Twilio, SendGrid, Slack)
-
Simple API calls to third-party services
@see https://zapier.com/developer/documentation/v2/
@see https://docs.n8n.io/integrations/creating-nodes/
@see ../../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 | Object[] | 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 | Object[] | optional | Authentication fields |
| oauth2 | Object | optional | OAuth 2.0 configuration |
| test | Object | optional | Authentication test configuration |
AuthenticationType
Allowed Values
noneapiKeybasicbeareroauth1oauth2custom
ConnectorCategory
Allowed Values
crmpaymentcommunicationstorageanalyticsdatabasemarketingaccountinghrproductivityecommercesupportdevtoolssocialother
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 | Object[] | 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
readwritedeletesearchtriggeraction