Activepieces AI: Complete Guide to Setup and Automation Examples
Learn how to set up AI in Activepieces, connect OpenAI/Claude/Ollama, and build real automations. Includes email summarization, feedback routing, and cost control strategies.
- AI pieces in Activepieces integrate OpenAI, Claude, and Ollama directly into workflows for classification, summarization, and content generation without custom code.
- Setup requires connecting an LLM API key (free for testing, paid for scale) and adding AI steps to your workflow in the web builder.
- Three practical examples: email summarization to Notion ($0.002 per email), customer feedback routing to Slack with sentiment analysis, and daily content-idea generation.
- Monitor token spend in execution logs; typical monthly costs range from $1 to $100 depending on automation frequency and model choice.
- Use local Ollama for privacy-sensitive data and zero per-token cost; use OpenAI or Claude for speed and maturity.
AI pieces in Activepieces are workflow steps that integrate large language models like OpenAI, Claude, and Ollama directly into your automations. They let you add intelligence to workflows without custom code: summarize emails, classify data, generate content, or route messages based on meaning. This guide walks you through setup, real examples, and cost control.
What Are AI Pieces and Agents in Activepieces?
AI pieces are built-in workflow steps that call external language models or run structured transformations on text, images, or data. They differ from standard pieces because they inject reasoning into your workflow decision tree instead of just passing data through. Activepieces calls these "AI Steps" and they come in three flavors: text generation, image analysis, and utility operations like classification or moderation.
AI agents in Activepieces take this further. An agent is a loop that lets an LLM make decisions, take actions, and loop back until it completes a task. Instead of you scripting every branch, the agent figures out what to do next. This powers complex tasks like auto-responding to customer emails or building step-by-step processes that adapt to what it finds.
Model Context Protocol (MCP) is the bridge. MCP lets Claude and other models "see" all 280+ apps Activepieces integrates with as tools they can call directly. Instead of chaining steps manually, you describe the end goal to Claude, and MCP-aware agents fetch data from your CRM, write to Slack, or update spreadsheets on their own. It's automation that reasons instead of just routing.
Activepieces' native AI modules handle structured work without hitting external APIs. Text classification, sentiment analysis, content moderation, and JSON extraction run directly in the platform. Use these when you need repeatable logic without token spend.
Getting Started: Enabling AI in Your Activepieces Instance
AI features are enabled by default on Activepieces Cloud and most self-hosted deployments. You do not need a separate paid tier to start using them. Free accounts get a limited monthly allowance of LLM API calls. Self-hosted instances require you to bring your own API keys from OpenAI, Anthropic, or other providers.
To enable AI pieces in the web builder, you need an LLM provider configured. Log into your Activepieces instance and navigate to Settings > Pieces. Look for "AI" or "Language Model" in the pieces list. The UI will prompt you to connect an AI provider. Click "Add AI Provider" and choose your model source: OpenAI (ChatGPT), Anthropic (Claude), Ollama (local), or others.
Storage of API keys matters for security. Activepieces encrypts keys at rest and never logs them. If you self-host, your keys live in your database. If you use Activepieces Cloud, keys are stored in encrypted vaults managed by Opsily. Never commit API keys to version control or share them in logs.
Testing AI steps is done in the flow builder. Add an AI step, configure it, and click "Test." The builder fetches a real response so you see token usage and latency before publishing. This matters because it prevents wasting budget on malformed prompts.
Connecting OpenAI, Claude, and Ollama to Activepieces
OpenAI is the quickest start. You need an API key from platform.openai.com. Go to Settings > Organization > API Keys, create a new key, and copy it. In Activepieces, add the key under AI Settings, select your model (gpt-4o, gpt-4-turbo, or gpt-3.5-turbo), and set temperature (0 for deterministic output, 1 for creative). For most automations, use temperature 0.2 to 0.5. Rate limits depend on your OpenAI account tier; free accounts get 3 requests per minute.
Claude integration works the same way. Get an API key from console.anthropic.com, add it in Activepieces, and choose your model (claude-opus-4-1, claude-sonnet-4, or claude-haiku-3). Claude's strengths are nuanced language understanding and long-context analysis (200K token window, useful for processing entire documents). Anthropic pricing is per-token and competitive with OpenAI. No rate limits for free tier; paid accounts get standard API access.
Ollama lets you run a language model locally, on your server or laptop. Download Ollama from ollama.ai, install it, and run a model like ollama pull llama2. By default it listens on port 11434 of your local machine. To connect from Activepieces self-hosted, configure the AI provider to point at your Ollama endpoint and choose the model name (llama2, mistral, neural-chat). The advantage is zero per-token cost and data stays local. The tradeoff is latency and inference speed depend entirely on your hardware. A GPU accelerates responses; CPU-only inference can be slow for large prompts.
Comparison: OpenAI gpt-4o costs $0.03 per 1K input tokens and $0.12 per 1K output tokens. Claude Sonnet costs $0.003 input, $0.015 output. Ollama local costs zero but needs hardware. Choose OpenAI for speed and feature maturity, Claude for nuance and long context, Ollama for privacy and zero costs.
Example 1: Email Summarization with AI
This workflow reads new emails from Gmail, summarizes them to bullet points, and saves the summary to Notion. You build it with five steps: trigger, fetch email body, call OpenAI, parse response, write to Notion.
Step 1: Trigger on "New Email Received." Filter to specific senders or labels to avoid processing every email.
Step 2: Add a "Gmail" step and select "Get Email Details." This extracts the full email body, sender, and subject from the trigger payload.
Step 3: Add an "AI" step. Configure it as follows:
- Model: gpt-3.5-turbo
- Prompt: "Summarize the following email in 3-5 bullet points. Return only the bullets, no preamble. Email: {{email_body}}"
- Temperature: 0.1
Step 4: Parse the response. AI steps return plain text. If you need structured output (JSON), add a "Text" step that transforms the response: use regex or JSON parse depending on the format.
Step 5: "Create a Notion Page" in your database with title from email subject and content from the AI summary.
Publish. Every new email triggers the workflow. Cost per email is roughly $0.002 at current gpt-3.5-turbo rates. At 500 emails per month, expect around $1 monthly.
Example 2: AI-Powered Customer Feedback Routing
This workflow routes customer form submissions to the right Slack channel based on sentiment and topic. Setup: a form trigger, Claude API, conditional logic, and Slack sends.
Step 1: Listen for form submissions. Capture feedback text, customer name, and email.
Step 2: Call Claude with structured output:
- Prompt: "Analyze this customer feedback. Return JSON with keys: sentiment (positive/neutral/negative), category (feature_request/bug/billing/general), priority (high/medium/low). Feedback: {{feedback_text}}"
- Temperature: 0.2
Step 3: Parse the JSON response into variables: $sentiment, $category, $priority.
Step 4: Conditional branch. If category == "bug" AND priority == "high", send to #critical-bugs. If sentiment == "negative", send to #escalations. Otherwise, send to #general-feedback.
Step 5: Send a Slack message to the routed channel. Include customer name, email, category, and priority tags.
This removes manual triage. Your team gets feedback pre-classified, high-priority issues bubble up, and negative sentiment flags are visible immediately.
Example 3: Content Ideas from Structured Data
This workflow runs daily, fetches trending topics from a Google Sheet, asks Claude to brainstorm content, and posts ideas to a Slack channel.
Step 1: Trigger on "Schedule." Set to run daily at 9 AM.
Step 2: "Google Sheets" step: Read data from your trending-topics sheet (fetch the last 10 rows).
Step 3: Loop over each topic. For each row, call Claude:
- Prompt: "Given the trend: {{topic_name}}, generate 3 unique blog post titles that would rank on search engines and engage our audience. Return as JSON array: { titles: ["...", "...", "..."] }"
- Temperature: 0.7
Step 4: Parse the JSON response and transform into bullet points.
Step 5: Send aggregated ideas to a Slack channel as a message: "Daily Content Ideas" with all topics and suggested titles.
Step 6: Optionally log the entire payload to Airtable for historical reference.
This automates ideation. Your team wakes up to pre-generated, reasoned content ideas instead of brainstorming from scratch.
Controlling Costs: Monitoring and Budgeting AI Automations
Token usage is the lever. Every API call to an LLM counts tokens for input and output. OpenAI's pricing is public: gpt-4o, $0.03/$0.12 per 1K tokens (input/output). Claude Sonnet, $0.003/$0.015. Free tiers offer allowances: Activepieces Cloud free gives 10,000 input tokens monthly; OpenAI free trial gives $5 credit.
Estimate cost per execution. A typical email summary uses 300 input tokens (the email body) and 100 output tokens (the bullet points). At gpt-3.5-turbo ($0.0005 input, $0.0015 output), that's $0.0002 per email. At 1000 monthly emails, expect $0.20. Multiply by all workflows.
Monitor spending in Activepieces logs. Each execution log shows tokens consumed. Export logs to Airtable or BigQuery for cost trending. Set up alerts: if token spend exceeds a threshold in a week, notify your team.
Optimize to cut costs. Use gpt-3.5-turbo instead of gpt-4o when accuracy permits (10x cheaper). Batch processing: instead of triggering per email, collect 10 emails hourly and summarize in one batch. Use local Ollama for development and testing; swap to OpenAI in production. Use Activepieces' built-in text steps (classification, extraction) instead of LLM calls when the task is simple.
For budget capping, use OpenAI's usage limits or Anthropic's rate limits. Set a hard spend cap in your LLM provider console. If automations hit the limit, they fail instead of running up a bill.
Common Gotchas and Best Practices
API rate limits stop your workflow. OpenAI free tier: 3 requests per minute. Paid: 3,500 requests per minute (GPT-4). If your automation triggers faster, requests queue or fail. Solution: add a retry step with exponential backoff. Activepieces includes retry logic; configure it as "Retry 3 times with 5-second delay."
Structured outputs prevent downstream errors. If your AI step returns freeform text but your next step expects JSON, the workflow breaks. Always ask the LLM to return JSON and validate the schema before using the result. Use a "Parse JSON" step; if parsing fails, log the raw output and halt with an error.
Data privacy: external AI calls send data to OpenAI, Claude, or wherever you route them. For sensitive data (PII, financial records), use local Ollama or redact before sending. If using OpenAI, enable the "Data Privacy" setting and confirm it meets your compliance requirements.
Testing with real data beats assumptions. Always test workflows end-to-end with sample data before publishing. Check token usage, latency, and output quality. A malformed prompt can waste budget fast.
Fallback gracefully. If an AI API fails, your workflow halts. Add error handling: if the AI step times out or returns an error, log it and skip to a human-review step or send to a queue for manual processing.
For privacy-sensitive workflows, consider self-hosted AI. Opsily manages hosted instances of Activepieces on your infrastructure; you can run Ollama locally on the same server and keep all data in-house. See the self-hosted guide at /hosting/activepieces/activepieces-self-hosted for deployment details.
Frequently Asked Questions
What is Model Context Protocol (MCP) and how does it work with Activepieces? MCP is a protocol that lets Claude see all your connected apps as tools. Instead of scripting 10 steps, you tell Claude the goal and MCP lets it call Notion, Slack, or Airtable directly. Activepieces exposes 280+ integrations as MCP tools when you use Claude AI agents.
Can I use Claude, ChatGPT, and Ollama in the same Activepieces workflow? Yes. Each AI step specifies which provider to use. You can call ChatGPT for classification, then Claude for long-form writing, then Ollama for a local model. This lets you optimize cost and latency per task.
How much does it cost to run AI automations in Activepieces? Costs depend on your LLM provider and token usage. A simple classification task costs $0.0001 per execution; a long summarization costs $0.01. Monthly spend scales with execution frequency. For 1000 daily automations with light LLM use, budget $50-100/month for API costs.
Can I use Activepieces AI agents with my own LLM, like Ollama? Yes. Configure Ollama as your AI provider and agents work the same way. Speed depends on your hardware. Local inference is free but slower than cloud APIs.
What are AI pieces versus AI agents? AI pieces are single steps: classify, summarize, extract. AI agents are loops: they reason, take actions, and repeat until a goal is reached. Pieces are simpler; agents handle complex multi-step problems.
How do I connect OpenAI API to Activepieces? Get an API key from platform.openai.com, go to Activepieces Settings > AI, add the key, and select your model and temperature. Test the connection and start using it in workflows.
How do I set up AI-powered email summarization with Activepieces? Use the Gmail trigger, add a "Get Email Body" step, call an OpenAI AI step with a summarization prompt, parse the result, and send to Notion or your documentation tool.
The Bottom Line
AI in Activepieces removes the manual, repetitive parts of your workflows. Email triage, data classification, content generation, and routing now happen without human intervention. Start with a simple AI step like summarization to learn token costs and latency. Then build a multi-step automation and watch your team focus on what needs judgment, not data entry.
To explore AI automations and pricing options tailored to your deployment choice, visit /hosting/activepieces for the full feature overview and setup guides.