Skip to main content
Template chaining lets you use the output from one template as input to another template in a multi-step workflow.

How Chaining Works

When you run a job with multiple templates:
  1. Templates execute in order (top to bottom)
  2. Each template’s output is added to the row data
  3. Later templates can reference earlier outputs using {{OutputColumnName}}

Chaining Syntax

Use the Output Column Name from a previous template:
Template 1 outputs to column → "Hook"
Template 2 prompt uses       → {{Hook}}
The Output Column Name is set when you create the template. Make it descriptive!

Example Workflow

1

Template 1: Hook Generator

Output Column: HookPrompt:
Write a personalized opening hook for {{First Name}} at {{Company}}.
Generates: “Scaling a SaaS sales team in Austin’s competitive market…”
2

Template 2: Email Body

Uses: {{Hook}} in promptOutput Column: Email_BodyPrompt:
Using this opening: {{Hook}}

Write the rest of a cold email body about our funding offer.
Keep it under 100 words.
Generates: Full email body incorporating the hook
3

Template 3: CTA

Uses: {{Hook}} and {{Email_Body}} in promptOutput Column: CTAPrompt:
Based on this email:
Hook: {{Hook}}
Body: {{Email_Body}}

Write a soft call-to-action. One sentence.
Generates: Contextual call-to-action

Setting Up a Chain

1

Create Templates with Clear Output Names

Give each template a distinct Output Column Name:
  • Template 1 → Hook
  • Template 2 → Pain_Point
  • Template 3 → CTA
2

Reference Earlier Outputs

In later templates, use {{Output_Column_Name}}:
Expand on this hook: {{Hook}}
3

Order Templates Correctly in Jobs

When creating a job, arrange templates so dependencies come first

Chain Testing Feature

When creating or editing templates with unresolved variables (variables not in your CSV), Smelt automatically detects them.

Unresolved Variables UI

If you use {{Hook}} but “Hook” isn’t a CSV column, Smelt shows:

Link to Source Template

Auto-suggested if another template outputs to that column name. Select it to chain.

Enter Mock Value

Type a test value manually for testing purposes.

How Chain Testing Works

  1. Smelt detects unresolved variables in your prompt
  2. Matches them against your other templates’ output column names
  3. Suggests linking or lets you enter mock values
  4. Runs the full chain during testing
  5. Shows intermediate outputs from each step

Chain Test Results

When you run a chain test, you see:
InfoDescription
Step numbersEach template numbered in execution order
Intermediate outputsWhat each template generated
Current templateHighlighted as the one you’re testing
Token usagePer-step and total token counts
CostPer-step and total cost
Quality flagsFlags for each step’s output
DurationTime taken for the full chain
Chain testing runs the full chain so you can verify the workflow works before running a real job.

Best Practices

Use names like Hook, Pain_Point, CTA rather than long descriptions.
Use chain testing to verify your multi-template workflow works correctly.
In the job wizard, arrange templates so dependencies come first.
If you don’t have a source template yet, enter mock values to test your prompt.
2-4 templates in a chain is usually optimal. More can increase cost and complexity.

Common Chain Patterns

Pattern 1: Hook → Body → CTA

Classic cold email structure built step by step.

Pattern 2: Research → Personalization

First template extracts insights, second uses them for copy.

Pattern 3: Draft → Refinement

First template writes rough copy, second polishes it.

Pattern 4: Qualification → Messaging

First template scores/qualifies lead, second adjusts messaging based on score.

Chain Limitations

Each template in a chain consumes usage. A 3-template chain on 1,000 rows = 3,000 usage.
ConsiderationNote
Usage multiplierTemplates × Rows = Total usage
Cost increasesMore templates = more API calls
Error propagationBad output in step 1 affects later steps
Ordering is fixedTemplates run top-to-bottom, no conditional logic