> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compozy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> Workflows in Compozy are like a smart assembly line for your automation needs. They coordinate multiple operations, handle errors gracefully, and ensure your processes run smoothly and predictably.

export const BrowseRegistry = ({title, description, icon, href}) => <div className="not-prose mb-8">
    <a href={href} className="group relative block overflow-hidden rounded-xl border border-gray-950/10 dark:border-white/10 bg-gradient-to-br from-white to-gray-50 p-1 transition-all hover:border-primary hover:shadow-lg dark:from-background-dark dark:to-background-dark/80">
      <div className="absolute inset-0 bg-gradient-to-r from-primary/0 via-primary/0 to-primary/0 opacity-0 transition-opacity group-hover:opacity-10" />
      <div className="relative flex items-start gap-6 p-5">
        <div className="flex px-8 h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary shadow-sm dark:bg-primary/20 dark:shadow-none">
          <Icon icon={icon} iconType="solid" size={24} />
        </div>

        <div className="flex-1">
          <div className="flex items-center justify-between">
            <h3 className="m-0 text-xl font-semibold text-gray-900 group-hover:text-primary dark:text-white">
              {title}
            </h3>
            <Icon icon="arrow-right" iconType="solid" size={20} className="text-gray-400 transition-transform group-hover:translate-x-1 group-hover:text-primary" />
          </div>
          <p className="m-0 mt-2 text-gray-500 dark:text-gray-400">
            {description}
          </p>
          <div className="mt-4 flex items-center gap-2 text-sm font-medium text-primary">
            Browse Registry
            <Icon icon="chevron-right" iconType="solid" size={12} className="transition-transform group-hover:translate-x-0.5" />
          </div>
        </div>
      </div>
    </a>
  </div>;

<BrowseRegistry title="Browse Registry Workflows" description="Discover pre-built workflows for automation, data processing, and system orchestration in the Compozy registry" icon="diagram-project" href="/registry/workflows" />

## Why Workflows?

Workflows are a way to orchestrate tasks, agents, and MCP servers. Whether you're processing documents, analyzing data, or orchestrating complex business logic, workflows provide the structure you need.

Here's a simple workflow that demonstrates the basic concepts:

<CodeGroup>
  ```yaml Basic Usage theme={"dark"}
  workflow:
    tasks:
      - id: fetch_content
        type: basic
        use: tool(fetch_data)
        on_success:
          next: process_data

      - id: process_data
        type: basic
        use: tool(save_results)
        with:
          data: "{{ tasks.fetch_content.output }}"
  ```

  ```yaml Advanced Usage theme={"dark"}
  workflow:
    tasks:
      - id: parallel_processing
        type: parallel
        config:
          max_concurrent: 3
        execute:
          - use: tool(data_fetch)
          - use: tool(cache_warm)
          - use: agent(data_analyzer)
        on_success:
          next: decision_point

      - id: decision_point
        type: decision
        condition: "{{ tasks.parallel_processing.output.data_analyzer.confidence }}"
        routes:
          ">= 0.8": success_path
          default: review_needed

    on_error:
      max_retries: 2
      execute:
        - use: tool(compozy/tools:error-handler)
  ```
</CodeGroup>

## Core Features

<CardGroup cols={2}>
  <Card title="Task Orchestration" icon="diagram-project">
    Coordinate and sequence multiple tasks with advanced flow control and error handling
  </Card>

  <Card title="Parallel Processing" icon="network-wired">
    Execute multiple tasks concurrently with configurable concurrency limits
  </Card>

  <Card title="Decision Making" icon="code-branch">
    Dynamic routing based on task outputs and conditional logic
  </Card>

  <Card title="Error Management" icon="shield-check">
    Comprehensive error handling with retries, fallbacks, and recovery options
  </Card>

  <Card title="State Management" icon="database">
    Persistent workflow state with recovery mechanisms and execution history
  </Card>

  <Card title="Component Integration" icon="puzzle-piece">
    Seamless integration with tools, agents, and MCP servers
  </Card>
</CardGroup>

## Key Points

<Steps>
  <Step title="Declarative Configuration" icon="file-code">
    Define entire workflows using simple YAML syntax with clear component relationships
  </Step>

  <Step title="Error Resilience" icon="shield">
    Built-in retry mechanisms, alternative paths, and graceful degradation options
  </Step>

  <Step title="Data Integrity" icon="check-double">
    Schema validation, type-safe transformations, and consistent error states
  </Step>

  <Step title="Flow Control" icon="code-branch">
    Dynamic routing, parallel execution, and sophisticated decision points
  </Step>

  <Step title="Composability" icon="puzzle-piece">
    Modular design with reusable components and standardized patterns
  </Step>

  <Step title="Performance" icon="gauge">
    Optimized execution with parallel processing and resource management
  </Step>
</Steps>

## Next Steps

* Learn about [Usage](/core/workflows/usage)
* Explore [Creating Workflows](/core/workflows/creating)
* See [Examples](/core/workflows/examples)
* Check the [API Reference](/core/workflows/api)
