AI Workflows

Overview

AI Workflows in Clear Ideas enable you to automate multi-step AI processes by chaining together prompts that build upon each other. This powerful orchestration platform allows you to create reusable, consistent AI pipelines that can run on demand or on a schedule.

Each AI Workflow acts as a container for a series of prompt steps, variables, and configuration settings. By breaking complex AI tasks into discrete steps, you gain greater control over the process and can more easily debug and optimize your AI interactions.

Viewing Your AI Workflows

The AI Workflows list provides a comprehensive overview of all your available workflows, presented in a searchable, sortable table.

AI Workflow Information

For each AI Workflow, you can see:

  • Name - The descriptive title of your AI Workflow
  • Tags - Visual indicators of workflow type:
    • System - Built-in AI Workflows provided by Clear Ideas
    • AI Generated - AI Workflows created by AI assistance
    • Custom - Your own categorization tags
  • Last Updated - Relative time since the AI Workflow was modified (e.g., "2 days ago")
  • Statistics - Key metrics displayed as badge counts:
    • Prompts - Number of steps in the AI Workflow
    • Validation - Status indicator showing if the AI Workflow has configuration errors
    • Jobs - Number of executions of this AI Workflow
    • Schedules - Number of recurring job configurations

AI Workflow List Actions

  • Search - Filter AI Workflows by typing in the search field at the top of the list
  • Multi-select - Click the checkbox next to AI Workflows to select multiple items
  • Delete - Remove selected AI Workflows (with confirmation dialog and warning about associated jobs)
  • Create Job - Instantly run an AI Workflow by clicking the job icon
  • View Jobs - Access a filtered list of all jobs run for a specific AI Workflow
  • View Details - Click anywhere on an AI Workflow row to open its complete configuration page

Creating and Editing AI Workflows

Basic Settings

