Skip to main content
In this lesson we’ll learn how to create Backstage templates and review the core syntax used to scaffold and provision new projects with the Scaffolder. Templates in Backstage are first-class entities (just like Component or System) — they are defined with a YAML entity whose kind is Template. A template entity contains metadata (name, title, description, owner, type) and three main spec sections:
  • parameters — builds the UI form and gathers input,
  • steps — executes the actions that implement the template logic,
  • output — renders helpful links and values after success.
A minimal template entity looks like this:
Register the template like any other Backstage entity: register it statically, add it to the catalog, or let Backstage scan remote locations (for example, GitHub, S3) to discover templates automatically.
A diagram titled "Static Configuration" showing a stack/service on the left scanning an S3 bucket on the right. It depicts finding YAML templates (Template1.yaml, Template2.yaml, Template3.yaml) in the bucket to register in Backstage.

1) Parameters — Building the Form

The parameters section defines the user-facing form used to collect input. Each item in the parameters array describes a page (or step) in the multi-page form. Within a parameter/page you declare properties — the fields that appear on that page.
A presentation slide titled "Template – Parameters" showing a stylized smartphone UI mockup with icons, a gear and a wrench. The caption explains that users input username, password, etc. using parameters and that the parameters field is for designing the form's UI.
Each property typically has:
  • an internal name (the YAML key used to reference the value),
  • a title (shown to the user),
  • a type (string, number, boolean, array, etc.),
  • a description,
  • optional UI hints such as ui:placeholder, ui:autofocus, ui:widget, or ui:field.
Example — a single page with basic fields:
Common property patterns and validation:
  • Number with range:
  • Enum (dropdown):
  • Radio buttons (single selection shown inline):
  • Multi-select checkboxes:
  • Boolean (yes/no) — radio or checkbox:
A clean UI mockup titled "Properties" showing a rounded form with fields for Name, Password, email, Age (highlighted), Relationship Status and gender radio buttons. An orange label reading "Property" points at the Age input.

Built-in UI fields

Backstage ships useful UI pickers that simplify capturing structured values from your catalog and repository hosts. Use the corresponding ui:field and ui:options to configure behavior.
  • Entity picker (ui:field: EntityPicker):
  • Owner picker (ui:field: OwnerPicker):
  • Repository picker (ui:field: RepoUrlPicker):

Conditional fields

Use JSON Schema dependencies to show or hide fields based on earlier answers. This keeps the form focused and relevant. Example: only ask for platform when deploy is true:
A UI mockup titled "Conditionals in the UI" showing step 1 selected, a checked "Deploy application?" box, and a dropdown of deployment options (ec2, ecs, eks, lambda) with a hand cursor.
Design parameters to collect only what you need. Use dependencies to reveal advanced options, and prefer pickers (Entity/Owner/Repo) to reduce free-text errors.
Parameters build the UI and gather the input values you will reference inside steps. Next we look at how each step executes actions.

2) Steps — Executing Actions

The steps array contains the actions that implement the template behavior: fetch a skeleton, render templates, publish to Git, register catalog entities, provision cloud resources, etc. Each step should include:
  • id — unique identifier used to reference that step’s output,
  • name — human-friendly name shown in the UI,
  • action — the action plugin to run (for example fetch:template, publish:github, catalog:register),
  • input — the configuration for the action (can use parameter and step output expressions).
Typical template flow:
  1. Fetch a directory containing the skeleton/project template.
  2. Render files with the provided values.
  3. Publish the generated result to the Git host.
  4. Optionally register the new component in the Backstage catalog.
Example: fetch a skeleton and publish to GitHub.
Notes:
  • Map parameters into input.values for the fetch:template action so templates can use values.*.
  • Refer to parameter values inside steps using the scaffolder expression syntax: ${{ parameters.<property> }}.
To register the generated component in the catalog, use catalog:register and reference outputs from prior steps. Step outputs are available via steps['<id>'].output.<field>. Example:
Always use inline code ticks when showing step references in text, for example: steps['publish'].output.repoContentsUrl.

3) Templating files (skeleton) and passing values into files

A platform team typically provides a skeleton directory with base files for new projects (source files, package manifests, a catalog-info.yaml, configuration, etc.). The fetch:template action copies that folder and renders files using the values you provide. Inside skeleton files, reference the values using the templating syntax (commonly Mustache). Example package.json using values.projectName:
Map UI parameters into templating variables in your template spec.steps.fetch-base.input.values:
All files under ./content will be rendered with values.projectName, values.owner, etc. Example templated catalog-info.yaml inside the skeleton:
The templating engine supports helpers and filters to transform data (for example convert objects to YAML or JSON) — useful when injecting complex structures into YAML manifests.

4) Output — information shown to the user after success

The output section exposes links and useful metadata after the template run completes. Outputs usually reference step outputs using the ${{ ... }} scaffolder expression syntax. Example outputs that link to the created repository and the new catalog entity:
These outputs are rendered in the UI so the user can quickly navigate to the repository or the new catalog entry.
A web dashboard showing a three-step pipeline with green checkmarks for Fetch Base (0s), Publish (2s) and Register (0s). Below are buttons labeled "Repository" and "Open in Catalog."
Do not store production secrets (API keys, passwords) in template outputs or in the generated repository content. Use secret management integrations and environment-specific provisioning steps where appropriate.

Quick Reference

Links and references:

Summary

Backstage templates let platform teams provide repeatable, self-service project scaffolds. Build templates by:
  • defining parameters to collect structured input with pickers and conditionals,
  • implementing steps to fetch skeletons, render files, publish code, and register catalog entries,
  • exposing output links so developers can quickly navigate to the created resources.
Map UI parameters into steps.input.values, use {{ values.* }} inside skeleton files, and reference step results with the ${{ steps['<id>'].output.<field> }} syntax to build robust, reusable templates for your Backstage platform.

Watch Video