Skip to main content
In Lesson 8, we simplified the workflow to one Product Support Agent. The content may be accurate and well written, but generated formatting can still vary. A greeting may change, a divider may disappear, or a signature may be phrased differently from one run to the next. For elements that must remain consistent, we can use a Template node.

Template

It takes the original data (like your list of answers), follows a strict design template/standards you provide, and generates a perfectly formatted block of text, ensuring consistency every single time.

Hands-On: Polish the Email Layout

1

Check the Product Support Agent

Select Product Support on the workflow canvas. Its assignment should require it to handle the complete email but return only the substantive body. Add the text below in Agent task:
This separation matters: the Agent controls delivery and tone, while the Template controls the fixed layout.
2

Add a Template Node

Insert a Template node after the Agent node and before Output.
3

Set the Input Variables

Open the Template node and add these variables:
  • customer: User Input /{x} customer_name
  • body: Agent /{x} text
Using the Agent’s text output makes the handoff easy to understand and inspect.
4

Format the Email with Jinja

What is Jinja2?In simple terms, Jinja2 is a tool that allows you to format variables (like your list of answers) into a text template exactly how you want. It uses simple symbols to mark where variables go and perform basic logic. With it, we can turn a raw list of data into a neat, standardized text block.Here, we can put together opening, signatures, and email body to make sure the email is professional and consistent every time.Copy and paste this exact layout into the Template code box:
The values of customer and body can change with every workflow run. Everything around them remains fixed. This gives the Agent freedom to write the answer while ensuring that the final email always follows the required layout.
5

Update the Output Node

Open Output. Replace the previous value with the Template node’s output.
Here’s the final workflow.
Click Test Run. Ask multiple questions in one email. Notice how your final output has a perfectly written custom intro, the LLM’s beautifully summarized answers in the middle, and a standard, professional signature at the bottom.

Mini Challenge

  1. Add a conditional fallback when customer is empty, such as Hi there,.
  2. Add a fixed support disclaimer that the Agent cannot change or omit.
Last modified on August 27, 2026