Transform your ideas into powerful AI workflows in minutes! In this guide, we’ll build a workflow that combines web content fetching with AI analysis - perfect for content curation, research, or monitoring applications.

Prerequisites

Install the Compozy CLI using one of these methods:

# Using npm
npm install -g @compozy/cli

# Using pnpm
pnpm add -g @compozy/cli

# Using bun
bun install -g @compozy/cli

Your First Workflow

You’ll learn how to use webhooks to create HTTP endpoints, integrate with tools for web scraping, and leverage AI agents for intelligent text analysis. This workflow showcases the building blocks you need to create sophisticated AI-powered applications.

Want to take it further? Explore our workflow examples to learn how to:

  • Process content at scale with parallel execution
  • Extract structured data with custom AI agents
  • Connect to your favorite tools and databases
  • Build complex automation pipelines

Let’s get started! 🚀

1

Initialize a new project

compozy init content-workflow
cd content-workflow
2

Add your dependencies

# Add the text analysis agent
compozy add compozy/agents:text-analyzer

# Add the content fetcher tool
compozy add compozy/tools:web-content
3

Set up basic workflow information

Create a new file workflows/analyze.yaml and start adding the basic workflow information:

name: content-analyzer
version: 1.0.0
description: "AI-powered content analysis workflow"
4

Configure the webhook trigger

Define how your workflow will be invoked:

trigger:
  type: webhook
  config:
    url: /analyze-content
    method: POST
  schema:
    url:
      required: true
      type: string
      description: "URL of the content to analyze"

There are many different triggers available, you can learn more about them here.

5

Add your workflows tasks

Now is when you define the flow of your workflow and which tasks, tools and agents will be used.

workflow:
  tasks:
    # Fetch the content from the URL
    - id: fetch_content
      type: basic
      use: tool(web-content)
      with:
        url: "{{ trigger.url }}"
      on_success:
        next: analyze_text

    # Analyze the fetched content
    - id: analyze_text
      type: basic
      use: agent(text-analyzer)
      with:
        content: "{{ tasks.fetch_content.output.text }}"

We break this is parts, but the final result is an one single YAML file. You can check the final workflow file here.

6

Test your workflow

  1. Start the development server:
compozy dev serve

This will start your service and create an endpoint at http://localhost:3000/analyze-content

  1. Test the workflow using the CLI:
compozy workflow trigger analyze-content \
  --data '{"url": "https://example.com/article"}'
7

Optional: Deploy to Production

You can deploy your workflow to Compozy Cloud or to your own infrastructure:

# Sign up at https://app.compozy.dev
compozy login
compozy deploy

Your workflow will be available at: https://<your-project>.compozy.dev/analyze-content

What’s Next?