The top section of the AI Workflow editor contains fundamental configuration options:

  • Name - Set a clear, descriptive name that identifies the AI Workflow's purpose
  • Status - Control AI Workflow availability:
    • Active - Available for jobs and scheduling
    • Paused - Temporarily disabled (scheduled jobs won't run)
  • Output Template - Define the structure for combining multiple step outputs into a final formatted result:
    • Select from predefined templates or create custom templates
    • Use Handlebars variable syntax to reference step outputs: {{step-1}}, {{step-2}}, {{step-2-1}}, etc.
    • Reference steps by their named output variables: {{summary}}, {{analysis}}, {{result}}, etc. (if defined)
    • Combine outputs from various steps into a cohesive final document
    • Supports conditional logic and formatting using Handlebars helpers
    • The output template processes all available variables (workflow variables, step outputs including named variables, default variables) to generate the final result
  • AI Model - Choose the language model that will process all steps:
    • Options include various models with different capabilities and pricing
    • The selection affects cost estimates and output quality

Managing Steps

The Steps section displays the sequence of prompts that make up your AI Workflow. Each step builds on previous steps to create a cohesive process.

Step Types

AI Workflows support three distinct step types:

  1. Step (Regular Step) - Standard prompt steps that execute AI model interactions:
    • Must have a prompt - Contains a prompt that is sent to the AI model
    • Can optionally have loop options - Step will iterate over data if loop options are enabled
    • Can reference variables and previous step outputs
    • Outputs are available to subsequent steps as {{step-N}} (e.g., {{step-1}}, {{step-2}})
    • Optional Output Variable Name - You can assign a custom name to a step's output (e.g., summary, analysis, result) to reference it as {{summary}} instead of {{step-N}}. This makes workflows more resilient to step reordering since references use stable names rather than changing step numbers.
    • When a regular step has loop options enabled, it executes multiple times (once per item) and aggregates outputs
    • JSON Output - Regular steps can output JSON. If a step output contains JSON, Clear Ideas will automatically detect it and make it available for subsequent steps. Aggregated JSON outputs will be available as a JSON array.
  2. Container Step (Parent Step) - Container steps that execute multiple child steps in sequence for each iteration:
    • Do not have a prompt - Container steps do not contain prompts
    • Must have child steps - Container steps require at least one child step to execute
    • Must have loop options - Configure loop settings (source, condition, max iterations, variables)
    • Contain one or more child steps that execute sequentially for each iteration
    • Child steps can reference each other and loop variables
    • Final output aggregates results from all iterations of the last child step
  3. Child Step - Prompt steps within a container step:
    • Must have a prompt - Contains a prompt that is sent to the AI model
    • Do not have loop options - Child steps are content-only and execute within the parent's loop
    • Execute sequentially within each loop iteration
    • Can reference parent step outputs, loop variables ({{item}}, {{index}}), and previous child step outputs
    • Use nested step references like {{step-2-1}} (first child of step 2) or {{step-2-2}} (second child of step 2)
    • Container-Scoped References - If the container step has an output variable name (e.g., container), child steps can be referenced as {{container-1}}, {{container-2}}, etc. This makes child step references resilient to parent step reordering since the container name stays the same even if the parent step number changes.
    • Only the last child step's output is included in the container step's final result
    • JSON Output - Child steps can output JSON. If a child step output contains JSON, Clear Ideas will automatically detect it and make it available for subsequent steps. Aggregated JSON outputs will be available as a JSON array.

Key Distinctions:

  • Steps have content and can optionally loop (single operation per iteration)
  • Container Steps have no content but contain child steps (multiple operations per iteration)
  • Child Steps have content but no loop options (execute within parent's loop)

Step Actions

  • Reorder - Arrange steps using:
    • Up/down arrows to move incrementally
    • Drag and drop for free repositioning
  • Add - Expand your AI Workflow:
    • Add Existing Step - Incorporate prompts from your library
    • Create New Step - Design a custom prompt directly in the AI Workflow
    • When creating a new step, choose between "Step" (regular step with content) or "Container Step" (loop step with child steps)
  • Edit - Modify content with the full prompt editor:
    • Edit prompt content, AI model, templates, and files
    • Output Variable Name (optional) - Assign a custom name to reference this step's output (e.g., summary, analysis). This name must be unique across all steps in the workflow. When defined, you can reference the step's output using {{summary}} instead of {{step-N}}, making your workflow more resilient to step reordering.
  • Convert Step Type - Toggle between step and container step using the loop icon
  • Add Child Step - For container steps, add child steps that execute within the loop
  • Include in Output
    • Check this option to include a step's result in the final output
    • If unchecked, the step's result will not be included in the final output unless the step is the last step in the workflow and no other steps are included
    • If an output template is used, the steps defined in the template will be included in the final output regardless of this setting
  • Delete - Remove a step (with indicators if it's referenced by other steps)

Step Visualization

  • Connection Lines - Visual indicators showing relationships between steps
    • Arrows appear when steps explicitly reference each other via variables
    • Child steps show connections to parent steps and other child steps
  • Step Numbers - Sequential identifiers for referencing:
    • Regular steps: step-1, step-2, etc.
    • Child steps: step-2-1, step-2-2, etc. (first number is parent, second is child position)
  • Warning Indicators - Highlight when steps are unused or have configuration issues
  • Output Indicators - Show which steps contribute to the final result
  • Loop Indicators - Loop steps display a refresh icon to indicate they contain iterations

JSON Step Output

  • JSON Output - AI Workflows can use raw JSON output. This allows subsequent steps to loop, filter, or access deep data within an output.
  • Creating JSON Output - JSON output can be directing the AI Model to output in JSON format. If a step output contains JSON, Clear Ideas will automatically detect it and make it available for subsequent steps.

JSON Step Example

For example, assuming the following was the output from Step 1:

{
  "name": "John Doe",
  "age": 30,
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "state": "NY",
    "zip": "10001"
  }
}

Step 2 can reference specific values in the variables using variable placeholders such as {{step-1.address.city}} or {{step-1.name}} or use {{step-1.address}} to extract the entire address object.

Container Steps and Child Steps

Container steps enable you to process collections of data by executing multiple child steps for each item. This is ideal for scenarios where you need to perform a sequence of operations on each item in a collection.

Creating a Container Step

  1. Click "Create New Step" and select "Container Step" (or "Loop Step" in the UI)
  2. Configure the loop settings:
    • Source - The data to iterate over (e.g., {{step-1}} for a JSON array from a previous step)
    • Condition - Optional expression to filter items (e.g., {{item.age}} > 25)
    • Max Iterations - Optional limit on number of iterations
    • Item Variable - Variable name for the current item (default: item)
    • Index Variable - Variable name for the current index (default: index, optional)
  3. Add child steps that will execute sequentially for each iteration
  4. Each child step can reference:
    • The loop item: {{item}} or {{item.name}}
    • The loop index: {{index}}
    • Previous child steps: {{step-2-1}}, {{step-2-2}}, etc. (step-N-M notation) OR {{container-1}}, {{container-2}}, etc. (if container has output variable name)
    • Parent step outputs: {{step-2}} or named parent output variables (if the parent step has an output variable name)
    • Workflow variables and previous steps: {{step-1}}, {{workflowVariable}}, or named output variables like {{summary}} (from top-level steps only)

Container Step Example

For example, if Step 1 outputs a JSON array:

[
  {
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com"
  },
  {
    "name": "Jane Doe",
    "age": 25,
    "email": "jane@example.com"
  }
]

You can create Step 2 as a Container Step:

  • Source: {{step-1}}
  • Item Variable: item
  • Index Variable: index
  • Output Variable Name (optional): processing (makes child steps resilient to parent step reordering)

Then add child steps within the container:

  • Child Step 2-1: "Extract key information from : "
  • Child Step 2-2: "Format the extracted information: . Add email: "
    • Or use container-scoped reference: "Format the extracted information: . Add email: "

Each child step executes for each item in the array. The final output of the container step will be an array containing the results from the last child step (step-2-2) for all iterations.

Container-Scoped References: If the container step has an output variable name (e.g., processing), child steps can reference each other using {{processing-1}}, {{processing-2}}, etc. instead of {{step-2-1}}, {{step-2-2}}. This makes child step references resilient to parent step reordering - if you move the container step from position 2 to position 5, the {{processing-1}} references remain valid, while {{step-2-1}} would need to be updated to {{step-5-1}}.

Steps with Loop Options

Steps (regular steps) can optionally have loop options. When a step has loop options enabled:

  • The step executes multiple times, once for each item in the source
  • Outputs are aggregated (JSON arrays are combined, text is concatenated)
  • The step can reference {{item}} and {{index}} variables
  • The step must have a prompt - it executes the same prompt for each iteration
  • This provides a simpler iteration process but is less flexible than container steps with child steps

When to use Container Steps vs Steps with Loop Options:

  • Use Container Steps when you need multiple sequential operations per item (requires child steps)
  • Use Steps with Loop Options for simple single-operation iterations (single prompt repeated for each item)

Condition Syntax

Loop conditions use expression syntax. Variables in conditions are resolved using Handlebars syntax first, then the expression is evaluated:

Valid Condition Examples:

  • {{item.age}} > 25 - Process items where age is greater than 25
  • {{step-1}} > 0 - Process when step-1 output is greater than 0
  • {{item.status}} == 'active' - Process only active items
  • {{index}} < 5 - Process only the first 5 items
  • {{item.price}} > 100 && {{item.inStock}} == true - Multiple conditions

Supported Operators:

  • Comparison: >, <, >=, <=, ==, !=
  • Logical: && (and), || (or), ! (not)
  • Arithmetic: +, -, *, /, %

Important Notes:

  • Variables in conditions must use Handlebars syntax: {{variableName}}
  • After variable resolution, the expression is evaluated
  • Use == for equality comparisons (not ===)
  • String values should be quoted: 'active', "electronics"
  • Boolean values: true, false (no quotes)
  • If the condition is empty or not provided, all items are processed

Variable Scoping in Loops

Variables are scoped hierarchically:

  • Workflow Variables - Available everywhere: {{workflowVariable}}
  • Step Outputs - Available to subsequent steps: {{step-1}}, {{step-2}}
  • Loop Variables - Available within the loop and its child steps:
    • {{item}} or your custom item variable name
    • {{index}} or your custom index variable name
  • Child Step Outputs - Available to subsequent child steps:
    • {{step-2-1}} - Output from first child of step 2
    • {{step-2-2}} - Output from second child of step 2
    • {{step-previous}} - Output from the previous child step

JSON Array Processing

If the source is a valid JSON array, Clear Ideas will iterate over each object in the array. If the source is not valid JSON, Clear Ideas will iterate over the output one line at a time.

JSON Output from Non-JSON Output

If the AI Model is configured to output in JSON format, but the output is not valid JSON, Clear Ideas will attempt to detect JSON within the output and make it available for subsequent steps. AI models often output JSON within code blocks or provide commentary along side the JSON output. Clear Ideas will attempt to extract the JSON from the output and make it available for subsequent steps.

Variables

The Variables section lets you define reusable values that can be referenced throughout your AI Workflow steps using Handlebars syntax {{variable-name}}.

Variable Management

  • Add Variable - Create new key-value pairs
  • Edit - Modify existing variable names or values
  • Delete - Remove unused variables
  • Validation - Automatic checks for:
    • Unused Variables - Defined but not referenced in any step
    • Undefined Variables - Referenced in steps but not defined in the variables section
    • Duplicate Output Variable Names - Output variable names must be unique across all steps (including nested child steps)
    • Duplicate Output Variable Names - Output variable names must be unique across all steps (including nested child steps)

Variables can be defined in an AI Workflow and can be reused or redefined in an AI Workflow Job.

Default Variables

AI Workflows automatically include default variables that are available in all steps. These variables are provided in both camelCase and snake_case formats for consistency:

Universal Defaults (available in all contexts):

  • {{date}}, {{currentDate}}, {{current_date}} - Current date in YYYY-MM-DD format
  • {{year}}, {{currentYear}}, {{current_year}} - Current year as string
  • {{month}} - Current month (01-12)
  • {{day}} - Current day (01-31)
  • {{currentDateTime}}, {{current_date_time}} - Current date/time as ISO string

Workflow-Specific Defaults (available when editing workflows):

  • {{workflowName}}, {{workflow_name}} - Name of the workflow
  • {{totalSteps}}, {{total_steps}} - Total number of steps in the workflow
  • {{step-previous}} - Output from the previous step (or previous child step within a loop)
  • {{step-1}}, {{step-2}}, etc. - Output from specific parent steps (always available)
  • Named output variables (e.g., {{summary}}, {{analysis}}) - Custom names assigned to top-level step outputs (if defined)
  • {{step-2-1}}, {{step-2-2}}, etc. - Output from specific child steps (format: step-{parent}-{child})

Workflow Job-Specific Defaults (available when running workflow jobs):

  • {{workflowJobName}}, {{workflow_job_name}} - Name of the workflow job
  • {{stepNumber}}, {{step_number}} - Current step number (1-indexed)

Example Usage (when editing a workflow):

Today is {{date}}. This workflow {{workflowName}} has {{totalSteps}} steps.

Example Usage (when running a workflow job):

Today is {{date}}. This is step {{stepNumber}} of {{totalSteps}} in workflow {{workflowName}}.

Handlebars Syntax

AI Workflows use Handlebars templating for variable replacement in prompts. All variables in prompts use Handlebars syntax: {{variableName}}.

Variable Syntax in Prompts

Simple Variables:

  • Workflow variables: {{userName}}, {{companyName}}
  • Default variables: {{date}}, {{year}}, {{workflowName}}

Step Outputs:

  • Parent steps: {{step-1}}, {{step-2}}, {{step-3}} (always available)
  • Named output variables: {{summary}}, {{analysis}}, {{result}} (if a top-level step has an output variable name defined)
  • Child steps: {{step-2-1}}, {{step-2-2}}, {{step-3-1}} (format: step-{parent}-{child})
  • Container-scoped child steps: {{container-1}}, {{container-2}}, etc. (if container step has output variable name, e.g., container)
  • Previous step: {{step-previous}} (refers to the immediately previous step or child step)

Using Named Output Variables:

  • Top-level steps can optionally define an output variable name (e.g., summary, analysis, result)
  • When defined, the step's output is available both as {{step-N}} and {{outputVariableName}}
  • Named variables make workflows more resilient to step reordering since references use stable names
  • Output variable names must be unique across all top-level steps
  • Container-Scoped Child Step References: If a container step has an output variable name (e.g., container), child steps within that container can be referenced as {{container-1}}, {{container-2}}, etc. This makes child step references resilient to parent step reordering. The numbers (1, 2, 3) still change if child steps are reordered within the container, but the container name remains stable.
  • Both {{step-N}} and named variable references work together for top-level steps - you can use either or both

Dot Notation for Nested Data:

  • {{step-1.address.city}} - Access nested properties in JSON outputs
  • {{summary.address.city}} - Access nested properties using named output variables (top-level steps only)
  • {{item.name}} - Access properties of loop items
  • {{step-2-1.summary}} - Access properties of child step outputs (use step-N-M notation)
  • {{container-1.summary}} - Access properties using container-scoped references (if container has output variable name)

Loop Variables:

  • {{item}} - Current item in the loop (or custom item variable name)
  • {{index}} - Current iteration index (or custom index variable name)
  • {{item.property}} - Access properties of the current item

Conditional Logic in Prompts

Handlebars conditionals work within prompt content:

  • {{#if condition}}...{{else}}...{{/if}} - Conditional rendering
  • {{#unless condition}}...{{/unless}} - Inverse conditional
  • {{#each items}}...{{/each}} - Iterate over arrays (rarely used in workflows)

Example with Conditionals:

{{#if step-previous}}
Based on the previous step: {{step-previous}}
{{else}}
This is the first step.
{{/if}}

Loop Condition Syntax

Important: Loop conditions use expression syntax, not Handlebars conditionals. Variables in conditions are resolved using Handlebars syntax first, then the expression is evaluated.

Valid Condition Examples:

  • {{item.age}} > 25 - Process items where age is greater than 25
  • {{step-1}} > 0 - Process when step-1 output is greater than 0
  • {{item.status}} == 'active' - Process only active items (note: use == for equality)
  • {{index}} < 5 - Process only the first 5 items
  • {{item.price}} > 100 && {{item.inStock}} == true - Multiple conditions with logical AND
  • {{item.category}} == 'electronics' || {{item.price}} < 50 - Logical OR

Supported Operators:

  • Comparison: >, <, >=, <=, ==, !=
  • Logical: && (and), || (or), ! (not)
  • Arithmetic: +, -, *, /, %

Important Notes:

  • Variables in conditions must use Handlebars syntax: {{variableName}}
  • After variable resolution, the expression is evaluated
  • Use == for equality comparisons (not ===)
  • String values should be quoted: 'active', "electronics"
  • Boolean values: true, false (no quotes)
  • If condition is empty, all items are processed

Escaping Handlebars

To include literal {{ characters in your prompt (not as a variable), wrap them in backticks: `{{`

Syntax Highlighting

When editing workflow prompts, Handlebars expressions are automatically highlighted:

  • Default variables (like {{date}}, {{year}}) appear in blue (primary color)
  • Defined variables (workflow variables, step outputs, loop variables) appear in green (success color)
  • Undefined variables appear in red (error color) to indicate they need to be defined
  • Handlebars helpers (like {{#if}}, {{else}}) appear in the info color

Variable Behavior: Undefined variables remain as placeholders in workflow prompts, allowing you to identify and fix them before running the workflow. This helps catch configuration errors early.

Benchmarking

A benchmark is a test run on the final output of an AI Workflow. It helps you evaluate quality, cost, and consistency as you develop or refine workflows.

Benchmark Options

  • Custom Prompt: Define your own benchmark prompt to test for domain‑specific criteria. The benchmark runs after the final output is compiled.
  • Default Benchmark: Built‑in multi‑dimension content analysis that generates a dashboard visualization with scores, benchmark ranges, and feedback per dimension (e.g., Readability, Clarity, Cohesion, Tone, Lexical Diversity, Repetition).
  • Run on Completion: Automatically run the selected benchmark whenever you save changes to the workflow.
  • Manual Test: Run on demand to get up‑to‑date quality and cost feedback.

Benchmarking helps you optimize AI Workflows by providing estimates for:

  • Token usage (input and output)
  • Cost ranges
  • Execution time

See also Workflow Benchmarks for dashboard details.

Scheduling

The Schedules section enables you to configure AI Workflows to run automatically at specified intervals.

Schedule Configuration

  • Frequency: Hourly, daily, weekly, or monthly, including specific times of day.
  • Sites: Run the workflow using private data from selected sites (or All Sites).
  • Variables: Set default variable values for scheduled runs.
  • Status: Activate/pause schedules as needed.
  • Edit/Delete: Modify or remove schedules anytime.

Scheduled AI Workflows run in the background and store their results for later review, perfect for regular reports or data processing tasks.

Running AI Workflows

You can execute AI Workflows in two ways, depending on your needs:

Manual Jobs

Create one-time AI Workflow executions:

  1. Click the "Create AI Workflow Job" button
  2. Enter custom variable values for this specific run
  3. Review the job configuration
  4. Submit to start immediate processing
  5. View results in the Jobs section when complete

Manual jobs are ideal for ad-hoc tasks or when you need custom inputs for a specific situation.

Scheduled Jobs

For recurring needs, configure automated runs:

  1. Create a schedule with the desired timing
  2. Set default variables for all scheduled executions
  3. Activate the schedule
  4. Jobs will run automatically at the specified times
  5. Results are stored in the Jobs section for review

Scheduled jobs provide consistent, hands-off operation for regular processes.

Best Practices

Step Dependencies

  • Chaining - Design steps that build on previous outputs using {{step-previous}} or specific step references like {{step-1}} or named variables like {{summary}}
  • Named Output Variables - Assign descriptive output variable names to top-level steps (e.g., summary, analysis, recommendations) to make your workflow more readable and resilient to step reordering. When you rearrange steps, named variable references remain valid, while {{step-N}} references may need updating.
  • Container-Scoped Child Step References - Assign output variable names to container steps (e.g., processing, extraction) to enable container-scoped child step references like {{processing-1}}, {{processing-2}}. This makes child step references resilient to parent step reordering. For example, if a container step moves from position 2 to position 5, {{processing-1}} references remain valid while {{step-2-1}} would need updating to {{step-5-1}}.
  • Modularity - Create steps with focused, single purposes rather than trying to accomplish too much in one prompt. AI models achieve the best results with clear instructions and context. Breaking complex tasks into discrete, well-defined steps provides better context to the AI model, resulting in improved performance and higher quality outputs. Each step should have a single, clear objective that builds upon previous steps.
  • Error Handling - Include validation steps that can detect and respond to problems in earlier steps

Variable Management

  • Naming - Use clear, descriptive variable names that indicate their purpose.
  • Defaults - Set sensible default values in an AI Workflow that work in most cases.
  • Cleanup - Regularly review and remove unused variables. Unused variables are identified in an AI Workflow.
  • Undefined Variables - Variables that are referenced in a step but not defined in the variables section are identified in an AI Workflow. The variable placeholder will remain in the step, and undefined variables appear in red in the editor to help you identify them.
  • Loop Variables - When using loops, the item variable (e.g., {{item}}) and index variable (e.g., {{index}}) are automatically available within the loop and its child steps, and appear as defined variables in syntax highlighting. You can customize these variable names in the loop configuration - use any name you prefer for the item and index variables to make your workflows more readable and intuitive.
  • Child Step Variables - Child steps can reference previous child steps using nested step notation (e.g., {{step-2-1}} for the first child of step 2) or container-scoped references (e.g., {{container-1}}, {{container-2}} if the container step has an output variable name). Container-scoped references make child steps resilient to parent step reordering since the container name stays the same even if the parent step number changes.
  • Named Output Variables - Top-level steps can optionally define an output variable name (e.g., summary, analysis) that must be unique across all top-level steps. This allows referencing step outputs by name ({{summary}}) instead of position ({{step-1}}), making workflows more resilient to step reordering. Both {{step-N}} and named variable references work together for top-level steps.
  • Dot Notation - Can use JSON dot notation to reference nested data (e.g., {{step-1.address.city}}, {{summary.address.city}}, or {{item.name}}).
  • Variable Scoping - Variables are scoped hierarchically: workflow variables are global, top-level step outputs (both numbered and named) are available to subsequent steps, loop variables are available within loops, and child step outputs (using step-N-M notation) are available to subsequent child steps.

Output Selection

  • Only include steps in the final output that provide meaningful results
  • Consider creating a dedicated summary step at the end that formats results appropriately
  • For complex AI Workflows, use the output template to structure your final results

Output Templates

Output templates allow you to combine outputs from various steps into a cohesive final document. When an output template is configured for a workflow, it processes all available variables to generate the final result.

How Output Templates Work:

  • The template uses Handlebars syntax to reference step outputs: {{step-1}}, {{step-2}}, {{step-2-1}}, etc.
  • You can also reference steps by their named output variables: {{summary}}, {{analysis}}, {{result}}, etc.
  • You can combine multiple step outputs into a structured format
  • Supports conditional logic using Handlebars helpers like {{#if}} and {{#each}}
  • All workflow variables, step outputs (both numbered and named), and default variables are available in the template

Example Output Template:

# Summary Report

## Overview
{{summary}}

## Detailed Analysis
{{step-2}}

## Recommendations
{{recommendations}}

Generated on {{date}} for workflow {{workflowName}}.

In this example, {{summary}} and {{recommendations}} are named output variables, while {{step-2}} uses the step number reference. Both methods work together.

Benefits:

  • Create professional, formatted outputs from multiple step results
  • Maintain consistent structure across workflow runs
  • Combine text and JSON outputs into readable documents
  • Use conditional formatting based on step outputs

Looping

Container Steps Best Practices

  • Use Container Steps for Multi-​Step Processing - When you need to perform multiple sequential operations on each item, use container steps with child steps rather than steps with loop options
  • Container Steps Cannot Have Content - Container steps are containers only - they must have child steps to execute
  • Child Step Sequencing - Design child steps to build on each other, with each step referencing the previous child step's output
  • Variable References - Child steps can reference:
    • Loop variables: {{item}}, {{index}}
    • Previous child steps: {{step-2-1}}, {{step-previous}} (step-N-M notation) OR {{container-1}}, {{container-2}} (if container has output variable name)
    • Parent step outputs: {{step-2}} or named parent output variables (if the parent step has an output variable name)
    • Workflow variables and other steps: {{step-1}}, {{workflowVariable}}, or named output variables like {{summary}} (from top-level steps only)

Loop Configuration

  • Source - Use Handlebars syntax to reference data: {{step-1}}, {{summary}}, {{workflowVariable}} (named variables from top-level steps only)
  • Condition - Use Jexl expressions with Handlebars variables:
    • Variables: {{item.age}} > 25
    • Comparisons: {{step-1}} > 0, {{summary}} > 0, {{item.status}} == 'active'
    • Logical operators: {{item.price}} > 100 && {{item.inStock}} == true
  • Max Iterations - Set limits to prevent processing too many items
  • Item and Index Variables - Customize variable names if needed (default: item and index)

Output Aggregation

  • Container Steps - The final output aggregates results from the last child step across all iterations
  • JSON Outputs - If child steps output JSON, all results are combined into a single JSON array
  • Text Outputs - If child steps output text, results are concatenated
  • Steps with Loop Options - Outputs are aggregated similarly (JSON arrays combined, text concatenated)

Performance Considerations

  • Set appropriate stopping conditions and maximum iterations to prevent infinite loops
  • Consider performance implications for large datasets
  • Use conditions to filter items early in the process
  • Test with small datasets before processing large collections

Validation

  • Address warnings about undefined variables before running jobs
  • Test AI Workflows with benchmark data before scheduling
  • Review the first few manual job runs carefully before setting up scheduled execution

Common Use Cases

  • Document Processing - Extract, summarize, and analyze text from multiple documents
  • Content Generation - Create structured content with research, outlining, drafting, and editing steps
  • Data Analysis - Process data through sequential analysis steps with increasing refinement
  • Research Automation - Gather information, analyze findings, and compile results
  • Scheduled Reporting - Generate regular business reports combining multiple data sources