benchling-integration
Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.
Author
Category
Development ToolsInstall
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Benchling Integration - Laboratory Data Automation Integration Skills
Skill Overview
Benchling Integration is a Python automation skill designed specifically for life sciences R&D teams. Through the Benchling Python SDK and REST API, it helps you manage DNA/RNA sequences, track sample inventory, automate experiment records, build workflows, and seamlessly integrate with external systems.
Use Cases
1. Bulk Management of Biological Sequences
When you need to batch import, register, or manage DNA, RNA, or protein sequences, this skill can directly read FASTA files and automatically create entities. It supports standardized naming and version management for sequence registries, reducing the risk of errors from manual data entry.
2. Automated Laboratory Inventory Tracking
Suitable for laboratories that need to track sample locations, container transfers, and inventory status in real time. Automated scripts can record sample transfers between locations, update concentrations, and perform batch inventory counts, reducing manual errors and improving inventory visibility.
3. Workflow Automation and System Integration
When laboratory processes need to automatically trigger task assignments, status updates, or cross-system data synchronization, this skill can monitor Benchling events and trigger downstream systems—such as Lambda, data warehouses, or external LIMS—through AWS EventBridge or webhooks, enabling end-to-end process automation.
Core Features
1. Comprehensive Entity Management
Supports the full lifecycle management of DNA sequences, RNA sequences, amino acid sequences, custom entities, and mixtures, including creation, retrieval, updating, archiving, and registry registration. It provides paginated iteration and batch operation capabilities for efficiently processing large-scale entity libraries.
2. Flexible Authentication and Security Mechanisms
Provides both API key and OAuth authentication methods, supporting single-user scripts and multi-user applications. It automatically handles request retries and error recovery to ensure secure communication with tenant URLs. It follows the principle of least privilege to help prevent credential exposure.
3. Event-Driven Integration Architecture
Subscribe to Benchling platform events—such as sequence creation, entity registration, and task status changes—through AWS EventBridge, and use Lambda functions to implement real-time responses. Event filtering, rule matching, and checkpoint recovery are supported, enabling the construction of reliable laboratory data synchronization pipelines.
Frequently Asked Questions
How do I install and configure the Benchling Python SDK?
Install the stable version using uv pip install "benchling-sdk==1.25.0". Configuration requires setting two environment variables: BENCHLING_TENANT_URL (your Benchling tenant address) and BENCHLING_API_KEY (obtained from your personal settings). ApiKeyAuth is recommended for quick authentication, while OAuth client credentials are recommended for production environments.
How do I batch import DNA sequences into Benchling?
Use Python’s BioPython library to parse FASTA files and iterate through the sequence records with the dna_sequences.create() method from benchling-sdk. Each sequence requires a name, base sequence, and folder ID. You can optionally specify whether the sequence is circular and provide a registry ID. Before importing, it is recommended to use estimated_count() to check the existing data volume.
How do I configure Benchling EventBridge integration?
First, create an event subscription in the Benchling administration console. Then, in AWS, associate the partner event source with a dedicated event bus; this must be completed within 12 days. Create a CloudWatch rule to filter the event types of interest, such as v2.dnaSequence.created, and set Lambda, SQS, or SNS as the target. Finally, verify event reception through CloudWatch Logs rules.