Skip to main content

AI Agents in Activepieces

Activepieces is AI-first, providing native AI capabilities that let you build intelligent workflows capable of reasoning, decision-making, and multi-step task execution. With support for multiple AI providers and a powerful agent framework, you can create automations that go far beyond simple if-then logic.

What are AI Agents?

AI agents in Activepieces are intelligent automation components that can:
  • Reason through problems: Analyze situations and determine the best course of action
  • Use tools: Call other Activepieces actions, APIs, and MCP servers to accomplish tasks
  • Iterate until complete: Keep working on a task until it’s successfully done
  • Extract structured data: Parse unstructured text into organized information
  • Make decisions: Choose different workflow paths based on AI analysis
  • Generate content: Create text, images, and other media
AI agents can handle complex, multi-step tasks that would traditionally require extensive programming and conditional logic.

AI Piece

Activepieces includes a powerful AI piece with multiple actions:

Text Actions

Ask AI

Generate text using AI models:
Use cases:
  • Summarize documents
  • Generate emails and messages
  • Create product descriptions
  • Answer questions
  • Translate text

Summarize Text

Condense long content:

Image Generation

Generate images from text descriptions:
Use cases:
  • Generate social media images
  • Create product mockups
  • Design marketing materials
  • Visualize concepts

Utility Actions

Classify Text

Categorize text using AI:
Use cases:
  • Triage support tickets
  • Categorize emails
  • Route messages to teams
  • Content moderation

Extract Structured Data

Parse unstructured text into structured JSON:
Output:
Use cases:
  • Extract data from emails
  • Parse invoices and receipts
  • Process form submissions
  • Structure customer feedback

Agent Actions

Run Agent

The most powerful AI action - agents that can use tools and reason through complex tasks:
The agent will:
  1. Understand the task from the prompt
  2. Decide which tools to use and in what order
  3. Query the database for inactive customers
  4. Generate personalized email content for each
  5. Send the emails
  6. Return structured results

AI Providers

Activepieces supports multiple AI providers through the Vercel AI SDK:

Supported Providers

Based on the source code, Activepieces integrates with:
  • OpenAI: GPT-4, GPT-4 Turbo, GPT-3.5, DALL-E
  • Anthropic: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku
  • Google: Gemini Pro, Gemini Pro Vision
  • Google Vertex AI: Vertex Gemini models
  • Azure OpenAI: Azure-hosted OpenAI models
  • Replicate: Open source models
  • OpenRouter: Access to multiple providers
  • Custom OpenAI-compatible: Any OpenAI-compatible API

Provider Configuration

Agent Tools

Agents can use various types of tools to accomplish tasks:

Piece Tools

Call any Activepieces piece action:

Flow Tools

Execute another flow as a tool:

MCP Tools

Call external MCP servers:

Building AI Workflows

Example 1: Intelligent Customer Support

Example 2: Content Generation Pipeline

AI SDK Integration

Activepieces uses the Vercel AI SDK (ai package) for AI operations:

Agent Execution Flow

When an agent runs:
  1. Parse prompt: Understand the task and goals
  2. Plan approach: Decide which tools to use
  3. Execute steps: Call tools iteratively
  4. Evaluate results: Check if task is complete
  5. Iterate if needed: Continue until success or max steps
  6. Return output: Provide structured results
From the source code:

Best Practices

Clear Prompts

Write detailed, specific prompts. Include context, constraints, and expected output format.

Structured Output

Define structured output schemas so you can reliably use agent results in subsequent steps.

Limit Tools

Give agents only the tools they need. Too many tools can confuse the AI.

Test Iterations

Test with different prompts and tool combinations to find what works best.

Monitor Costs

AI API calls cost money. Monitor usage and optimize prompts to reduce token consumption.

Fallback Logic

Add error handling and fallback paths for when AI responses don’t meet expectations.

AI + MCP: Powerful Combination

Combine AI agents with MCP servers for ultimate flexibility:
  1. Build flows with AI actions
  2. Expose flows as MCP tools
  3. Use in Claude Desktop/Cursor
  4. AI assistants can call your AI-powered workflows
This creates a powerful cycle where:
  • AI assistants use your workflows
  • Your workflows use AI to be intelligent
  • Everything is connected through MCP
This is the future of automation: AI-powered workflows that are themselves accessible to AI assistants.

Example Use Cases

Smart Email Processing

Classify, extract data, and route emails intelligently based on content and context.

Content Moderation

Analyze user-generated content for policy violations, spam, or inappropriate material.

Customer Analytics

Analyze customer feedback, identify trends, and generate insights automatically.

Document Processing

Extract structured data from invoices, receipts, contracts, and other documents.

Lead Qualification

Analyze leads, enrich data, and route to appropriate sales reps.

Content Creation

Generate blog posts, social media content, and marketing materials at scale.

Smart Routing

Route tickets, messages, and tasks to the right team based on AI analysis.

Data Enrichment

Enhance records with additional information from various sources.

Next Steps