Connections
BindAI Connections provide a consistent interface for communicating with external services and systems. A connection represents an external destination that BindAI can connect to and send data through. Connections are useful for integrating AI applications and workflows with services such as GitHub, Slack, Notion, Jira, Discord, email providers, deployment platforms, and generic webhooks.Connection Architecture
The Connections package provides three core concepts:Connection— the base interface for an external connection.ConnectionRegistry— a registry of connection types available for dynamic lookup.ConnectionManager— manages active connection instances.
Connection Interface
The baseConnection abstraction defines a small common interface:
nameconnect()disconnect()is_connected()send(payload)
send() depend on the specific connection implementation.
Connections may raise exceptions when an operation cannot be performed.
Connection Lifecycle
A typical connection lifecycle is:connect() may prepare or validate the connection while send() performs the actual external request.
For other integrations, connect() may simply establish an internal active state.
The concrete behavior depends on the integration.
Applications should therefore treat connect() and disconnect() as lifecycle operations defined by each connection implementation rather than assuming a particular network behavior.
Connection Registry
ConnectionRegistry stores named connection types.
Registered Connections
The current package initialization registers these connection types:webhookslacknotionjiradiscordresendvercelnetlify
GitHubConnection is also publicly exposed by the package, but it is not currently registered with ConnectionRegistry by the package initialization.
It can still be imported directly:
Connection Manager
ConnectionManager manages active connection instances.
name property.
Connections can then be accessed by name:
- Checking whether a connection exists
- Connecting a connection
- Disconnecting a connection
- Disconnecting all active connections
- Removing a connection
- Listing managed connections
- Listing managed connection names
- Clearing all connections
- Checking the number of managed connections
Connection Manager Lifecycle
A typical manager lifecycle is:remove() disconnects it before removing it from the manager.
All active connections can be disconnected:
clear() disconnects active connections and then removes all managed instances.
Connection Lookup
The manager provides direct lookup for managed instances:get() raises KeyError.
Applications can check before lookup:
all() returns the managed connection instances.
names() returns the names of managed connections.
size() returns the number of managed connections.
Webhook Connections
WebhookConnection provides a generic integration for sending payloads to webhook endpoints.
This is useful for services that expose HTTP webhook interfaces.
Typical use cases include:
- Automation triggers
- Notifications
- Workflow events
- External system callbacks
- Custom integrations
GitHub
GitHubConnection provides an HTTP connection for the GitHub REST API.
The connection accepts a GitHub token and supports configurable API base URLs and request timeouts.
Conceptually:
pathmethodbody
GitHubConnection is publicly exported but is not currently registered with ConnectionRegistry.
Slack
SlackConnection provides an integration with Slack.
Typical use cases include:
- Sending notifications
- Posting workflow results
- Sending agent-generated messages
- Alerting teams about workflow events
Notion
NotionConnection provides an integration with Notion.
Potential application uses include:
- Writing generated content
- Updating pages
- Publishing workflow results
- Connecting AI workflows with workspace information
Jira
JiraConnection provides an integration with Jira.
Typical uses include:
- Creating or updating issues
- Connecting AI workflows to project-management processes
- Automating issue-related operations
- Sending workflow results to Jira
Discord
DiscordConnection provides an integration with Discord.
Typical uses include:
- Sending notifications
- Publishing workflow results
- Alerting Discord channels
- Connecting automated workflows with communities
Resend
ResendConnection provides an integration with Resend for email-related operations.
Typical uses include:
- Sending application notifications
- Delivering workflow results
- Sending generated messages
- Integrating email delivery into automated workflows
Vercel
VercelConnection provides an integration with Vercel.
It can be used to connect BindAI automation with deployment-related operations supported by the connection implementation.
This can be useful when AI workflows participate in application deployment or infrastructure automation.
Netlify
NetlifyConnection provides an integration with Netlify.
It can connect BindAI automation with deployment-related operations supported by the integration.
This makes it possible to incorporate deployment platforms into larger AI-driven workflows.
Connections and Agents
Connections can be used alongside agents when an agent needs to interact with an external system. A typical architecture is:Connections and Workflows
Connections can also be used by workflows. For example:- Execute an agent.
- Process the result.
- Send the result through a connection.
- Continue or complete execution.
Connections and Tools
A common pattern is to expose a connection through a tool.- Provider-specific logic remains isolated.
- Agents receive simple tool interfaces.
- External credentials remain outside prompts.
- Connections can be reused.
- Tools can validate inputs before performing external actions.
Configuration
Connection configuration should remain outside application logic whenever possible. Depending on the integration, configuration may include:- API keys
- Access tokens
- Webhook URLs
- Account identifiers
- Workspace identifiers
- Project identifiers
- Endpoint URLs
- Sender information
Connection State
The base interface exposes:Error Handling
External services can fail for many reasons. Examples include:- Authentication failures
- Invalid requests
- Network failures
- Rate limits
- Service outages
- Invalid payloads
- Permission errors
Idempotency
Connections that perform state-changing operations should consider idempotency. For example:Security
Connections often provide access to external systems and therefore require careful security controls. Recommended practices include:- Keep credentials outside source code.
- Use the minimum required permissions.
- Validate data before sending it externally.
- Restrict write operations where possible.
- Protect state-changing tools.
- Avoid exposing secrets to agents.
- Avoid placing credentials in prompts.
- Audit important external operations.
- Rotate credentials when appropriate.
External Data
Connections may send or receive information from external services. Applications should consider:- Data sensitivity
- User authorization
- Access permissions
- Data retention
- Logging
- Compliance requirements
- Cross-system data flow
Reusing Connections
A connection instance can be managed and reused by an application. For example:Connection Isolation
Different external services should remain logically isolated. For example:Connections in Multi-Agent Systems
Connections can support multi-agent architectures. For example:Testing Connections
Connections should be tested independently from the agents and workflows that use them. Useful tests include:- Construction
- Configuration validation
- Connection lifecycle
- Connected-state behavior
- Payload handling
- Authentication failures
- External-service failures
- Invalid responses
- Cleanup
- Error handling
- Registering a connection type
- Looking up a registered type
- Listing registered names
- Rejecting an empty connection name
- Handling unknown connection names
- Adding connections
- Looking up managed connections
- Checking membership
- Connecting and disconnecting
- Removing connections
- Disconnecting all connections
- Clearing the manager
- Listing managed names
- Reporting manager size
Local Development
During development, connections should preferably use:- Test accounts
- Mock services
- Development workspaces
- Non-production credentials
- Safe test data
Production Usage
Production connections require additional operational considerations. These can include:- Credential management
- Rate limits
- Service availability
- Network configuration
- Monitoring
- Failure handling
- Retry behavior
- Audit logging
- Access control
Adding a New Connection
A new integration should implement theConnection abstraction.
Conceptually:
ConnectionRegistry:
Connection Design Principles
Good connections should:- Have a clear responsibility.
- Hide provider-specific communication details.
- Avoid exposing credentials.
- Validate external input.
- Handle failures explicitly.
- Keep side effects predictable.
- Support testing.
- Avoid unnecessary global state.
- Provide clear error information.
- Follow the common connection interface.
Current Scope
The current Connections package provides:Core
ConnectionConnectionRegistryConnectionManager
Public Connection Classes
WebhookConnectionGitHubConnectionSlackConnectionNotionConnectionJiraConnectionDiscordConnectionResendConnectionVercelConnectionNetlifyConnection
Currently Registered Connection Types
- Webhooks
- Slack
- Notion
- Jira
- Discord
- Resend
- Vercel
- Netlify
GitHubConnection is publicly available but is not currently registered with ConnectionRegistry.
These integrations provide a foundation for connecting BindAI applications and workflows to external systems.
Additional integrations can be added without changing the core connection abstraction.
Future Integrations
Potential future integrations include services such as:- Google Workspace
- Stripe
- Additional communication platforms
- Additional project-management systems
- Additional deployment platforms
- Additional SaaS APIs
API Accuracy
The Connections package currently provides the abstractions and APIs described in this document. The public package exposes:Summary
BindAI Connections provide a small abstraction for communicating with external services. The core architecture is:ConnectionRegistry provides named connection types for dynamic lookup, while ConnectionManager manages active connection instances.
Connections can be combined with tools, agents, and workflows to build AI applications that interact with external systems.
The current package publicly exposes integrations for:
- Webhooks
- GitHub
- Slack
- Notion
- Jira
- Discord
- Resend
- Vercel
- Netlify
GitHubConnection, which remains publicly importable but is not registered for dynamic registry lookup.
By keeping external-service communication behind a common interface, BindAI can add integrations incrementally while keeping application and workflow logic independent from individual service implementations.