---
title: "Creating a data subscription: Studio"
description: "Create a data subscription task in RavenDB Studio: write the subscription query, set the starting point and responsible node, test the query, and save the task."
url: "https://docs.ravendb.net/7.2/data-subscriptions/creating-subscription/creating-subscription_studio"
version: "7.2"
---

# Creating a data subscription: Studio

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Creating a data subscription: Studio

> **Note**
>
> - This page explains how to create a data subscription using Studio.  
>   You can also [create a subscription using the Client API](https://docs.ravendb.net/7.2/data-subscriptions/creating-subscription/creating-subscription_api.md).
>
> - In this article:
>   - [Defining the subscription task](#defining-the-subscription-task)

## Defining the subscription task {#defining-the-subscription-task}

To create a subscription, open **`Tasks` > `Ongoing Tasks` > `Add a database task`** and select **Subscription**.

![Open the ongoing tasks view](https://docs.ravendb.net/assets/images/subscriptions_ongoing-tasks-view-ca1d4254cdfc5ca8c5522fc50d0ce833.png)

1. Open the **Tasks** menu.
2. Select **Ongoing Tasks**.
3. Click **Add a database task** and select **Subscription**.

   ![Open the ongoing tasks view](https://docs.ravendb.net/assets/images/subscriptions_subscription-task-selection-64228555788c4bf4ba2c353a59ca4d7e.png)

Enter a task name, then define the subscription:

![Defining the subscription task](https://docs.ravendb.net/assets/images/subscriptions_define-task-1bdb0ac9e8ca8357d7b8ee62d5de13ff.png)

1. **Task name**  
   Enter a name for the subscription task.

2. **Task state**  
   Enable or disable the task.

3. **Subscription RQL**  
   The [subscription query](https://docs.ravendb.net/7.2/data-subscriptions/creating-subscription/creating-subscription_api.md#subscription-query), written in [RQL](https://docs.ravendb.net/7.2/querying/rql/what-is-rql.md),
   that defines the documents the server sends to the worker.  
   e.g., `from Orders`  
   Click **Syntax** for help writing the query.

4. **Archived data processing behavior**

   ![Defining the subscription task](https://docs.ravendb.net/assets/images/subscriptions_archived-data-processing-22b53bb45e159a49b055084d1db80254.png)

   Set the subscription's handling of archived documents:

   - **Default**: The subscription uses the behavior [configured for the server or database](https://docs.ravendb.net/7.2/data-subscriptions/configuration.md#subscriptionsarchiveddataprocessingbehavior).
   - **Exclude Archived**: The subscription selects only non-archived documents.
   - **Include Archived**: The subscription selects both archived and non-archived documents.
   - **Archived Only**: The subscription selects only archived documents.

   > **Note**
   >
   > On a [sharded database](https://docs.ravendb.net/7.2/sharding/subscriptions.md#unsupported-features), this option has no effect, and all subscriptions handle archived documents
   > as set by the [Subscriptions.ArchivedDataProcessingBehavior](https://docs.ravendb.net/7.2/data-subscriptions/configuration.md#subscriptionsarchiveddataprocessingbehavior) configuration key.  
   > To learn more about a subscription's handling of archived documents, see [Data archival: Archived documents and subscriptions](https://docs.ravendb.net/7.2/data-archival/archived-documents-and-other-features.md#archived-documents-and-subscriptions).

5. **Use a defined starting point**

   ![Defining the subscription task](https://docs.ravendb.net/assets/images/subscriptions_use-defined-starting-point-50461da943e343b1b71293aba8be87c4.png)

   Set the point from which the server sends the first batch.

   - **Beginning of Time** (default): the server sends every document matching the query, regardless of its creation or modification time.
   - **Latest Document**: the server sends only documents created or modified after the subscription's creation.
   - **Change Vector**: start from a specified document change vector.

6. **Set responsible node**

   ![Defining the subscription task](https://docs.ravendb.net/assets/images/subscriptions_set-responsible-node-96ae9c5636974acd64fbf041f42bd7dc.png)

   Toggle **Set responsible node** to choose the responsible node yourself.  
   By default, the server selects the responsible node. If that node goes down and your license includes
   [highly available tasks](https://docs.ravendb.net/7.2/server/clustering/distribution/highly-available-tasks.md), the server
   automatically reassigns the subscription to another node.

   - When you select a responsible node manually, you can also **pin** it to the task. Pinning prevents
     another node from taking over if the responsible node goes down.

     ![Defining the subscription task](https://raw.githubusercontent.com/ravendb/docs/main/docs/data-subscriptions/creating-subscription/assets/subscriptions_set-responsible-node_pin-node.png)

7. **Test subscription**

   ![Testing the subscription](https://docs.ravendb.net/assets/images/subscriptions_test-subscription-94e21d0a9bd8fdb5787b34cdf33aaffc.png)

   Testing shows the documents that match the subscription's query, so you can verify it before saving the task.

   - **A. Results limit** - The maximum number of documents to retrieve for the test.
   - **B. Time limit** - The test run time, in seconds. Default: 15.
   - **C. Run Test** - Click to run the test and preview the matching documents in the results table.

Click **Save** to create the task, or **Cancel** to discard it.
