Skip to main content

Get Dataset

Retrieves details of a dataset including its images and metadata.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Inputs

  • Connection Id (String) - Connection ID from the Connect node (optional if API Key credentials are provided directly).
  • Dataset ID (String) - ID of the dataset to retrieve (from Create Dataset node).

Options

  • API Key - Leonardo AI API key (optional if using Connection ID).

Outputs

  • Response (Object) - Dataset details including:
    • Dataset ID
    • Name
    • Description
    • Created timestamp
    • Updated timestamp
    • Dataset images array with:
      • Image ID
      • Image URL
      • Upload timestamp

How It Works

The Get Dataset node retrieves complete information about a dataset. When executed, the node:

  1. Validates the dataset ID is not empty
  2. Sends a request to Leonardo AI API to fetch dataset details
  3. Returns the dataset object with all images and metadata

Requirements

  • Valid Leonardo AI API key (via Connection ID or credentials)
  • Valid dataset ID from a Create Dataset node

Error Handling

The node will return specific errors in the following cases:

  • Empty dataset ID - "Dataset ID cannot be empty. Please provide a valid dataset ID."
  • API error - "Failed to retrieve dataset. API response: {details}"
  • Dataset not found - API returns error if dataset doesn't exist

Usage Examples

Check Dataset Contents

Verify what images are in a dataset:

  1. Get Dataset with the dataset ID
  2. Extract the dataset_images array from response
  3. Check image count and URLs
  4. Verify all expected images are present

Count Images Before Training

Check if dataset has enough images for training:

// After calling Get Dataset
const dataset = $.response[0];
const imageCount = dataset.dataset_images.length;

if (imageCount >= 5) {
// Proceed with model training
} else {
// Upload more images first
}

List Dataset Images

Get all image URLs from a dataset:

const dataset = $.response[0];
const images = dataset.dataset_images;

images.forEach(image => {
console.log(`Image ID: ${image.id}`);
console.log(`URL: ${image.url}`);
console.log(`Created: ${image.created_at}`);
});

Verify Dataset Before Model Creation

Check dataset is ready for training:

  1. Get Dataset to retrieve details
  2. Verify dataset has 5+ images
  3. Check that all images have valid URLs
  4. Proceed with Create Model if ready

Dataset Audit

Review dataset metadata:

const dataset = $.response[0];

console.log(`Name: ${dataset.name}`);
console.log(`Description: ${dataset.description}`);
console.log(`Created: ${dataset.created_at}`);
console.log(`Last Updated: ${dataset.updated_at}`);
console.log(`Total Images: ${dataset.dataset_images.length}`);

Usage Notes

  • Use this to verify dataset contents before training models
  • The dataset_images array contains all images uploaded to the dataset
  • Image URLs can be used to download or preview the training images
  • Useful for debugging dataset issues
  • Check image count to ensure sufficient training data (5-15 images recommended)
  • Timestamps help track when the dataset was created and modified
  • The response structure is an array with one dataset object
  • Access dataset properties via $.response[0]
  • Can be used to build dataset management dashboards
  • Helpful for auditing and organizing your datasets