Managing Templates
A template is reusable text with placeholders, such as a JSON request body or an email, that a workflow fills with data at run time. You write and version templates once under Settings and reuse them in any workflow through the Template activity.
This page is about the templates under Settings > Workspace > Templates. It is not about application and workflow templates or resource templates, which copy a whole application, workflow, or resource.
How it works
- You create a template and write its text with
{{field}}placeholders. Studio checks the text as you type. - You save a draft while you work, then publish it. A published version never changes.
- In a workflow, you add the Template activity and pick the template. The activity stays on the version you picked until you choose another.
- When the workflow runs, the activity fills the placeholders with the values you mapped and returns the result in
useTemplateOutput.output.
Template types
| Type | The result is | Placeholder escaping |
|---|---|---|
| JSON | A JSON document | {{x}} is escaped as the inside of a JSON string. |
| XML | A well-formed XML document with one root element | {{x}} is escaped for markup. |
| HTTP (HTML) | An HTML document | {{x}} is escaped for markup. |
| Text | Plain text | Nothing is escaped. |
In the type list, HTTP is shown as HTTP (HTML) and Text as Text. For the full syntax, see Template Syntax.
Levels
| Level | Who can use it |
|---|---|
| Workspace | Workflows in the workspace where you created it. |
| Organization | Workflows in every workspace of your organization. |
You choose the level when you create a template and cannot change it in the editor afterward. You can promote a workspace template to the organization later, but you cannot reverse it.
Template names are unique per organization for Organization level templates, and per workspace for Workspace level templates. Capitalization does not make a name different. The Template name field accepts up to 256 characters.
Versions
- A template has at most one draft at a time.
- Publishing turns the draft into the next version: v1, v2, and so on.
- Editing a published version never changes it. Your changes save as a draft and publish as the next version number.
- A workflow keeps using the version it picked, so publishing a new version does not change running workflows.
Where to go next
| I want to | Go to |
|---|---|
| Create and publish my first template | Creating a Template |
| Edit, promote, or delete a template | Managing Template Versions |
| Look up placeholders and helpers | Template Syntax |
| Have Koodisi AI write the template | Generating a Template with Koodisi AI |
| Use a template in a workflow | Using a Template in a Workflow |
| Copy a worked example | Template Examples |
| Fix an error | Troubleshooting Templates |