|
| 1 | +import Callout from '@/components/Callout' |
| 2 | + |
| 3 | +# Using Custom Tools |
| 4 | + |
| 5 | +In addition to the public triggers and actions in Pipedream's global registry, you can write and publish your own components to your workspace to use with Connect. Custom tools let you add specific functionality or capabilities that are unique to your exact use case. |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Custom tools are Node.js modules that you develop using the [Pipedream Components API](/components/contributing/api/) and publish to your Pipedream workspace. Once published, they become available across [all Connect APIs](/connect/api/#components), including the list, retrieve, run endpoints, etc. |
| 10 | + |
| 11 | +<Callout type="info"> |
| 12 | +Publishing custom tools is available to Pipedream customers on the [Business plan](https://pipedream.com/pricing?plan=Enterprise). |
| 13 | +</Callout> |
| 14 | + |
| 15 | +## Creating custom tools |
| 16 | + |
| 17 | +Custom tools use the same development workflow as standard Pipedream components: |
| 18 | + |
| 19 | +1. **Write your component** using the [Pipedream Components API](/components/contributing/api/) |
| 20 | +2. **Follow component guidelines** outlined in the [component development docs](/components/contributing/guidelines/) |
| 21 | +3. **Use the Pipedream CLI** to publish your component with a Connect-specific flag |
| 22 | + |
| 23 | +<Callout type="info"> |
| 24 | +Custom tools are either [sources](/components/contributing/sources-quickstart/) (triggers) or [actions](/components/contributing/actions-quickstart/). Check out the respective quickstart guides for step-by-step development instructions. |
| 25 | +</Callout> |
| 26 | + |
| 27 | +## Publishing for Connect |
| 28 | + |
| 29 | +To make your custom components available in Connect, use the `pd publish` command with the `--connect-environment` flag: |
| 30 | + |
| 31 | +```bash |
| 32 | +pd publish my-custom-action.mjs --connect-environment development |
| 33 | +``` |
| 34 | + |
| 35 | +### Environments |
| 36 | + |
| 37 | +The `--connect-environment` flag accepts two values: |
| 38 | + |
| 39 | +- **`development`**: makes the component available to your Pipedream workspace in Connect in development |
| 40 | +- **`production`**: makes the component available to your Pipedream workspace in Connect in production |
| 41 | + |
| 42 | +<Callout type="warning"> |
| 43 | +Components published to `development` will only be available in the development environment, and vice versa for `production`. |
| 44 | +</Callout> |
| 45 | + |
| 46 | +## Using custom tools |
| 47 | + |
| 48 | +Once published, your custom tools appear alongside public components in Connect APIs: |
| 49 | + |
| 50 | +- **List endpoints**: Custom tools are included in component listing responses |
| 51 | +- **Retrieve endpoints**: You can fetch details about your custom components |
| 52 | +- **Run endpoints**: Execute your custom tools with the same API calls used for public components |
| 53 | + |
| 54 | +### Referencing custom tools |
| 55 | + |
| 56 | +Custom tools are identified with a `~/` prefix in their component ID. For example, if you publish a component with the key `google_sheets-update-file`, it will appear in Connect APIs as `~/google_sheets-update-file`. |
| 57 | + |
| 58 | +When making API calls to list, retrieve, or run custom tools, use the prefixed ID: |
| 59 | + |
| 60 | +```bash |
| 61 | +# List all components (includes custom tools with ~/ prefix) |
| 62 | +GET /v1/components |
| 63 | + |
| 64 | +# Retrieve a specific custom tool |
| 65 | +GET /v1/components/~/google_sheets-update-file |
| 66 | + |
| 67 | +# Run a custom tool |
| 68 | +POST /v1/components/~/google_sheets-update-file/run |
| 69 | +``` |
| 70 | + |
| 71 | +The Connect API treats custom tools identically to public components, ensuring a consistent integration experience. |
| 72 | + |
| 73 | +## Example workflow |
| 74 | + |
| 75 | +Here's a typical workflow for creating and using a custom tool: |
| 76 | + |
| 77 | +1. **Develop locally** using your preferred editor |
| 78 | +2. **Test your component** using [pd dev](/components/contributing/cli/reference/#pd-dev) for sources or local testing for actions |
| 79 | +3. **Publish to Connect** with the appropriate environment flag |
| 80 | +4. **Integrate via Connect APIs** in your application |
| 81 | + |
| 82 | +<Callout type="info"> |
| 83 | +Test your custom tools in your application directly or [run Pipedream's SDK playground](https://github.com/PipedreamHQ/pipedream-connect-examples/tree/master/connect-react-demo#pipedream-components-demo-react) locally with your Pipedream credentials. |
| 84 | +</Callout> |
| 85 | + |
| 86 | +## Best practices |
| 87 | + |
| 88 | +- **Follow naming conventions**: Use clear, descriptive names for your tools |
| 89 | +- **Include proper documentation**: Add helpful descriptions and prop labels for easier configuration |
| 90 | +- **Test thoroughly**: Validate your components work as expected before publishing to production |
| 91 | +- **Version management**: Update component versions when making changes |
| 92 | +- **Environment separation**: Use development environment for testing, production for live integrations |
| 93 | + |
| 94 | +## Getting help |
| 95 | + |
| 96 | +For component development questions, visit the [Pipedream Support](https://pipedream.com/support). For Connect-specific integration help, refer to the [Connect docs](/connect/). |
0 commit comments