Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions components/brainbase_labs/README.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README is your call - I don't think it's useful to have individual components listed here, but rather a general description of the app and its use cases

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Brainbase

Brainbase is a platform for building and deploying AI voice agents. Create intelligent workers that can handle phone calls, automate customer interactions, and integrate with your existing communication infrastructure.

## What You Can Do

With the Brainbase integration on Pipedream, you can:

- **Automate Voice Agent Deployments** - Programmatically create and configure AI voice agents that can make or receive phone calls
- **Monitor Call Activity** - Track voice deployment logs, analyze sentiment, and retrieve call records for quality assurance
- **Manage Phone Numbers** - Register and configure phone numbers for your voice agents through Twilio integration
- **Build Dynamic Workflows** - Create AI workers with custom flows that adapt based on triggers from other apps in your Pipedream workflows
- **Scale Communications** - Make batch calls to multiple recipients with personalized AI interactions

## Use Cases

### Customer Support Automation

Automatically deploy voice agents when support tickets are created in Zendesk or when specific keywords are detected in emails. Route calls based on customer data and log interactions back to your CRM.

### Appointment Reminders

Trigger AI voice calls to remind customers of upcoming appointments when calendar events approach. Collect confirmations and automatically update your scheduling system.

### Lead Qualification

Deploy voice agents to call leads from your sales pipeline, ask qualification questions, and route hot leads to human sales reps based on responses and sentiment analysis.

### Outbound Notifications

Send voice notifications for order updates, delivery alerts, or account changes by triggering calls when status changes occur in your e-commerce or SaaS platform.

## Getting Started

1. Connect your Brainbase account using your API key
2. Create a worker to define your AI agent's purpose
3. Build a flow to script your agent's conversation logic
4. Deploy your voice agent with a phone number
5. Integrate with other Pipedream apps to trigger or respond to voice interactions

## Authentication

This integration uses API Key authentication. You'll need to provide your Brainbase API key when connecting the app in Pipedream.

## Links

