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:- 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:- Generate social media images
- Create product mockups
- Design marketing materials
- Visualize concepts
Utility Actions
Classify Text
Categorize text using AI:- Triage support tickets
- Categorize emails
- Route messages to teams
- Content moderation
Extract Structured Data
Parse unstructured text into structured JSON:- 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:- Understand the task from the prompt
- Decide which tools to use and in what order
- Query the database for inactive customers
- Generate personalized email content for each
- Send the emails
- 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:- Parse prompt: Understand the task and goals
- Plan approach: Decide which tools to use
- Execute steps: Call tools iteratively
- Evaluate results: Check if task is complete
- Iterate if needed: Continue until success or max steps
- Return output: Provide structured results
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:- Build flows with AI actions
- Expose flows as MCP tools
- Use in Claude Desktop/Cursor
- AI assistants can call your AI-powered workflows
- 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
- MCP Integration - Connect AI agents to Claude and Cursor
- Build Workflows - Learn flow structure and triggers
- Create Pieces - Build AI-powered integrations
- API Reference - Programmatic access to AI features