How Chaining Works
When you run a job with multiple templates:- Templates execute in order (top to bottom)
- Each template’s output is added to the row data
- Later templates can reference earlier outputs using
{{OutputColumnName}}
Chaining Syntax
Use the Output Column Name from a previous template:Example Workflow
1
Template 1: Hook Generator
Output Column: Generates: “Scaling a SaaS sales team in Austin’s competitive market…”
HookPrompt:2
Template 2: Email Body
Uses: Generates: Full email body incorporating the hook
{{Hook}} in promptOutput Column: Email_BodyPrompt:3
Template 3: CTA
Uses: Generates: Contextual call-to-action
{{Hook}} and {{Email_Body}} in promptOutput Column: CTAPrompt: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}}: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
- Smelt detects unresolved variables in your prompt
- Matches them against your other templates’ output column names
- Suggests linking or lets you enter mock values
- Runs the full chain during testing
- Shows intermediate outputs from each step
Chain Test Results
When you run a chain test, you see:| Info | Description |
|---|---|
| Step numbers | Each template numbered in execution order |
| Intermediate outputs | What each template generated |
| Current template | Highlighted as the one you’re testing |
| Token usage | Per-step and total token counts |
| Cost | Per-step and total cost |
| Quality flags | Flags for each step’s output |
| Duration | Time 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
Keep output column names simple
Keep output column names simple
Use names like
Hook, Pain_Point, CTA rather than long descriptions.Test chains before bulk runs
Test chains before bulk runs
Use chain testing to verify your multi-template workflow works correctly.
Order matters in jobs
Order matters in jobs
In the job wizard, arrange templates so dependencies come first.
Use mock values for testing
Use mock values for testing
If you don’t have a source template yet, enter mock values to test your prompt.
Don't over-chain
Don't over-chain
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
| Consideration | Note |
|---|---|
| Usage multiplier | Templates × Rows = Total usage |
| Cost increases | More templates = more API calls |
| Error propagation | Bad output in step 1 affects later steps |
| Ordering is fixed | Templates run top-to-bottom, no conditional logic |