Skip to main content

What are Private Pieces?

Private pieces are custom integrations that you build and deploy for your own use, without sharing them publicly. They’re perfect for:

Internal APIs

Integrate with your company’s internal services

Custom Tools

Build organization-specific automations

Proprietary Systems

Connect to proprietary or closed-source systems

Confidential Logic

Keep business logic private

Creating Private Pieces

Private pieces are created the same way as community pieces:
1

Create the Piece

Use the CLI to scaffold your piece:
Or manually create in packages/pieces/custom/:
2

Implement Your Piece

src/index.ts
3

Test Locally

Your private piece will be available alongside community pieces.

Deployment Options

Package and deploy using Docker:
1

Build Your Piece

This creates a distributable package in dist/.
2

Update Dockerfile

Dockerfile
3

Build & Deploy

Option 2: Volume Mount

Mount pieces directory for development:
docker-compose.yml
Start:

Option 3: NPM Registry

Publish to private NPM registry:
1

Configure Private Registry

2

Update Package Name

package.json
3

Publish

4

Install in Activepieces

Environment-Specific Configuration

Manage different configurations per environment:
src/lib/common/config.ts
Use in actions:

Security Best Practices

Use environment variables for sensitive config:
  • Use HTTPS for all API calls
  • Implement IP whitelisting if needed
  • Use VPN for internal APIs
  • Validate SSL certificates
Implement role-based access:
Log all operations for compliance:

CI/CD Pipeline

Automate piece deployment:
.github/workflows/deploy-private-pieces.yml

Sharing Within Organization

Share pieces across teams:

1. Internal Documentation

Create internal docs:
docs/pieces/my-company-api.md

2. Internal Package Registry

Publish to Artifactory/Nexus:

3. Team Training

  • Hold training sessions
  • Create video tutorials
  • Share example flows
  • Maintain FAQ

Monitoring and Maintenance

Health Checks

src/lib/actions/health-check.ts

Monitoring Dashboard

Track piece usage:
  • Execution counts
  • Error rates
  • Response times
  • User adoption

Versioning Private Pieces

Follow semantic versioning:
package.json
  • Major (1.x.x): Breaking changes
  • Minor (x.2.x): New features
  • Patch (x.x.3): Bug fixes
See Versioning Guide for details.

Troubleshooting

  1. Check piece is in correct directory
  2. Verify package.json is valid
  3. Ensure piece is exported properly
  4. Restart Activepieces
  5. Check logs for errors
  1. Verify API key is correct
  2. Check environment setting
  3. Confirm API endpoint is accessible
  4. Review network/firewall rules
  5. Check SSL certificate validity
  1. Add caching for API responses
  2. Implement request debouncing
  3. Optimize data transformations
  4. Review API rate limits
  5. Consider pagination for large datasets

Next Steps

Versioning

Learn about piece versioning

Testing

Write comprehensive tests