Skip to main content

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

Accessing Step Results

Using Secrets

Secrets are configured at the workspace level and accessed securely:
Security Notes:
  • 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
Template syntax error
  • Check for balanced braces {{ }}
  • Verify Jinja2 tag syntax {% %}
  • Look for missing quotes in strings
Unexpected output
  • Use debug steps to inspect intermediate values
  • Check whitespace handling
  • Verify data types (string vs object)