Workflows

Introduction to Workflows

Learn how workflows chain multiple AI agents together to automate complex multi-step processes.

February 6, 2024
5 min read

Workflows allow you to chain multiple AI agents together to automate complex, multi-step processes. Instead of manually coordinating between agents, workflows handle the orchestration automatically.

What are Workflows?

A workflow is an automated sequence of AI agent tasks that work together to accomplish a goal. Each task in a workflow is handled by a specific agent, and the output from one task can flow into the next.

Example use cases:

  • Content creation pipeline: Research → Write → Edit → Publish
  • Lead processing: Qualify → Enrich → Score → Route
  • Support ticket handling: Categorize → Research → Draft Response → Review

Workflow Types

AffinityBots supports two types of workflows:

Sequential Workflows

Tasks execute in a linear chain, one after another. The output from each task flows to the next in sequence.

Trigger → Task 1 → Task 2 → Task 3 → Output

Best for:

  • Predictable, step-by-step processes
  • Content pipelines with clear stages
  • Data transformation workflows

Example: A blog post workflow where:

  1. Research Agent gathers information on a topic
  2. Writer Agent creates a draft
  3. Editor Agent refines and polishes the content

Orchestrator Workflows

A manager agent dynamically decides which worker agents to use and in what order. The manager analyzes the goal, delegates tasks, and synthesizes results.

Trigger → Manager Agent ⟷ Worker Agents → Output

Best for:

  • Complex problems requiring adaptive decision-making
  • Tasks where the best approach isn't predetermined
  • Situations requiring judgment about which agents to involve

Example: A customer inquiry workflow where:

  • Manager Agent analyzes the question type
  • Delegates to appropriate specialist (Technical Support, Billing, Sales)
  • Synthesizes the response before sending

Key Concepts

Triggers

Triggers define how a workflow starts. Options include:

  • Manual: Start via UI or API
  • Webhook: Start when external system sends data
  • Schedule: Run on a cron schedule (hourly, daily, etc.)
  • Form: Collect user input before starting
  • Integration: Start from connected apps (coming soon)

Tasks

Tasks are the work units within a workflow. Each task:

  • Is assigned to a specific AI agent
  • Has configurable context settings
  • Can include custom instructions
  • Produces output for the next step

Context Control

Control how much information flows between tasks:

  • Full Context: Agent sees entire conversation history
  • Isolated: Agent starts fresh with just the input
  • Custom Instructions: Additional guidance per task

Thread Management

Choose how conversations are managed:

  • Shared Thread: All tasks share context
  • Separate Threads: Each task has isolated context

When to Use Each Type

ScenarioRecommended Type
Fixed, predictable processSequential
Dynamic, adaptive processOrchestrator
Simple automationSequential
Complex decision-makingOrchestrator
Content pipelineSequential
Customer service routingOrchestrator

Getting Started

Ready to build your first workflow? Head to the Creating a Workflow guide to get started.

Related Guides