Activepieces Piece Builder
Pick your task mode first
| Mode | What you're doing | Where to go |
|---|---|---|
| New piece | Building an integration for an app that has no piece yet | Full 5-step workflow below |
| Add action / trigger | An existing piece needs another operation or event | Skip Steps 1–3. Open the existing piece, match its conventions (its common/ helpers, auth access, file naming, error handling), then jump to Step 4 IMPLEMENT and Step 5 WIRE & VERIFY. Bump the piece version. |
| Fix a bug | An existing action/trigger misbehaves | Reproduce → read the offending file and its common/ helpers → smallest fix that matches surrounding style → Step 5 VERIFY. Bump the piece version. |
Golden rule for existing-piece modes: the piece you're editing is the source of truth, not these templates. If the piece already has a helper, a particular auth access pattern, or a way of shaping output, follow that. Reach into the reference files only for a pattern the piece doesn't already demonstrate.
The one carve-out — framework calls that drop data. Matching the piece is right for style, wrong for a call that silently loses information. Always pass the whole context to pollingHelper, never a hand-picked subset like { store, auth, propsValue } — see trigger-patterns.md. Lint enforces this (no-restricted-syntax in the root .eslintrc.json).
Workflow (new piece)
Step 1: RESEARCH
- Search the web for the target app's REST API documentation
- Identify the auth method (API key, OAuth2, Basic Auth, custom)
- List available endpoints; check if webhooks are supported
- Note base URL, pagination, and rate limits
Step 2: PLAN
- Location:
packages/pieces/community/by default;packages/pieces/custom/only if the user says "custom piece". See Piece Types below. - Choose the correct auth type — see Quick Auth Reference below
- Select the most useful actions (CRUD, search, list) and triggers (webhook if supported, polling otherwise)
- Ask the user before starting when: OAuth2 authUrl/tokenUrl/scopes are missing from the docs; auth method is unclear or undocumented; more than 10 possible actions exist (which to prioritize); API uses webhook signature verification; test credentials or sandbox access are needed.
Step 3: SCAFFOLD
Create this structure under packages/pieces/community/<name>/:
src/
index.ts
lib/
auth.ts # Auth always lives here — never inline in index.ts
actions/ # One file per action
triggers/ # One file per trigger
common/ # Shared helpers (optional)
package.json
.eslintrc.json
tsconfig.json
tsconfig.lib.json
Copy the four config files (package.json, .eslintrc.json, tsconfig.json, tsconfig.lib.json) from