Overview
Jinba Flow supports powerful templating capabilities that allow you to:- Reference results from previous steps
- Access configured secrets securely
- Use Jinja2 templates for complex logic
- Create dynamic, reusable workflows
Variable Placeholders
Basic Syntax
Variables are enclosed in double curly braces:{{ variable }}
Available Variables
| Variable | Description | Example |
|---|---|---|
steps.<step_id>.result | Result from a previous step | {{steps.fetch_data.result}} |
steps.<step_id>.result.<property> | Specific property from result | {{steps.api_call.result.content}} |
secrets.<secret_name> | Configured workspace secret | {{secrets.API_KEY}} |
item | Current item in forEach loop | {{item}} |
item.<property> | Property of current item | {{item.id}} |
Accessing Step Results
Using Secrets
Secrets are configured at the workspace level and accessed securely:- Secrets are encrypted at rest
- Never hardcode sensitive values in workflows
- Use secrets for API keys, tokens, and credentials
Jinja2 Templates
Jinba Flow supports full Jinja2 templating for advanced logic. Templates are processed before step execution.Control Structures
For Loops
Conditional Statements
Loop with Index
Built-in Functions
Jinja2 provides useful built-in functions:Filters
Apply transformations to values:Whitespace Control
Use{%- and -%} to control whitespace:
{%-removes whitespace before the tag-%}removes whitespace after the tag
Common Patterns
Processing Lists
Conditional Data Selection
Combining Multiple Sources
Filtering Lists
Building Dynamic Prompts
Best Practices
Variable References
- Use descriptive step IDs for clarity
- Access only the properties you need
- Handle potential null/undefined values with defaults
Templates
- Keep templates readable with proper indentation
- Use whitespace control for clean output
- Break complex logic into multiple steps
Secrets
- Never log or expose secret values
- Use workspace-level secrets for team sharing
- Rotate secrets regularly
Performance
- Avoid deeply nested templates
- Limit loop iterations
- Pre-process data when possible
Troubleshooting
Common Issues
Variable not found- Check step ID spelling
- Ensure the referenced step runs before current step
- Verify the property path is correct
- Check for balanced braces
{{ }} - Verify Jinja2 tag syntax
{% %} - Look for missing quotes in strings
- Use debug steps to inspect intermediate values
- Check whitespace handling
- Verify data types (string vs object)
Related
- Step Module Options - forEach, when, needs
- YAML Coding Panel - Complete YAML syntax
- Debug - Debugging workflows