Layers

Custom Templates (Enterprise)

Author your own layer template. Versioning, validation, and publishing.

View as Markdown

Custom templates are an Enterprise feature. With them, you can ship your own layer logic — useful for agencies repeating client-specific workflows, or large customers with bespoke integrations.

When to author a template

  • A workflow you keep building per Project.
  • An integration with an internal tool we don't support.
  • A wrapper that bundles 3–4 commands into one logical "feature".

For one-off automations, prefer webhooks or external workflow runners.

Anatomy

A template is a JSON document with the following shape:

{
  "default_config": { /* seeds project_layers.config on install */ },
  "config_schema": { /* JSON Schema validated on write */ },
  "commands": {
    "initialize": {
      "title": "Initialize",
      "planner": "@planner/run-workflow/v1",
      "trigger": { "type": "executable" },
      "workflow": { "workflowId": "my-init", "version": 1 },
      "inputMapping": { "projectId": "${context.projectId}" }
    },
    "refresh-thing": {
      "title": "Refresh Thing",
      "planner": "@planner/run-workflow/v1",
      "trigger": { "type": "scheduled", "schedule": { "cron": "0 */6 * * *" } },
      "workflow": { "workflowId": "my-refresh", "version": 1 },
      "inputMapping": { "projectId": "${context.projectId}" }
    }
  }
}

Workflows

Each command points at a workflow. Workflows are authored as JSON and versioned immutably. Activities referenced must be registered in the runtime.

Authoring flow

Custom template authoring is coordinated directly with your Layers account team — we help you define the template, register any new activities, validate the schema, and publish the template into your organization. Contact your account manager to get started.

Scheduled command naming

Scheduled commands have their cron in the command's trigger.schedule.cron field. Per-project overrides are supported via project_layers.schedule.cron.

Reference

On this page