For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
BlogLog InRequest Demo
HomeProductDevelopersSelf-HostingChangelog
HomeProductDevelopersSelf-HostingChangelog
  • Getting Started
    • Overview
  • Workflows SDK
    • Introduction
    • Installation
    • Core Concepts
    • Defining Control Flow
    • Configuration
    • Custom Docker Images
      • Displayable Nodes
        • Agent Node
        • Inline Prompt Node
        • Inline Subworkflow Node
        • Prompt Deployment Node
        • Search Node
        • Subworkflow Deployment Node
        • API Node
        • Code Execution Node
        • Templating Node
        • Guardrail Node
        • Map Node
        • Conditional Node
        • Merge Node
        • Error Node
        • Final Output Node
      • Datasets
      • CLI
  • Client SDK
    • Introduction
    • Authentication
    • API Versioning
LogoLogo
BlogLog InRequest Demo
Workflows SDKAPI ReferenceDisplayable Nodes

Templating Node

1from vellum.workflows.nodes import TemplatingNode
2
3# Notice `str` is used to specify the output type of the Templating Node
4# ... in fact, `str` is also the default output type for the Templating Node, so this could be omitted
5class MyTemplatingNode(TemplatingNode[BaseState, str]):
6 template = "The weather in {{ city }} is {{ weather }}."
7
8 inputs = {
9 "city": Inputs.city,
10 "weather": Inputs.weather,
11 }
1MyTemplatingNode.Outputs(
2 result="""
3 Dear Jane Doe,
4
5 Thank you for your 5 years of service at Acme Corp.
6 Your dedication to Engineering has been invaluable.
7
8 Best regards,
9 HR Team
10 """
11)
Was this page helpful?
Previous

Guardrail Node

Next
Built with

vellum.workflows.nodes.TemplatingNode

Used to render text templates using Jinja2 syntax

Attributes

template
strRequired

The Jinja2 template to render

inputs
EntityInputsInterfaceRequired

The values to substitute into the template for the specified variables.

Outputs

result
_OutputType

The rendered template in the appropriate type as specified by the type specified in the Templating Node subclass definition.