Plugins
Extend Circuitry's capabilities with plugins that connect to external services and APIs.
What are Plugins?
Plugins are pre-built integrations that add new node types to your workflow editor. They enable:
- External API Integration: Connect to services like Slack, Gmail, Stripe
- Database Operations: Query and update databases
- File Operations: Process files and documents
- Custom Business Logic: Implement organization-specific functionality
Using Plugins
Available Plugins
Plugins are loaded dynamically and appear in your sidebar. Current categories:
- Communication: Slack, Email, SMS
- Productivity: Google Docs, Notion, Airtable
- Development: GitHub, GitLab, Jira
- Marketing: Mailchimp, HubSpot
- Finance: Stripe, PayPal
- Storage: AWS S3, Google Drive
Installing Plugins
- Browse Available Plugins in the sidebar
- Drag Plugin Node onto the canvas
- Configure Connection if authentication required
- Set Parameters for the specific action
Plugin Configuration
Each plugin node requires configuration:
Connection Setup
Many plugins require authentication:
- Click on the plugin node
- Select "Configure Connection"
- Enter required credentials:
- API Keys
- OAuth tokens
- Webhook URLs
- Test the connection
- Save for reuse across workflows
Action Configuration
After connection setup:
- Select Action: Choose from available operations
- Map Inputs: Connect data from previous nodes
- Set Parameters: Configure action-specific settings
- Handle Outputs: Process returned data
Plugin Examples
Slack Integration
Send messages to Slack channels:
// Plugin Configuration
{
"plugin": "slack",
"action": "send_message",
"parameters": {
"channel": "#notifications",
"text": "{{input.message}}",
"attachments": []
}
}
Google Sheets
Read and write spreadsheet data:
// Read from sheet
{
"plugin": "google-sheets",
"action": "read_range",
"parameters": {
"spreadsheetId": "{{config.sheetId}}",
"range": "A1:D10"
}
}
// Write to sheet
{
"plugin": "google-sheets",
"action": "update_range",
"parameters": {
"spreadsheetId": "{{config.sheetId}}",
"range": "A1",
"values": "{{input.data}}"
}
}
GitHub
Automate repository operations:
{
"plugin": "github",
"action": "create_issue",
"parameters": {
"owner": "{{config.owner}}",
"repo": "{{config.repo}}",
"title": "{{input.title}}",
"body": "{{input.description}}",
"labels": ["bug", "automated"]
}
}
Connection Management
Security Best Practices
- Never hardcode credentials in workflows
- Use environment variables for sensitive data
- Rotate API keys regularly
- Limit scope to minimum required permissions
- Monitor usage for unusual activity
Connection Types
API Key Authentication
Simple key-based authentication:
{
"type": "api_key",
"credentials": {
"apiKey": "your-api-key-here"
}
}
OAuth 2.0
For services requiring OAuth:
{
"type": "oauth2",
"credentials": {
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"accessToken": "current-access-token",
"refreshToken": "refresh-token"
}
}
Webhook
For receiving external events:
{
"type": "webhook",
"config": {
"url": "https://circuitry.app/webhooks/your-id",
"secret": "webhook-secret"
}
}
Creating Custom Plugins
Plugin Structure
Basic plugin definition:
{
"id": "my-plugin",
"name": "My Custom Plugin",
"description": "Description of what it does",
"version": "1.0.0",
"author": "Your Name",
"icon": "icon-name",
"actions": [
{
"id": "action-1",
"name": "Action Name",
"description": "What this action does",
"parameters": [
{
"id": "param1",
"name": "Parameter 1",
"type": "string",
"required": true,
"description": "Parameter description"
}
]
}
],
"connectionType": "api_key",
"connectionFields": [
{
"id": "apiKey",
"name": "API Key",
"type": "password",
"required": true
}
]
}
Implementation
Plugins are implemented as JavaScript modules:
export async function execute(action, parameters, connection) {
switch (action) {
case 'action-1':
return await performAction1(parameters, connection);
default:
throw new Error(`Unknown action: ${action}`);
}
}
async function performAction1(params, conn) {
// Implementation logic
const response = await fetch(API_URL, {
headers: {
'Authorization': `Bearer ${conn.apiKey}`
},
body: JSON.stringify(params)
});
return await response.json();
}
Plugin Development
Development Workflow
- Create Plugin Definition in
/plugins
directory - Implement Actions in JavaScript/TypeScript
- Test Locally using development server
- Submit for Review to plugin marketplace
- Deploy for community use
Testing Plugins
Test your plugin thoroughly:
// Test file
import { execute } from './my-plugin';
describe('My Plugin', () => {
test('action-1 works correctly', async () => {
const result = await execute('action-1', {
param1: 'test'
}, {
apiKey: 'test-key'
});
expect(result).toBeDefined();
});
});
Best Practices
Performance
- Cache responses when appropriate
- Batch operations to reduce API calls
- Handle rate limits gracefully
- Implement retries with exponential backoff
- Stream large datasets instead of loading all at once
Error Handling
Always handle errors gracefully:
try {
const result = await pluginAction();
return { success: true, data: result };
} catch (error) {
return {
success: false,
error: {
message: error.message,
code: error.code,
details: error.response?.data
}
};
}
Documentation
Document your plugin thoroughly:
- Clear descriptions for all actions
- Parameter documentation with examples
- Error codes and troubleshooting
- Usage examples and tutorials
- API limits and pricing information
Troubleshooting
Common Issues
- Authentication Failed: Check API keys and permissions
- Rate Limit Exceeded: Implement backoff and retry logic
- Invalid Parameters: Validate input data format
- Network Errors: Check connectivity and firewall rules
- Version Mismatch: Update plugin to latest version
Debug Mode
Enable debug logging for plugins:
{
"debug": true,
"logLevel": "verbose"
}