Templates
Template Data
Explains template data as shared JSON available under template.data. Useful for global configuration, reusable values, substitutions, and settings that stay the same between branches.
This allows for easier setting of key information of the template, like prompts and settings that stay the same between branches.
Template data goes through 2 rounds of variable substitution on initialization. This allows you to use 1 layer of template.data variables in template.data data elements.
This does mean that you need to use {{{{skip}}}} in template data, to prevent this functionality when you need to preserve the data as is.
Details
Template data is located under the path template.data.
You need to store any template data under at least two levels of hierarchy, so for example you can specify template.data.settings.api_url to save a shared URL for an API or template.data.prompts.system to set a system prompt.
You can store any JSON valid value under the path you set, this includes strings, numbers, objects or arrays.
Use template.data for settings that should stay the same between branches.
For values that change between draft and live, such as API URLs, credentials, or environment-specific settings, use template branch data instead. This lets you reference one path, like template.branch_data.apiurl, while Stubber resolves the value for the current branch.
Annotation
On the canvas you can add a Template Data Annotation, this allows you to set a text value and make it visible.
The annotation is just a easy way of accessing and setting a string Template Data point.
Uses
- Shared API Endpoints: You can set API endpoints that should stay the same across all branches of a template.
- LLM Prompts: You use template data to expose prompts as a text box on the flow canvas.
- Shared Settings: You can use template data to store settings that are common across all branches and stubs that use a template.
- Messages: Store messages that are used in various actions in the template.
How to use template data
- Open the template flow
- Select the Add Template Data tool from the toolbar
- Set the data path for the template data
- A new template data text input will appear on the flow canvas



Once you have set the template data, you can use variable substitution to use the template data in the flow. For example:
You can use markdown in the template data text annotation, this allows you to format the text and add links to the template data.
This is particularly useful for prompts, as they are more readable but also aids LLMs in understanding the context of the prompt.
Viewing Template Data
You can view the full structure of the template data by clicking on the View Template Data button.
This will open a sheet with a tab for the template.data structure.
