Exercise 4: Connecting Multiple Workflows

Build an intelligent email response system by connecting three separate workflows together: a master orchestrator, an email classifier, and an LLM-as-a-judge response generator.


75-Minute Hands-On Exercise

This exercise teaches you to build complex automation systems by connecting multiple workflows together. Learn how to create modular, reusable workflows that can call each other, passing data between them to solve complex business problems. Think of it like conducting an orchestra—each workflow plays its part, and you’re coordinating them into a harmonious system.

The Problem: As automations grow, building everything in one workflow creates unmanageable “spaghetti code.” You can’t reuse logic, debugging becomes difficult, and multiple people can’t work on different parts. You need a modular approach where workflows call each other like functions in programming.

What You’ll Build

A complete multi-workflow orchestration system featuring:

  • Master orchestrator workflow that fetches emails and coordinates sub-workflows
  • Email classifier sub-workflow that categorises incoming messages
  • Response generator sub-workflow that creates quality-controlled replies
  • Execute Workflow Triggers enabling inter-workflow communication
  • Structured data passing with defined inputs and outputs between workflows
  • Dual triggers allowing standalone testing and production orchestration
graph TB
    A[Master: Fetch Email] --> B[Call Classifier]
    B --> C[Receive Category]
    C --> D[Call Generator]
    D --> E[Receive Response]
    E --> F[Master: Send Reply]

    style A fill:#e1f5fe
    style B fill:#fff3e0
    style D fill:#ffecb3
    style F fill:#e8f5e9

Restaurant Kitchen Analogy:

Just like a head chef coordinates specialized stations:

  • Head Chef (Master Workflow) receives orders and coordinates
  • Prep Station (Classifier) categorises and prepares ingredients
  • Main Kitchen (Generator) cooks the dish with quality checks
  • Head Chef plates and serves the final product

Skills You’ll Demonstrate

By completing this exercise, you will have demonstrated:

  • Workflow Composition: Breaking complex processes into reusable components
  • Inter-Workflow Communication: Configuring Execute Workflow nodes and triggers
  • Data Contract Design: Defining clear inputs/outputs between workflows
  • Dual-Trigger Architecture: Supporting both standalone testing and production orchestration
  • Modular System Design: Building maintainable, scalable automation architectures

The Pattern You’ll Master

The Workflow Orchestration & Composition pattern you’ll learn applies to:

  • Customer Support: Route tickets → Classify urgency → Generate response → Assign agent
  • Content Pipeline: Plan content → Generate drafts → Review quality → Schedule publishing
  • Order Fulfilment: Receive order → Check inventory → Process payment → Ship product
  • Data Processing: Ingest data → Validate format → Transform structure → Load to database
  • Lead Management: Capture lead → Score quality → Enrich data → Route to sales
  • Invoice Processing: Extract data → Validate information → Approve payment → Update accounts

Exercise Structure

⚙️ Part A: Setup

Prerequisites & configuration (15 min)

Start here →

🔧 Part B: Build & Test

Create workflows and connections (55 min)

Build →

🏆 Challenges

Advanced extensions (optional)

Level up →

Quick Navigation

Section Description Duration
Part A: Setup Prerequisites, API setup 15 min
Part B: Build & Test Build three workflows and connect them 55 min
Challenges Error handling, parallel execution, monitoring Optional


Table of contents


Back to top

Copyright © 2024 AI Automation Mastery. Built with Jekyll and Just the Docs.