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 tool 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:
    • Select from predefined templates
    • Use variables like {{step-1}} to reference specific step outputs
  • 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 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
  • Edit - Modify content with the full prompt editor
  • 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
  • Loop - Enable iterative processing:
    • Configure source data and loop variables to loop through
    • Optionally, define a condition to check for each item in the source data
    • Set a maximum number of iterations
    • Define how outputs are aggregated
    • Can use JSON dot notation to reference nested data
    • Source of data can be a variable or a prior step output
  • Delete - Remove a step (with indicators if it's referenced by other steps)

Step Visualization

  • Connection Lines - Visual indicators showing relationships between steps
  • Step Numbers - Sequential identifiers for referencing
  • Warning Indicators - Highlight when steps are unused or have configuration issues
  • Output Indicators - Show which steps contribute to the final result

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.
  • Fenced Code Block - If a step output contains JSON within a fenced code block, 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.

JSON Step Loop Example

Additionally, you can access an array of objects in a similar manner by using a step loop. For example:

[
  {
    "name": "John Doe",
    "age": 30
  },
  {
    "name": "Jane Doe",
    "age": 25
  }
]

Step 2 can iterate over the array of object by setting the Source to {{step-1}} and the Item Variable to item (item by default, but can be changed). This will create a new variable for each item in the array called item. You can then reference the current item in the loop by using {{item}} or specific values within the item using dot notation, for example {{item.name}} or {{item.age}}.

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 the 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

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

Benchmarking

A benchmark is a test run on the final output of an AI Workflow. It can be a useful tool to measure the performance of an AI Workflow as it is being developed or changes are made.

Benchmark Options

  • Custom Prompt - You can define a custom prompt to use for the benchmark. The benchmark output will be generated following the compilation of the final output.
  • Default Prompt - A default prompt that generates a multi-dimension benchmark and visualization. The The benchmark benchmark. the benchma
  • Run on Completion - Automatically benchmark after making changes
  • Manual Test - Run a benchmark on demand to see cost and performance estimates

Benchmarking helps you optimize AI Workflows by providing estimates for:

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

Scheduling

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

Schedule Configuration

  • Frequency - Set when jobs should run:
    • Daily, weekly, or monthly patterns
    • Specific times of day
  • Variables - Define custom variable values for scheduled runs
  • Status - Set individual schedules as active or paused
  • Edit/Delete - Modify or remove existing schedules

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}}
  • Modularity - Create steps with focused, single purposes rather than trying to accomplish too much in one prompt
  • 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.
  • Dot Notation - Can use JSON dot notation to reference nested data.

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

Looping

  • Use loops to process collections of data without duplicating steps
  • Set appropriate stopping conditions and maximum iterations to prevent infinite loops
  • Consider performance implications for large datasets

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