> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Dataset

> Finds the first Supervisely dataset with the specified name inside the project and returns it. If no dataset with that name exists, creates a new one.

## Overview

Creates or finds a [Supervisely dataset](https://docs.supervisely.com/data-organization/project-dataset/data-structure#projects-and-datasets) by name.
If no matching dataset exists, the node creates it.
The node requires a Supervisely project ID and a configured Supervisely secret with the server address and API token.

```mermaid
flowchart LR
  n1["Supervisely project"] --> n2["Supervisely dataset"]
```

## Prerequisites

| Requirement                 | What you need                                                                                   |
| --------------------------- | ----------------------------------------------------------------------------------------------- |
| **Supervisely credentials** | An existing `supervisely` secret with API access to the target team.                            |
| **Target project**          | A project URL or ID, or a named flow so the project can be found or created from the flow name. |

## How it works

Resolves the project from **Project URL or ID** when one is given.

Otherwise resolves the team and its `OvalBee` workspace, then finds or creates a project named after the flow.

Searches that project for a dataset with the exact name.

Returns the first match, or creates the dataset, and publishes its ID, URL, preview, and item count.

## FAQ

#### How is the project chosen when Project URL or ID is empty?

The node takes the first team on the account, uses its `OvalBee` workspace, and finds or creates a project named after the current flow. A flow without a name fails the run.

#### Does the node change an existing dataset?

No. It returns the first dataset with that name and leaves its contents untouched.

#### Why did the node pick the wrong dataset?

Several datasets in the project share that exact name, so the first match was used. Give each dataset a unique name when the choice must be predictable.

#### What happens if the dataset name is empty?

The run fails before anything is created.

## Inputs

**`Dataset name`** `string` — required

Exact dataset name to find or create. Key: `DATASET_NAME`.

---

**`Supervisely credentials`** `secret` — required

Your Supervisely server address and API token, stored as a secret. Allowed credential types: `supervisely`. Key: `SLY_SECRET`.

---

**`Project URL or ID`** `string`

Supervisely project the dataset belongs to, given as its URL or numeric ID. Leave empty to find or create a project named after the flow. Key: `SLY_PROJECT_URL`.

---

**`Workspace ID`** `integer`

Supervisely workspace the project is looked up in. Leave empty to use the OvalBee workspace of the selected team, created when it is not there yet. Key: `SLY_WORKSPACE_ID`.

---

**`Team ID`** `integer`

Supervisely team the workspace is looked up in. Leave empty to use the first team on your account. Key: `SLY_TEAM_ID`.

---

## Outputs

**`Supervisely Dataset ID`** `integer`

ID of the first existing dataset with the requested name, or the newly created dataset. Key: `SLY_DATASET_ID`.

---

**`Supervisely Dataset URL`** `string`

URL of the existing or newly created Supervisely dataset. Key: `SLY_DATASET_URL`.

---

**`Items Count Str`** `string`

String representation of the number of items in the dataset. Key: `ITEMS_COUNT_STR`.

---

**`Preview Image URL`** `string`

URL of the preview image from the dataset Key: `PREVIEW_IMAGE_URL`.

---

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Dataset",
  "description": "Finds the first Supervisely dataset with the specified name inside the project and returns it. If no dataset with that name exists, creates a new one.",
  "category": "Supervisely",
  "namespace": "supervisely",
  "templateKey": "supervisely/dataset",
  "version": "v1",
  "inputs": [
    {
      "key": "DATASET_NAME",
      "label": "Dataset name",
      "type": "string",
      "description": "Exact dataset name to find or create.",
      "required": true,
      "default": null,
      "visibleWhen": null
    },
    {
      "key": "SLY_SECRET",
      "label": "Supervisely credentials",
      "type": "secret",
      "description": "Your Supervisely server address and API token, stored as a secret.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "types": [
          "supervisely"
        ]
      }
    },
    {
      "key": "SLY_PROJECT_URL",
      "label": "Project URL or ID",
      "type": "string",
      "description": "Supervisely project the dataset belongs to, given as its URL or numeric ID. Leave empty to find or create a project named after the flow.\n",
      "required": false,
      "default": null,
      "visibleWhen": null
    },
    {
      "key": "SLY_WORKSPACE_ID",
      "label": "Workspace ID",
      "type": "number",
      "description": "Supervisely workspace the project is looked up in. Leave empty to use the OvalBee workspace of the selected team, created when it is not there yet.\n",
      "required": false,
      "default": null,
      "visibleWhen": null,
      "options": {
        "type": "integer"
      }
    },
    {
      "key": "SLY_TEAM_ID",
      "label": "Team ID",
      "type": "number",
      "description": "Supervisely team the workspace is looked up in. Leave empty to use the first team on your account.\n",
      "required": false,
      "default": null,
      "visibleWhen": null,
      "options": {
        "type": "integer"
      }
    }
  ],
  "outputs": [
    {
      "key": "SLY_DATASET_ID",
      "label": "Supervisely Dataset ID",
      "type": "number",
      "description": "ID of the first existing dataset with the requested name, or the newly created dataset.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": false,
      "options": {
        "type": "integer"
      }
    },
    {
      "key": "SLY_DATASET_URL",
      "label": "Supervisely Dataset URL",
      "type": "string",
      "description": "URL of the existing or newly created Supervisely dataset.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "ITEMS_COUNT_STR",
      "label": "Items Count Str",
      "type": "string",
      "description": "String representation of the number of items in the dataset.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    },
    {
      "key": "PREVIEW_IMAGE_URL",
      "label": "Preview Image URL",
      "type": "string",
      "description": "URL of the preview image from the dataset",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "automation": {
    "isolated": true,
    "requires_configuration": true,
    "discard_history": "on_success"
  },
  "widgets": {
    "widget": {
      "id": "image-preview",
      "settings": {
        "imageUrl": {
          "type": "variable",
          "value": "self.outputs.PREVIEW_IMAGE_URL"
        },
        "linkUrl": {
          "type": "variable",
          "value": "self.outputs.SLY_DATASET_URL"
        },
        "badge": {
          "type": "variable",
          "value": "self.outputs.ITEMS_COUNT_STR"
        }
      }
    }
  }
}
```