Creating Custom Connectors
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks and see fewer ads — read each lesson on a single page with Pro
Module: Manage Environments
Section: Configure Custom Connectors
Lesson: Creating Custom Connectors
Introduction: Bridging the Gap in Modern Ecosystems
In the landscape of modern application development, organizations rarely rely on a single software platform to handle their entire workflow. Instead, they operate in a complex ecosystem where data flows between cloud services, on-premises databases, enterprise resource planning (ERP) systems, and bespoke internal tools. While pre-built connectors—those ready-to-use plug-ins provided by platform vendors—cover a wide array of popular services like Microsoft 365, Salesforce, or Twitter, they inevitably hit a wall when faced with proprietary APIs or highly specific internal business logic.
This is where custom connectors become essential. A custom connector acts as a wrapper around an API, allowing your low-code or automation platforms to communicate with services that do not have an off-the-shelf integration. By creating a custom connector, you effectively "teach" your platform how to speak the language of a specific web service. This allows your developers and citizen developers to interact with that service using the same intuitive visual interfaces they use for standard connectors, democratizing access to data while maintaining strict security and governance controls.
Understanding how to build, configure, and maintain custom connectors is a foundational skill for any administrator or lead developer. It transforms your environment from a collection of isolated silos into a unified, interconnected fabric of business operations. In this lesson, we will explore the architecture of custom connectors, the technical requirements for implementation, and the best practices for ensuring these integrations remain stable, secure, and scalable over time.
Understanding the Anatomy of a Custom Connector
At its core, a custom connector is a set of metadata that describes an underlying API. When you create a custom connector, you are essentially providing your platform with a map of the API's capabilities. This map includes information about authentication, the available endpoints (actions and triggers), and the data structures (schemas) that the API expects or returns.
To understand how these pieces fit together, consider the following components that make up any custom connector configuration:
- API Definition: This is the blueprint of your connector. You can define this via an OpenAPI specification (formerly known as Swagger), which is a standardized format for describing REST APIs. Alternatively, you can build the definition manually using the platform’s visual editor.
- Authentication: This layer defines how the connector proves its identity to the target service. Common methods include API Keys, OAuth 2.0, Basic Authentication, or no authentication at all for public endpoints.
- Actions: These are the "verbs" of your connector. They represent operations that the platform can perform against the API, such as "Create Record," "Update User," or "Get Status."
- Triggers: These are the "event listeners." A trigger allows your platform to react to changes in the target service, such as starting a workflow when a new file is uploaded to an external storage provider.
- Definitions/Schemas: These describe the data format. By defining the JSON schema for request and response bodies, the platform can provide helpful features like IntelliSense and automatic field mapping within the workflow designer.
Callout: Custom Connectors vs. HTTP Actions While it is technically possible to use a generic HTTP action to call an API, creating a custom connector is almost always the superior choice for long-term maintenance. An HTTP action requires you to manually configure the URL, headers, and body every single time you use it. A custom connector, by contrast, abstracts this complexity away. Once built, users simply select the action from a list, fill in the required fields, and the connector handles the heavy lifting of authentication and header formatting behind the scenes.
Technical Prerequisites and Planning
Before you begin building a custom connector, you must have a clear understanding of the API you intend to consume. You cannot build a connector if you do not know the technical specifications of the target service. Before writing a single line of configuration, ensure you have the following information gathered:
- API Documentation: You need access to the technical documentation of the target service. Look for details on base URLs, required headers (like
Content-Type), and the specific HTTP methods (GET, POST, PUT, DELETE) supported by each endpoint. - Authentication Requirements: Determine how the API handles security. If it uses OAuth 2.0, you will need a Client ID and Client Secret from the service provider, as well as the correct authorization and token endpoints.
- Endpoint Specifications: Map out exactly which endpoints you need to expose. Do not try to map the entire API if you only need three specific endpoints; keeping the connector lean makes it easier to manage and debug.
- Sample Payloads: Collect examples of the JSON requests and responses. These are invaluable when you begin defining schemas, as you can use the "Import from Sample" feature to automatically generate your data structures.
Warning: Avoid Hard-Coding Secrets Never hard-code API keys, client secrets, or sensitive credentials directly into the connector definition or your code snippets. Always use the platform's secure credential management features, such as environment variables or secret vaults, to handle sensitive information. If a connector is shared, ensure that the authentication settings are configured so that users provide their own credentials or use a service account properly managed by the organization.
Step-by-Step: Creating a Custom Connector
For this walkthrough, we will assume you are using a standard visual editor to create a connector. The process generally follows a logical flow from general information to security, definition, and testing.
Phase 1: General Information
Start by providing a name, description, and an icon for your connector. The icon is particularly important if you are building this for other users; it helps them identify the tool quickly in a crowded list of integrations. You will also need to define the "Host" (the base URL of the API) and the "Base URL" (the specific path prefix).
Phase 2: Security Configuration
Select your authentication type. If you choose OAuth 2.0, you will be prompted to enter:
- Identity Provider: (e.g., Generic OAuth 2, Azure AD, GitHub).
- Client ID and Client Secret: Obtained from the target service's developer portal.
- Authorization URL: The endpoint where the user is redirected to sign in.
- Token URL: The endpoint used to exchange the authorization code for an access token.
- Refresh URL: The endpoint used to refresh the token when it expires.
- Scope: A space-delimited list of permissions required by the API.
Phase 3: Defining Actions
To create an action, you must provide a unique "Operation ID" (used by the system to identify the action), a summary, and a description.
- Request Definition: Click "Import from sample." Paste a sample HTTP request (including headers and body). The platform will parse the structure and create the input fields automatically.
- Response Definition: Similarly, import a sample JSON response. This ensures that when a user uses your action, they can select fields from the response in subsequent steps of their workflow.
Phase 4: Testing
Once the definition is complete, you must test the connector. Before testing, you will need to create a "Connection" object, which stores your credentials. Once connected, navigate to the "Test" tab, select your action, fill in the required parameters, and click "Test Operation." Review the HTTP response to ensure the data returned matches your expectations.
Best Practices for Connector Development
Building a functional connector is only the first step. To ensure that your integration survives the rigors of production, you must adhere to several industry-standard practices.
1. Versioning
APIs evolve. When a service provider updates their API, your connector might break. Always use versioning in your URL paths (e.g., https://api.example.com/v1/...). If you need to make a breaking change to your connector, create a new version of the connector rather than modifying the existing one. This allows existing workflows to continue running on the old version while you migrate users to the new one.
2. Error Handling
Do not assume that every API call will succeed. Configure your connector to handle different HTTP status codes gracefully. For example, if an API returns a 429 Too Many Requests status, ensure your connector respects the Retry-After header. You can often configure retry policies within the platform to automatically attempt a request again if a transient error occurs.
3. Documentation and User Experience
The quality of your connector is judged by how easy it is for others to use.
- Clear Summaries: Use descriptive names for actions, such as "Update Customer Record" instead of just "Update."
- Tooltips: Provide helpful tooltips for every input field. Explain what format is expected (e.g., "ISO 8601 date format").
- Required vs. Optional: Clearly mark required fields. If a field is optional, provide a default value if possible.
4. Security and Scoping
Follow the principle of least privilege. If your connector only needs read access to a database, do not request OAuth scopes that allow for deletion or administration. If you are using API keys, rotate them periodically and monitor access logs to ensure that the connector is not being used in unauthorized ways.
Common Pitfalls and How to Avoid Them
Even experienced developers can run into issues when building custom connectors. Below are the most frequent mistakes and strategies to avoid them.
| Pitfall | Consequence | Prevention Strategy |
|---|---|---|
| Ignoring API Limits | Service gets blocked by the host. | Implement rate limiting or caching within your workflow logic. |
| Static Schema Definitions | Inflexible workflows, hard to map data. | Use dynamic schemas if the API supports it, or define broad objects. |
| Lack of Testing | Runtime errors in production. | Always test in a sandbox environment before deploying to production. |
| Over-complicating Actions | Difficult for users to navigate. | Break large, complex operations into smaller, single-purpose actions. |
| Hard-coded Base URLs | Cannot switch between Dev/Prod. | Use environment variables for base URLs and hostnames. |
The Problem of "Data Bloat"
One common mistake is defining an action that returns a massive, nested JSON object when the user only needs one or two fields. While this might seem convenient, it adds overhead to the platform's processing engine and makes the user interface cluttered. Instead, try to tailor your response schemas to the most common use cases, or provide multiple actions—one for a "Summary" view and one for a "Detailed" view.
Handling Pagination
Many APIs return large datasets in pages. If your custom connector does not handle pagination, your users will only ever see the first 50 or 100 records. Make sure to check the API documentation for pagination patterns (e.g., page and limit parameters, or next_link headers). You can configure the connector to automatically handle these links, allowing the workflow to iterate through thousands of records without manual intervention.
Advanced Configuration: Using OpenAPI Files
For complex APIs, building a connector via the visual editor can be tedious and error-prone. The industry standard is to write an OpenAPI (Swagger) document in YAML or JSON format and import it directly into the platform. This approach is highly recommended for professional-grade integrations.
When you use an OpenAPI file, you have full control over the metadata. You can define complex data types, add validation logic, and even include custom headers that the visual editor might not support.
Example: A Basic OpenAPI Snippet
Below is a simplified example of an OpenAPI definition for a GET request:
openapi: 3.0.0
info:
title: CustomerAPI
version: 1.0.0
paths:
/customers:
get:
summary: Get list of customers
operationId: GetCustomers
responses:
'200':
description: A list of customers
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Customer'
components:
schemas:
Customer:
type: object
properties:
id:
type: string
name:
type: string
This structure is much easier to version control. You can store this YAML file in a Git repository, allowing your team to track changes, review code, and maintain a history of the integration. If you need to make a change, you simply update the YAML file and re-import it into your environment.
Tip: Use Linting Tools When writing OpenAPI specifications, use linting tools like
spectralor online validators. These tools catch common syntax errors, missing definitions, and non-compliance with the OpenAPI standard before you even try to import the file into your platform. This saves a significant amount of time during the debugging phase.
Managing Connector Lifecycles
Once a custom connector is deployed, it enters a lifecycle that requires ongoing management. An environment is dynamic; APIs change, security requirements evolve, and business needs shift.
Monitoring and Logging
Most enterprise platforms provide logs for custom connectors. Monitor these logs regularly to identify patterns of failure. Are users frequently hitting 401 Unauthorized errors? This might indicate that the token refresh logic is failing. Are there recurring 500 Internal Server Errors? This might suggest the target API is struggling or that your connector is sending malformed requests.
User Feedback Loops
Create a feedback loop with the people actually using your connector. They are the best source of information regarding usability issues. If a user tells you that a specific input field is confusing or that an action is missing a necessary parameter, treat that feedback as a prioritized task. A connector that is difficult to use will simply be bypassed, defeating the purpose of building it in the first place.
Retirement and Deprecation
Do not be afraid to retire a connector that is no longer needed or has been replaced by a better, official integration. When you do retire a connector, communicate clearly with the user base. Provide a timeline for the shutdown and, if possible, offer a migration path to the new solution. Leaving "zombie" connectors in an environment creates security risks and makes it harder for administrators to maintain an accurate inventory of integrations.
Frequently Asked Questions (FAQ)
Q: Can I share a custom connector with other users? A: Yes. In most environments, you can share the connector with specific users or groups. This allows you to manage access based on the principle of least privilege. Always check your platform's sharing settings to ensure you are not granting unnecessary permissions.
Q: How do I handle APIs that require custom headers?
A: Both the visual editor and the OpenAPI file approach allow you to define custom headers. In the visual editor, you can add these to the "Request" section of an action. In an OpenAPI file, you define them under the parameters section of the operation.
Q: What if the API uses a non-standard authentication method? A: While most APIs use OAuth or API Keys, some require custom logic (e.g., signing a request with a private key). If your platform supports it, you may need to use "Custom Code" or an "Azure Function" wrapper to handle the authentication handshake before passing the request to the target API.
Q: Is it better to build one massive connector or many small ones? A: It is generally better to build smaller, domain-specific connectors. A "Finance" connector, a "Human Resources" connector, and a "Sales" connector are much easier to manage than one giant "Enterprise" connector that contains 200 different actions.
Key Takeaways
Creating custom connectors is a critical skill for managing modern, interconnected environments. By following the structured approach outlined in this lesson, you ensure that your integrations are robust, secure, and easy to maintain.
- Prioritize Planning: Never start building without a clear map of the API documentation, authentication requirements, and data schemas.
- Leverage OpenAPI: For any non-trivial integration, use OpenAPI specifications. This allows for version control, easier debugging, and more professional management of the connector metadata.
- Focus on the User: A connector's success is defined by its usability. Use clear descriptions, helpful tooltips, and logical action groupings to ensure that non-technical users can leverage the tools you build.
- Security First: Never hard-code credentials. Use secure credential stores and follow the principle of least privilege when configuring scopes and permissions.
- Build for Change: Assume the API will change. Use versioning, implement robust error handling, and monitor your connector logs to proactively address issues before they impact business operations.
- Maintain the Lifecycle: Treat your connectors as software products. Manage their lifecycle from development to testing, production, and eventually, retirement.
- Keep it Modular: Favor smaller, focused connectors over large, monolithic ones to simplify maintenance and improve the developer experience.
By mastering these concepts, you move from simply "connecting services" to building a reliable, scalable foundation for your organization’s digital transformation. Custom connectors are the glue that holds your modern stack together; invest the time to build them well, and they will serve your business for years to come.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons