> ## 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.

# Base structure

> Compozy workflows are defined in YAML files that configure AI agents, tools, and data processing. This page covers the key properties of workflow configurations.

## Introduction

Compozy uses a declarative YAML-based approach that makes it easy to create, maintain, and share complex automation workflows. Each configuration file follows a consistent structure that defines how components interact and what resources they can access.

Here's a simple example of a Compozy workflow configuration:

```yaml [expandable] theme={"dark"}
name: content-processor
version: "1.0.0"
description: "Process and analyze content using AI"

# Define the trigger
trigger:
  type: webhook
  url: /workflows/content-processor
  schema:
    content:
      type: string
      description: The content to process

# Define environment variables
env:
  OPENAI_API_KEY: "{{ secrets.OPENAI_API_KEY }}"
  DATABASE_URL: "{{ secrets.DATABASE_URL }}"

# Define available tools
tools:
  - id: content_analyzer
    use: compozy/tools:text-analyzer
    config:
      max_length: 1000

# Configure AI agents
agents:
  - id: content_processor
    use:
      provider: openai
      model: gpt-4o-mini
    tools: [content_analyzer]

# Define workflow tasks
tasks:
  - id: analyze_content
    use: agent(content_processor)
    with:
      content: "{{ trigger.content }}"

  - id: save_results
    use: tool(database-writer)
    with:
      data: "{{ tasks.analyze_content.output }}"
      table: processed_content

# Define the workflow
workflow:
  tasks:
    - id: analyze_content
      on_success:
        next: save_results

    - id: save_results
      on_error:
        next: handle_error

    - id: handle_error
      use: compozy/tools:slack-notifier
      with:
        channel: error-channel
        message: "An error occurred in the workflow: {{ error }}"
```

## Core components

A Compozy workflow configuration can include the following core components:

<CardGroup cols={2}>
  <Card title="Tools" icon="wrench" href="/core/tools/overview">
    Reusable functions that perform specific operations like API calls, data processing, and external service integrations.
  </Card>

  <Card title="Agents" icon="robot" href="/core/agents/overview">
    AI-powered components that can understand instructions, use tools, and make decisions within your workflows.
  </Card>

  <Card title="Tasks" icon="list-check" href="/core/tasks/overview">
    Building blocks that execute specific operations and manage workflow steps with advanced flow control.
  </Card>

  <Card title="MCP Servers" icon="plug" href="/core/mcp/overview">
    Model Context Protocol servers that maintain context across interactions and handle external service integrations.
  </Card>

  <Card title="Memory" icon="brain" href="/core/memory/overview">
    Context management system that maintains state, conversation history, and enables semantic search across interactions.
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/core/workflows/overview">
    Declarative YAML-based orchestration that combines tasks, agents, and tools into automated processes.
  </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="Component-Based" icon="puzzle-piece">
    Built around core components like tools, agents, and tasks that work together seamlessly
  </Step>

  <Step title="Context-Aware" icon="brain">
    Maintains state and context across workflow executions through the memory system
  </Step>

  <Step title="Extensible" icon="boxes-stacked">
    Easy to add new tools, integrate with external services, and customize behavior
  </Step>
</Steps>

## Next Steps

* Follow our step-by-step guide to [Create Your First Workflow](/quickstart)
* Deep dive into [Compozy's Core Components](/core/components)
* Learn from [Real-world Examples](/examples)
* Connect with other [Compozy Developers](/community)
