Understanding Pieces
Pieces are the building blocks of Activepieces - they’re integrations that connect your workflows to external services and APIs. With over 600 pieces available, you can integrate with nearly any service, and if one doesn’t exist, you can easily create your own using TypeScript.What are Pieces?
A piece is a packaged integration that provides:- Actions: Operations you can perform (send email, create record, etc.)
- Triggers: Events that start flows (new email, form submission, etc.)
- Authentication: Secure connection management
- Properties: Configurable inputs for actions and triggers
Piece Structure
Based on the Activepieces framework source code, here’s how pieces are defined:Types of Pieces
Activepieces organizes pieces into three categories:Core Pieces
Core pieces are essential integrations maintained by the Activepieces team. Located inpackages/pieces/core/, there are 26 core pieces including:
- HTTP: Make requests to any API
- Code: Write custom JavaScript/TypeScript
- Schedule: Trigger flows on a schedule
- Webhook: Receive HTTP requests
- Data Mapper: Transform and manipulate data
- AI: AI-powered text, image, and agent operations
- Always available
- Battle-tested and reliable
- Maintained with every Activepieces release
- Include fundamental workflow operations
Community Pieces
Community pieces are integrations contributed by the open source community. Located inpackages/pieces/community/, there are 597+ community pieces including:
- Google Sheets, Gmail, Google Drive
- Slack, Discord, Microsoft Teams
- OpenAI, Anthropic, Replicate
- Airtable, Notion, Asana
- Stripe, PayPal, Shopify
- And hundreds more!
Over 95% of Activepieces pieces are contributed by the community, making it one of the most contributor-friendly automation platforms.
- Open source and published to npmjs.com
- Independently versioned
- Community-maintained
- Constantly growing with new contributions
Custom Pieces
Custom pieces are private integrations you build for your specific needs. Located inpackages/pieces/custom/, these pieces:
- Stay private to your instance
- Can be proprietary integrations
- Work with internal APIs
- Follow the same framework as community pieces
Piece Components
Authentication
Pieces support multiple authentication methods:OAuth2
API Key
Basic Auth
Custom Auth
No Auth
Actions
Actions are operations your piece can perform. Example from the Activepieces Platform piece:Triggers
Triggers listen for events and start flows. They can be:Polling Triggers
Check for new data on a schedule:Webhook Triggers
Receive real-time events via webhooks:Properties
Properties define inputs for actions and triggers:Piece Framework Features
Type Safety
The pieces framework is built with TypeScript and provides full type safety:NPM Package Distribution
All pieces are published as npm packages:- Naming:
@activepieces/piece-{name} - Versioning: Follows semantic versioning
- Distribution: Published to npmjs.com
- Installation: Install like any npm package
Hot Reloading
During local development, pieces support hot reloading:Context API
Pieces have access to a rich context object:MCP Server Integration
Every Activepieces piece automatically becomes available as an MCP (Model Context Protocol) server!
- Used in Activepieces flows
- Exposed as an MCP server tool
- Called by AI assistants like Claude Desktop, Cursor, and Windsurf
Building Your Own Piece
Creating a piece is straightforward:1
Generate Piece Scaffold
2
Define Authentication
Choose the appropriate auth method for your service.
3
Create Actions
Add operations users can perform.
4
Add Triggers
Set up event listeners if needed.
5
Test Locally
Use hot reloading to test your piece in real workflows.
6
Publish
Publish to npm and optionally contribute back to the community.
Piece Categories
Pieces are organized into categories for easy discovery:- Productivity: Google Workspace, Microsoft 365, Notion
- Communication: Slack, Discord, Email services
- Artificial Intelligence: OpenAI, Anthropic, AI utilities
- Marketing: Mailchimp, SendGrid, social media
- Developer Tools: GitHub, GitLab, API testing
- E-commerce: Shopify, WooCommerce, Stripe
- Business Intelligence: Analytics, reporting tools
- And many more…
Piece Versioning
Each piece specifies its minimum supported Activepieces release:- Compatibility with platform features
- Breaking changes are communicated
- Users know which version to use
Best Practices
Clear Naming
Use descriptive names for actions and triggers that clearly indicate what they do.
Good Descriptions
Write helpful descriptions for properties and include examples.
Error Handling
Handle errors gracefully and return helpful error messages.
Validation
Validate inputs before making API calls to fail fast.
Use Store
Leverage the store API for caching and state management.
Test Thoroughly
Test all actions and triggers with various inputs before publishing.
Next Steps
- Build Your First Piece - Step-by-step guide
- Piece Development Guide - Complete reference
- MCP Integration - Connect pieces to AI
- AI Pieces - Build AI-powered pieces