This tutorial demonstrates how to build a complete multi-AI agent workflow that generates YouTube titles and descriptions, allows user approval with iterative editing, and sends the approved content via email.

Learning Objectives

  • Building multi-agent workflows with specialized agents
  • Using variables to pass data between agents
  • Implementing Human-in-the-Loop with iterative refinement
  • Concatenating outputs for downstream processing
  • Integrating email automation

Step-by-Step Guide

Step 1: Add the YouTube Title Generator Agent
  1. Click to add a new workflow action
  2. Select "Invoke agent"
  3. Name the action "YT title gen"
  4. Select the YouTube title generator agent
  5. Input message is set to system last message by default
  6. Save the workflow
Step 2: Add Description Generator and Editor Agents
  1. Add second Invoke agent: "youtube description action"
  2. Add third Invoke agent: "YouTube title description edit action"
  3. Switch to vertical layout for easier viewing
Step 3: Implement Variables for Parallel Input

Ensure both generators receive the initial user input, and the editor receives both outputs.

  1. Add a Set Variable action after the start section
  2. Create variable "local userinput"
  3. Set value to system.last message.text
  4. Update both generators to use local userinput as input
  5. Capture outputs: YouTube Title output, YouTube Description output
Step 4: Concatenate Output for the Editor
  1. Add Set Variable action
  2. Create variable "YouTube title description output"
  3. Set value to concatenation of Title + Description outputs
  4. Update Editor input to use this concatenated variable
Step 5: Adding Human-in-the-Loop (Conditional Approval)
  1. Add "Ask a Question" action
  2. Display the editor output in the question
  3. Ask: "Do you approve? Type YES or describe what changes you want."
  4. Save response to "approval input" variable
Step 6: Implement If/Then/Else and Loop
  1. Add If/Then/Else block
  2. IF condition: user response equals "yes" -> proceed to email
  3. ELSE: Set variable combining outputs + user feedback
  4. Use Go To action to loop back to title generator
  5. Workflow re-runs with new context until approval
Step 7: Email Integration
  1. Add Set Variable for "email prompt"
  2. Concatenate: recipient address + subject + body (approved content)
  3. Add Invoke Agent for email agent
  4. Use email prompt variable as input

Key Concepts

Variables carry context: Each loop iteration adds user feedback to the context, so the AI "remembers" what was tried before.
Go To creates loops: The workflow cycles back to regenerate content until the user types "yes" to approve.
Concatenation combines outputs: Multiple agent outputs are combined into single variables for downstream processing.
Human approval gates: The workflow pauses and waits for user input before proceeding.