Export Destinations#
NexusLIMS uses a plugin-based export framework to publish experimental records to multiple repository systems. After building XML records from microscopy data, the system can export them to one or more configured destinations.
Overview#
The export framework supports:
Multiple destinations running in parallel or sequence
Configurable strategies for handling export failures
Inter-destination dependencies (e.g., cross-linking between systems)
Per-destination tracking in the database
Automatic retry for transient failures
Records are exported immediately after successful building, with results logged to the UploadLog table for tracking and debugging.
Available Export Destinations#
CDCS (Primary)#
Added in version 1.0.0.
The Configurable Data Curation System (CDCS) is the primary and default export destination for NexusLIMS. CDCS provides:
Web-based record viewing and search
Schema validation and versioning
Access control and permissions
RESTful API for programmatic access
Public/private workspace management
Configuration: See CDCS Integration for required settings:
NX_CDCS_URL- CDCS instance URLNX_CDCS_TOKEN- API authentication token
CDCS exports have priority 100 (highest) and run first to ensure records are available for cross-linking by other destinations.
What gets exported:
Complete XML record
XML file uploaded to CDCS document storage
Record indexed and searchable via CDCS interface
Unique record ID assigned for cross-referencing
Frontend repository: NexusLIMS-CDCS
eLabFTW#
Added in version 2.4.0.
eLabFTW is an open-source electronic lab notebook system. NexusLIMS supports creating eLabFTW experiment records that correspond to individual microscopy sessions with:
HTML-formatted session summary
Structured metadata using eLabFTW’s
extra_fieldsschemaAutomatic tagging (instrument, user, NexusLIMS)
Full XML record attached as file
Cross-link to CDCS record (if CDCS export enabled)
Configuration: See eLabFTW Integration for settings:
NX_ELABFTW_URL- eLabFTW instance URLNX_ELABFTW_API_KEY- API authentication keyNX_ELABFTW_EXPERIMENT_CATEGORY- Optional category assignmentNX_ELABFTW_EXPERIMENT_STATUS- Optional status assignment
eLabFTW exports have priority 85 and run after CDCS to enable cross-linking.
What gets exported:
Experiment title: “NexusLIMS Experiment - {session_id}”
Body: HTML with session details and CDCS link
Tags: NexusLIMS, instrument name, username
Metadata: Structured extra_fields (session times, instrument, user, CDCS URL)
Attachment: Complete XML record file
Example experiment view:
<h1>NexusLIMS Microscopy Session</h1>
<h2>Session Details</h2>
<ul>
<li><strong>Session ID</strong>: 2025-01-27_10-30-15_abc123</li>
<li><strong>Instrument</strong>: FEI-Titan-TEM-012345</li>
<li><strong>User</strong>: jsmith</li>
<li><strong>Start</strong>: 2025-01-27T10:30:15+00:00</li>
<li><strong>End</strong>: 2025-01-27T14:45:00+00:00</li>
</ul>
<h2>Related Records</h2>
<ul>
<li><a href="https://cdcs.example.com/data/123">View in CDCS</a></li>
</ul>
LabArchives#
Added in version 2.6.0.
LabArchives is a commercial electronic lab notebook system. NexusLIMS supports exporting session records to LabArchives with:
HTML-formatted session summary with a gallery of preview images
A list of all data files contained in the experiment
The full XML record attached as a file
Cross-link to CDCS record (if CDCS export enabled)
Configuration: See LabArchives Integration for settings:
NX_LABARCHIVES_URL- LabArchives instance URLNX_LABARCHIVES_ACCESS_KEY_ID- API access key IDNX_LABARCHIVES_ACCESS_PASSWORD- API signing passwordNX_LABARCHIVES_USER_ID- Pre-authenticated user ID (uid)NX_LABARCHIVES_NOTEBOOK_ID- Optional target notebook (uses Inbox if unset)
LabArchives exports have priority 90 and run after CDCS (to allow cross-linking).
What gets exported:
Notebook structure:
NexusLIMS Records/{instrument_pid}/{YYYY-MM-DD — session_id}page (auto-created if it doesn’t exist)HTML summary: Session details and optional link to CDCS record
Attachment: Complete XML record file
Export Workflow#
The export process runs automatically as part of process_new_records() workflow:
Build record: The experimental record is generated from session data and validated against the NexusLIMS experiment schema
Export to destinations:
export_records()determines which exporters should be run, depending on system configurationExecute by priority: Individual destination export routines are run in priority order (highest first)
Track results: Export outcomes are logged to the
UploadLogtableUpdate session status:
COMPLETEDif exports succeedBUILT_NOT_EXPORTEDif exporting fails
Archive successfully exported files: Move to
uploaded/directory
Export Strategies#
Multi-destination behavior can be configured with the NX_EXPORT_STRATEGY setting, depending on your deployment’s needs:
Strategy |
Behavior |
|---|---|
|
Export to all enabled destinations. Fails if any destination fails. |
|
Stop after first successful export. Remaining destinations skipped. |
|
Attempt all destinations. Succeeds if at least one succeeds. |
Example configuration:
NX_EXPORT_STRATEGY=best_effort # Continue even if some destinations fail
Inter-Destination Dependencies#
Export destinations can access results from higher-priority destinations to create cross-links:
# In eLabFTW export destination
def export(self, context: ExportContext) -> ExportResult:
# Get CDCS result (priority 100, runs first)
cdcs_result = context.get_result("cdcs")
if cdcs_result and cdcs_result.success:
# Include CDCS URL in eLabFTW metadata
cdcs_url = cdcs_result.record_url
# Add to experiment body and metadata...
This enables:
Cross-linking: eLabFTW experiments link to CDCS records
Cascading updates: Downstream destinations use upstream IDs
Conditional behavior: Skip exports if upstream dependencies fail
See Inter-Destination Dependencies in the developer guide for implementation details.
Monitoring Exports#
Database Tracking#
All export attempts are logged to the upload_log table:
SELECT destination_name, success, timestamp, error_message
FROM upload_log
WHERE session_identifier = 'your-session-id'
ORDER BY timestamp DESC;
Schema: UploadLog
Session Status#
Session records track overall export status in session_log.record_status:
Status |
Meaning |
|---|---|
|
Session needs record generation |
|
Record built and exported successfully |
|
Record built but all exports failed |
|
Record building failed |
|
No files found for session |
Check session status:
SELECT instrument, record_status, timestamp
FROM session_log
WHERE session_identifier = 'your-session-id';
Export Logs#
Detailed export logs are written to NX_LOG_PATH (or NX_DATA_PATH/logs/):
nexuslims_record_builder.log- Main processing log with export resultsIndividual destination errors logged with context
Troubleshooting#
Export Failures#
Common issues:
Problem |
Solution |
|---|---|
CDCS authentication failed |
Verify |
eLabFTW API errors |
Check |
All exports failed |
Check logs in |
Session marked |
Review |
Debug export issues:
Check configuration:
from nexusLIMS.config import settings print(f"CDCS URL: {settings.NX_CDCS_URL}") print(f"eLabFTW URL: {settings.NX_ELABFTW_URL}")
Query upload logs:
SELECT * FROM upload_log WHERE success = 0 ORDER BY timestamp DESC LIMIT 10;
Review main log file for detailed errors
Validation#
Test export destination configuration:
from nexusLIMS.exporters.registry import get_enabled_destinations
for dest in get_enabled_destinations():
is_valid, error = dest.validate_config()
print(f"{dest.name}: {'✓' if is_valid else '✗'} {error or ''}")
Developing Custom Destinations#
NexusLIMS’s plugin architecture makes it easy to add new export destinations. No core modifications needed—just drop a Python file in nexusLIMS/exporters/destinations/.
Common use cases:
Export to institutional repositories (Zenodo, Figshare, Dataverse)
Push to cloud storage (S3, Azure, Google Cloud)
Integrate with other LIMS systems
Custom archival workflows
See Writing Export Destination Plugins for:
Complete implementation guide
Protocol requirements and testing strategies
Example implementations
Inter-destination dependency patterns
Quick start: Copy an existing destination (e.g., elabftw.py) and customize for your target system.
API Reference#
Key modules for export functionality:
nexusLIMS.exporters- Main export frameworknexusLIMS.exporters.base- Base classes and protocolsnexusLIMS.exporters.registry- Plugin discovery and managementnexusLIMS.exporters.destinations.cdcs- CDCS export implementationnexusLIMS.exporters.destinations.elabftw- eLabFTW export implementationnexusLIMS.exporters.destinations.labarchives- LabArchives export implementationnexusLIMS.db.models- Database models (UploadLog, SessionLog)
Summary#
The export framework provides:
Multiple repository support (CDCS, eLabFTW, LabArchives, custom destinations)
Automatic export after record building
Configurable failure handling strategies
Inter-destination cross-linking
Complete tracking and logging
Plugin-based extensibility
Export destinations are configured via environment variables and automatically activated when credentials are provided. No additional setup required beyond configuration.