Skip to main content

Custom Drive Connector

Just like other services in Collate (Database, Pipelines, Dashboards, Messaging, etc.), it’s possible to create a Custom Drive Connector to bring metadata from a storage or file system-like service into Collate. In this guide, we’ll walk through how to implement your own Custom Drive Connector by extending the ingestion framework. The implementation pattern follows other service types closely, making the transition smooth for anyone familiar with the ecosystem.
Tip: Review the tested Custom Drive connector for a complete implementation.
Watch Collate’s Webinar on Custom Connectors to get more context on how to build these integrations.

Steps to Set Up a Custom Drive Connector

Step 1 - Prepare Your Drive Connector

A Custom Drive Connector is a Python class that inherits from:
It must implement required methods such as:
  • prepare
  • _iter
  • test_connection (optional but recommended so the UI can validate access)
Inside my_drive_connector.py, define your class:
Tip: _iter is a generator that produces the CreateEntityRequest instances expected by the ingestion framework.
For more on the ingestion framework, refer to the Ingestion Workflow Docs.

Step 2 - Yield Drive Data as Entities

You need to yield CreateEntityRequest objects wrapped in an Either type. This pattern handles both successful entity creation and errors. Import necessary types:
Example usage:
Extend the same pattern with CreateSpreadsheetRequest and CreateWorksheetRequest if your Drive service exposes those concepts.

Step 3 - Package Your Custom Drive Connector

To use the connector, package it as a Python module. A minimal setup.py may look like:
Build the package:

Step 4 - Update the Ingestion Image

To run your Custom Drive Connector inside Docker (e.g., with Airflow or directly from the UI), the ingestion image must include your module. Dockerfile example:
This ensures that your code is baked into the ingestion container. Always align the ingestion image tag with the Collate version that is running your server/UI.

Step 5 - Run Collate with Custom Image

If you’re using Docker Compose, update your setup to use the new image.

Step 6 - Configure Custom Drive in Collate UI

  1. Navigate to Drive Services.
  2. Click Add New Service > Custom.
  3. Enter your Source Python Class as:
Ensure the full module path is specified so Collate can import the connector. Custom Connector

Configure Metadata Agent and Schedule Ingestion

The Metadata Agent extracts directories, files, spreadsheets, and other structural metadata from your source and keeps your Collate catalog in sync. It powers discovery, lineage, and governance across your data assets. When you click Create & Deploy, Collate automatically deploys a Metadata Agent for this service and triggers the first ingestion run. View its status and run history from the Agents tab on the service detail page. To configure the additional Metadata Agent and schedule ingestion, follow these steps:
  1. In the left navigation, click Connections and select your service.
  2. Click the Agents tab.
  3. Click Add Agent and select Metadata from the dropdown. Add Metadata Agent For some services, the dropdown is not available and clicking Add Agent takes you directly to the agent configuration page.
  4. On the Configure Ingestion page, do the following and click Next.
    • Name this Ingestion: Enter a unique recognizable name for this ingestion pipeline. Name this Ingestion
    • Agent Setup: Configure the core parameters for this agent. The following fields are available: Agent Setup
    • Filter Patterns: Apply include or exclude rules to scope which directories, files, spreadsheets, and worksheets this agent ingests. Use FQN for filtering to apply regex on fully qualified names (e.g. service_name.directory_name.file_name) instead of raw names. These follow the same filter options described in Step 5. Filter Patterns
    • Scope & Behaviour: Control what metadata to include and how to handle deletions. Toggle each option on or off based on your needs: Scope & Behaviour
  5. On the Schedule Interval page, set when the agent runs:
    • Schedule: Choose a preset interval (Hourly, Daily, Weekly, Monthly) or enter a custom cron expression.
    • On-Demand: No automatic schedule; trigger the agent manually when needed.
    Schedule Interval
  6. Click Add to deploy the agent.