Skip to main content

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:
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:

Tools

Reusable functions that perform specific operations like API calls, data processing, and external service integrations.

Agents

AI-powered components that can understand instructions, use tools, and make decisions within your workflows.

Tasks

Building blocks that execute specific operations and manage workflow steps with advanced flow control.

MCP Servers

Model Context Protocol servers that maintain context across interactions and handle external service integrations.

Memory

Context management system that maintains state, conversation history, and enables semantic search across interactions.

Workflows

Declarative YAML-based orchestration that combines tasks, agents, and tools into automated processes.

Key Points

Declarative Configuration

Define entire workflows using simple YAML syntax with clear component relationships

Component-Based

Built around core components like tools, agents, and tasks that work together seamlessly

Context-Aware

Maintains state and context across workflow executions through the memory system

Extensible

Easy to add new tools, integrate with external services, and customize behavior

Next Steps