Activepieces Integration
Bidirectional integration between Ever Gauzy and Activepieces — the open-source business automation tool.
This integration works in two directions:
- Gauzy → Activepieces (Plugin Integration): Gauzy manages Activepieces connections and MCP servers via the Activepieces API, authenticated with an API Key.
- Activepieces → Gauzy (OAuth App): The
ever-gauzy-pieceon Activepieces authenticates into Gauzy via an OAuth 2.0 Authorization Code flow.
Architecture Overview
Part 1: Gauzy → Activepieces (Plugin Integration)
This direction allows Gauzy users to manage their Activepieces connections and MCP servers from within the Gauzy UI. All API calls to the Activepieces platform are authenticated using an API Key sent as a Bearer token.
Setup Flow
Step-by-step:
- User navigates to the Activepieces integration page in Gauzy.
- If an integration tenant already exists for the current organization, the UI auto-redirects to the integration detail page (remember state).
- If not, the UI shows a form with a single API Key input field (password type).
- User enters their Activepieces API key and submits. To get the API Key, users need to contact the sales team of Activepieces at
sales@activepieces.com. Check the Activepieces docs for more information. - Frontend calls
POST /api/integration/activepieces/setupwith{ apiKey, organizationId }. - Backend creates/finds the base
ACTIVE_PIECESintegration record, then creates an integration tenant with the API key stored as a setting. - Backend returns
{ integrationTenantId }. - Frontend navigates to
/pages/integrations/activepieces/:integrationTenantId. - User can now manage Connections and MCP Servers from the tabbed interface.
API Key Management and Tenant Isolation
The system supports multi-tenant API key isolation with a global fallback. Each tenant (organization) can have its own Activepieces API key, or the system can fall back to a shared global key.
Two-Tier API Key Resolution
How Each Method Resolves the API Key
| Method | How It Finds the Integration Tenant | Notes |
|---|---|---|
setupIntegration() | N/A (creates the tenant) | Stores the key |
upsertConnection() | Queries by tenantId + provider: ACTIVE_PIECES | Resolved before API call |
listConnections() | Receives integrationId from route parameter | Passed by controller |
getConnection() | Receives integrationTenantId from route parameter | Direct lookup |
deleteConnection() | Receives integrationTenantId from route parameter | Direct lookup |
| MCP service (all methods) | Queries by tenantId + provider: ACTIVE_PIECES | Direct lookup via private getApiKey() |
Tenant Isolation Guarantees
- Every database query includes a
tenantIdfilter fromRequestContext.currentTenantId(), which is derived from the authenticated user's JWT token. - A tenant can only access their own integration tenant, settings, and connections.
- The
TenantPermissionGuardon every controller endpoint enforces that the requesting user belongs to the tenant. - Connection metadata includes
tenantIdandorganizationIdfor filtering when listing connections from Activepieces.
Per-Tenant vs. Global API Key
| Scenario | Behavior |
|---|---|
| Tenant sets up via UI (enters API key) | Key is stored in DB per-tenant. All API calls for this tenant use this key. |
Tenant has not set up, but GAUZY_ACTIVEPIECES_API_KEY is configured | Falls back to the global key. Useful for shared/demo deployments. |
| Neither configured | API calls fail with "Activepieces API key not configured". |
Connection Management
Once setup is complete, tenants can create connections between Gauzy and Activepieces projects.
Creating a Connection (POST /api/integration/activepieces/connection):
- Requires:
accessToken(Gauzy access token for the piece),projectId(Activepieces project ID) - Creates a
SECRET_TEXTtype connection on Activepieces with:externalId:gauzy-tenant-{tenantId}-org-{organizationId}pieceName:Ever-gauzymetadata:{ tenantId, organizationId, createdAt, gauzyVersion }
- Stores connection details (connection ID, project IDs, access token) in integration tenant settings
Listing Connections (GET /api/integration/activepieces/connections/:integrationId):
- Supports pagination (
cursor,limit) and filtering (pieceName,displayName,status,scope) - Tenant connections filtered by
metadata.tenantId
Deleting a Connection (DELETE /api/integration/activepieces/connection/:integrationId):
- Removes the connection from Activepieces via their API
MCP Server Management
Tenants can view and manage MCP (Model Context Protocol) servers on Activepieces.
- List servers: filtered by project ID
- Update server: modify name and tool configurations
- Rotate token: generate a new authentication token for the MCP server
- Security: The controller sanitizes responses by removing the
tokenfield before returning to the frontend
Backend API Endpoints
All endpoints are prefixed with /api/integration/activepieces and guarded by TenantPermissionGuard.
While these endpoints cover connections and MCP servers, refer to the Activepieces Piece Schema for the full Activepieces API surface.