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

Manager/hub-style delegation

Within the same workflow builder, you can add tasks that delegate dynamically to other agents. A hub task analyzes the goal and routes work to the right agents, then continues the flow.

Trigger → Hub Task ⟷ Other agents → Next tasks → 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:

  • A hub task analyzes the question type
  • Delegates to the appropriate specialist (Technical Support, Billing, Sales)
  • Results flow into later sequential steps or a final output

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 processManager/hub delegation
Simple automationSequential
Complex decision-makingManager/hub delegation
Content pipelineSequential
Customer service routingManager/hub delegation

Getting Started

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

Related Guides