SDK & Libraries

Official TypeScript/JavaScript packages for blueprint validation and platform export

Overview

The Automation Blueprint SDK provides developer-friendly packages for validating blueprints and converting them to platform-specific formats. All packages are written in TypeScript with full type definitions and zero runtime dependencies.

Available Packages

@automation-blueprints/dsl

Blueprint DSL schema and validator

v0.1.0
Installation:
npm install @automation-blueprints/dsl
Features:
  • • JSON Schema validation for blueprints
  • • TypeScript type definitions
  • • Human-readable error messages
  • • Zero runtime dependencies (only ajv)
Key Exports:
validateDsl(dsl: unknown): ValidationResult
dslSchema - JSON Schema object

@automation-blueprints/adapters

Runtime adapters for platform export

v0.1.0
Installation:
npm install @automation-blueprints/adapters
Supported Platforms:
Zapier
Runtime ID: zapier
Make (Integromat)
Runtime ID: make
n8n
Runtime ID: n8n
Power Automate
Runtime ID: power-automate
Key Exports:
AdapterRegistry.get(runtime: string)
AdapterRegistry.list(): string[]
adapter.toTargetFormat(dsl: unknown)

Quick Start

1. Validate a Blueprint

import { validateDsl } from '@automation-blueprints/dsl';

const blueprint = {
  id: 'my-blueprint',
  name: 'My Automation Blueprint',
  version: '1.0.0',
  apps: ['slack', 'salesforce'],
  trigger: {
    app: 'slack',
    event: 'message_posted'
  },
  steps: [
    {
      id: 'create-lead',
      app: 'salesforce',
      action: 'create_record',
      inputs: {
        object: 'Lead',
        fields: { /* ... */ }
      }
    }
  ]
};

const result = validateDsl(blueprint);

if (result.ok) {
  console.log('✓ Blueprint is valid');
} else {
  console.error('Validation errors:', result.errors);
}

2. Export to Platform

import { AdapterRegistry } from '@automation-blueprints/adapters';

// Get adapter for target platform
const adapter = AdapterRegistry.get('zapier');

if (adapter) {
  // Convert blueprint to platform format
  const zapierConfig = adapter.toTargetFormat(blueprint);
  
  console.log('Zapier configuration:');
  console.log(JSON.stringify(zapierConfig, null, 2));
}

// List all available platforms
const platforms = AdapterRegistry.list();
console.log('Supported platforms:', platforms);
// Output: ['zapier', 'make', 'n8n', 'power-automate']

3. Validate and Export

import { validateDsl } from '@automation-blueprints/dsl';
import { AdapterRegistry } from '@automation-blueprints/adapters';

function exportBlueprint(blueprint: unknown, platform: string) {
  // Step 1: Validate
  const validation = validateDsl(blueprint);
  if (!validation.ok) {
    throw new Error(`Invalid blueprint: ${validation.errors?.join(', ')}`);
  }
  
  // Step 2: Get adapter
  const adapter = AdapterRegistry.get(platform);
  if (!adapter) {
    throw new Error(`Platform '${platform}' not supported`);
  }
  
  // Step 3: Export
  return adapter.toTargetFormat(blueprint);
}

// Usage
try {
  const n8nWorkflow = exportBlueprint(myBlueprint, 'n8n');
  console.log('Export successful!', n8nWorkflow);
} catch (error) {
  console.error('Export failed:', error.message);
}

API Reference

validateDsl(dsl: unknown): ValidationResult

Validates a blueprint object against the DSL JSON Schema.

Returns:
ok: boolean - true if valid
errors?: string[] - error messages if invalid
warnings?: string[] - warning messages
AdapterRegistry.get(runtime: string): Adapter | undefined

Retrieves an adapter by platform runtime identifier.

Parameters:
runtime: 'zapier' | 'make' | 'n8n' | 'power-automate'
AdapterRegistry.list(): string[]

Returns all registered adapter runtime identifiers.

Returns:
Array of platform names: ['zapier', 'make', 'n8n', 'power-automate']
adapter.toTargetFormat(dsl: unknown): unknown

Converts blueprint DSL to platform-specific format.

Parameters:
dsl: Blueprint object in DSL format
Returns:
Platform-specific configuration object (structure varies by platform)

TypeScript Support

All packages include full TypeScript definitions with IntelliSense support:

import { 
  validateDsl, 
  ValidationResult, 
  dslSchema 
} from '@automation-blueprints/dsl';

import { 
  Adapter, 
  AdapterRegistry 
} from '@automation-blueprints/adapters';

// Full type checking
const result: ValidationResult = validateDsl(myBlueprint);
const adapter: Adapter | undefined = AdapterRegistry.get('zapier');
const platforms: string[] = AdapterRegistry.list();

Platform Output Examples

Each adapter produces platform-specific output formats:

Zapier Output

Zapier platform JSON with triggers, searches, and creates objects

{ triggers: {...}, searches: {...}, creates: {...} }

Make (Integromat) Output

Make scenario JSON with flow array and module definitions

{ flow: [...], modules: {...} }

n8n Output

n8n workflow JSON with nodes and connections

{ nodes: [...], connections: {...} }

Power Automate Output

Azure Logic Apps workflow definition schema

{ definition: { triggers: {...}, actions: {...} } }

Get Started

Install both packages:
npm install @automation-blueprints/dsl @automation-blueprints/adapters