# Custom Templates (Enterprise) (/docs/layers/templates)



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 [#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](/docs/integrations/webhooks)
or external workflow runners.

## Anatomy [#anatomy]

A template is a JSON document with the following shape:

```json
{
  "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 [#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 [#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-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 [#reference]

* See [Layers and templates](/docs/concepts/layers) for the conceptual model.