- [Brainbase Documentation](https://docs.usebrainbase.com)
- [Pipedream Community](https://pipedream.com/community)
68 changes: 68 additions & 0 deletions components/brainbase_labs/actions/create-flow/create-flow.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-create-flow",
name: "Create Flow",
description:
"Create a new flow for a worker. [See the documentation](https://docs.usebrainbase.com)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
workerId: {
propDefinition: [
app,
"workerId",
],
},
name: {
type: "string",
label: "Name",
description: "The name of the flow",
},
code: {
type: "string",
label: "Code",
description: "The flow code/definition",
},
Comment on lines +28 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Provide more specific description for the code prop.

The description "The flow code/definition" doesn't specify the expected format. Consider clarifying whether this expects JSON, JavaScript, a specific DSL, or another format to improve the user experience.

Example:

-      description: "The flow code/definition",
+      description: "The flow code/definition in [expected format, e.g., JSON, JavaScript, etc.]",

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In components/brainbase_labs/actions/create-flow/create-flow.mjs around lines 28
to 32, the "code" property's description is vague ("The flow code/definition");
update it to state the exact expected format (e.g., JSON object with specific
keys, a JavaScript function string, or a domain-specific YAML/DSL), mention
required schemas or fields if any, and add a short example or reference to the
schema/docs; ensure the description clearly tells users the content type
(JSON/JS/DSL), encoding (stringified JSON, base64, etc.), and where to find full
spec or examples.

label: {
type: "string",
label: "Label",
description: "Optional label for the flow",
optional: true,
},
variables: {
type: "string",
label: "Variables",
description: "Flow variables (optional)",
optional: true,
},
validate: {
type: "boolean",
label: "Validate",
description: "Whether to validate the flow",
optional: true,
},
},
async run({ $ }) {
const response = await this.app.createFlow({
$,
workerId: this.workerId,
data: {
name: this.name,
code: this.code,
label: this.label,
variables: this.variables,
validate: this.validate,
},
});

$.export("$summary", `Successfully created flow "${this.name}"`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-create-twilio-integration",
name: "Create Twilio Integration",
description:
"Create a new Twilio integration for the authenticated team. [See the documentation](https://docs.usebrainbase.com)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
accountSid: {
type: "string",
label: "Account SID",
description: "Twilio account SID",
},
authToken: {
type: "string",
label: "Auth Token",
description: "Twilio auth token (will be encrypted before being stored)",
secret: true,
},
},
async run({ $ }) {
const response = await this.app.createTwilioIntegration({
$,
data: {
accountSid: this.accountSid,
authToken: this.authToken,
},
});

$.export("$summary", "Successfully created Twilio integration");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-create-voice-deployment",
name: "Create Voice Deployment",
description:
"Create a new voice deployment. [See the documentation](https://docs.usebrainbase.com)",
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider linking to specific API endpoint documentation.

The documentation link points to the general docs homepage. If available, link directly to the voice deployment creation endpoint documentation for easier reference.

Example:

- description:
-   "Create a new voice deployment. [See the documentation](https://docs.usebrainbase.com)",
+ description:
+   "Create a new voice deployment. [See the documentation](https://docs.usebrainbase.com/api/voice-deployments#create)",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description:
"Create a new voice deployment. [See the documentation](https://docs.usebrainbase.com)",
description:
"Create a new voice deployment. [See the documentation](https://docs.usebrainbase.com/api/voice-deployments#create)",
🤖 Prompt for AI Agents
In
components/brainbase_labs/actions/create-voice-deployment/create-voice-deployment.mjs
around lines 6-7, the description uses the general docs homepage; update it to
point to the specific API docs for creating voice deployments by replacing or
extending the URL with the direct endpoint documentation (e.g., the “create
voice deployment” page) so consumers have a precise reference; locate the
description string and swap the link or add parentheses with the specific
endpoint docs URL and keep the existing text unchanged otherwise.

version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
workerId: {
propDefinition: [
app,
"workerId",
],
},
name: {
type: "string",
label: "Name",
description: "Deployment name",
},
phoneNumber: {
type: "string",
label: "Phone Number",
description: "Phone number for deployment (e.g., +1234567890)",
},
Comment on lines +28 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider adding phone number format validation.

While the description provides a format example, there's no validation to ensure the phone number matches the expected pattern (E.164 format). The API will likely reject invalid formats, but client-side validation would provide faster feedback.

Example using a pattern validation:

 phoneNumber: {
   type: "string",
   label: "Phone Number",
   description: "Phone number for deployment (e.g., +1234567890)",
+  pattern: /^\+[1-9]\d{1,14}$/,
 },

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
components/brainbase_labs/actions/create-voice-deployment/create-voice-deployment.mjs
around lines 28 to 32, the phoneNumber field lacks client-side validation for
E.164 format; add a validation rule (e.g., a regex/pattern check) to enforce the
expected international format (leading + and digits, length constraints), return
a clear validation message on failure, and ensure the field still accepts
strings so existing callers are unaffected.

flowId: {
propDefinition: [
app,
"flowId",
(c) => ({
workerId: c.workerId,
}),
],
},
enableVoiceSentiment: {
type: "boolean",
label: "Enable Voice Sentiment",
description: "Enable voice sentiment analysis",
default: false,
},
externalConfig: {
type: "object",
label: "External Config",
description:
"External configuration object with voice settings, language, voiceId, etc. Example: `{\"voice\": \"alloy\", \"language\": \"en\"}`",
optional: true,
},
extractions: {
type: "object",
label: "Extractions",
description: "Custom data extraction configurations (optional)",
optional: true,
},
successCriteria: {
type: "string[]",
label: "Success Criteria",
description: "Deployment success measurement criteria (optional)",
optional: true,
},
},
async run({ $ }) {
const response = await this.app.createVoiceDeployment({
$,
workerId: this.workerId,
data: {
name: this.name,
phoneNumber: this.phoneNumber,
flowId: this.flowId,
enableVoiceSentiment: this.enableVoiceSentiment,
...(this.externalConfig && {
externalConfig: this.externalConfig,
}),
...(this.extractions && {
extractions: this.extractions,
}),
...(this.successCriteria && {
successCriteria: this.successCriteria,
}),
},
});

$.export(
"$summary",
`Successfully created voice deployment "${this.name}"`,
);
return response;
},
};
53 changes: 53 additions & 0 deletions components/brainbase_labs/actions/create-worker/create-worker.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-create-worker",
name: "Create Worker",
description:
"Create a new worker for the team. [See the documentation](https://docs.usebrainbase.com)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
name: {
type: "string",
label: "Name",
description: "The name of the worker",
},
description: {
type: "string",
label: "Description",
description: "Worker description",
optional: true,
},
status: {
type: "string",
label: "Status",
description: "Worker status",
optional: true,
options: [
"active",
"inactive",
"archived",
],
},
},
async run({ $ }) {
const response = await this.app.createWorker({
$,
data: {
name: this.name,
description: this.description,
status: this.status,
},
});

$.export("$summary", `Successfully created worker "${this.name}"`);
return response;
},
};
43 changes: 43 additions & 0 deletions components/brainbase_labs/actions/delete-flow/delete-flow.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-delete-flow",
name: "Delete Flow",
description:
"Delete a flow. [See the documentation](https://docs.usebrainbase.com)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
workerId: {
propDefinition: [
app,
"workerId",
],
},
flowId: {
propDefinition: [
app,
"flowId",
(c) => ({
workerId: c.workerId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.deleteFlow({
$,
workerId: this.workerId,
flowId: this.flowId,
});

$.export("$summary", `Successfully deleted flow with ID ${this.flowId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import app from "../../brainbase_labs.app.mjs";

export default {
key: "brainbase_labs-delete-integration",
name: "Delete Integration",
description:
"Delete an existing Twilio integration. [See the documentation](https://docs.usebrainbase.com)",
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Clarify if description should be Twilio-specific.

The description mentions "Delete an existing Twilio integration" which suggests this action only applies to Twilio integrations. If the Brainbase API supports multiple integration types (not just Twilio), consider using a more generic description like "Delete an existing integration."

Run the following script to check if other integration types are referenced in the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Check for other integration types beyond Twilio

# Search for integration creation/types in action files
rg -i 'integration' --type=js -A 3 -B 3 components/brainbase_labs/actions/

# Look for integration type references
rg -i 'twilio|slack|zapier|webhook' --type=js components/brainbase_labs/

Length of output: 0


I need to verify the file structure and content since the initial script produced no output. Let me run additional verification scripts:


🏁 Script executed:

#!/bin/bash
# Check if the file exists and explore directory structure
echo "=== Checking file existence ==="
find . -name "delete-integration.mjs" -o -name "*integration*" -type f 2>/dev/null | head -20

echo -e "\n=== Listing actions directory ==="
ls -la components/brainbase_labs/actions/ 2>/dev/null || echo "Directory not found"

echo -e "\n=== Checking broader directory structure ==="
ls -la components/brainbase_labs/ 2>/dev/null || echo "brainbase_labs directory not found"

echo -e "\n=== List all .mjs files ==="
find . -name "*.mjs" -type f 2>/dev/null | head -20

Length of output: 4461


Now I need to examine the actual file content and compare with related actions:


🏁 Script executed:

#!/bin/bash
# Read the delete-integration file
echo "=== delete-integration.mjs ==="
cat ./components/brainbase_labs/actions/delete-integration/delete-integration.mjs

echo -e "\n\n=== create-twilio-integration.mjs ==="
cat ./components/brainbase_labs/actions/create-twilio-integration/create-twilio-integration.mjs

echo -e "\n\n=== get-integration.mjs ==="
cat ./components/brainbase_labs/actions/get-integration/get-integration.mjs

echo -e "\n\n=== list-integrations.mjs ==="
cat ./components/brainbase_labs/actions/list-integrations/list-integrations.mjs

Length of output: 3410


Update description to be generic, not Twilio-specific.

The delete-integration.mjs action has a generic name ("Delete Integration"), generic implementation (calls deleteIntegration()), and generic props (accepts any integrationId), but the description incorrectly mentions "Twilio integration." This is inconsistent with related actions like "Get Integration" and "List Integrations," which have generic descriptions. Only the create action (create-twilio-integration.mjs) is Twilio-specific.

Change the description from:

"Delete an existing Twilio integration. [See the documentation](https://docs.usebrainbase.com)"

to:

"Delete an existing integration. [See the documentation](https://docs.usebrainbase.com)"
🤖 Prompt for AI Agents
In components/brainbase_labs/actions/delete-integration/delete-integration.mjs
around lines 6 to 7, the action description incorrectly mentions "Twilio
integration" even though the action is generic; update the description string to
"Delete an existing integration. [See the
documentation](https://docs.usebrainbase.com)" so it matches the generic
behavior and other integration actions.

version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
integrationId: {
propDefinition: [
app,
"integrationId",
],
},
},
async run({ $ }) {
const response = await this.app.deleteIntegration({
$,
integrationId: this.integrationId,
});

$.export(
"$summary",
`Successfully deleted integration with ID ${this.integrationId}`,
);
return response;
},
};
Loading
Loading