1. Templates
  2. Template Data

Templates

Template Data

Data that is common across all stubs that use a template. Template data gives you the ability to set data on the template that is used globally across the template. This allows for easier setting of key information of the template, like prompts and settings.

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 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.

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

  • API Endpoints: You can set different API endpoints for each branch of a template.
  • LLM Prompts: You use template data to expose prompts as a text box on the flow canvas.
  • Settings: You can use template data to store settings that are common across all stubs that use a template.
  • Messages: Store messages that are used in various actions in the template.

How to use template data

  1. Open the template flow
  2. Select the Add Template Data tool from the toolbar
  3. Set the data path for the template data
  4. A new template data text input will appear on the flow canvas

Add new template data

New Template Data

Setting New Template Data

Once you have set the template data, you can use variable substitution to use the template data in the flow. For example:

loading...

Viewing full structure

You can view the full structure of the template data by clicking on the top level template data icon.
This will open a modal with the full structure of the template data.

Template Data Structure