> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/integrations/robosaur/commands/export-projects.md).

# Export Projects

## How it works

{% code overflow="wrap" %}

```bash
$ npm run start -- export-projects -h
Usage: robosaur export-projects [options] <configFile>

Export all projects based on the given config file

Options:
  -u --unzip  Unzips the exported projects, only storing the final version accepted by reviewers
  -h, --help  display help for command
```

{% endcode %}

* Robosaur exports projects that were previously created using the `create-projects` command.
* Each project is exported as a separate ZIP file under the directory specified in `export.prefix`.
* By default, Robosaur performs a full project export, including each labeler’s version of the project documents.
* For simpler workflows where only the final document version is needed, use the `--unzip` option. When enabled, Robosaur saves only the final version of the documents to the export destination.
* Robosaur exports:
  * Projects that match the configured filters.
  * Projects that have not yet been recorded in the state file.
* Each project is exported only once.

## Configuration

```json
{
  ...
  "export": {
    "source": "local",
    "prefix": "path/to/export/root",
    "teamId": "<TEAM_ID>",
    "statusFilter": [],
    "format": "JSON_ADVANCED",
    "fileTransformerId": null
  },
  ...
}
```

### Storage options

Refer to the [Storage options](/integrations/robosaur/storage-options.md) guide for detailed configuration instructions.

### Format

Refer to the [Supported formats](/compatibility-and-updates/supported-formats.md) to know all the supported formats.

### File transformer ID

You can apply a custom transformation to exported files using a custom script. To create it:

1. Go to Datasaur and open the **File transformers** page.
2. Create a file transformer in the app.
3. Open the file transformer and copy the ID from the URL.
4. Set the ID in `fileTransformerId`.

### Filter <a href="#execution-modes" id="execution-modes"></a>

Robosaur supports filtering exported projects by project status. If `statusFilter` is empty, no status filtering is applied. Supported statuses:

* `CREATED`: Projects that haven't been opened by any labelers.
* `IN_PROGRESS`: Project that have been opened by at least one labeler.
* `REVIEW_READY`: Projects that have been finished by all labelers.
* `IN_REVIEW`: `REVIEW_READY` projects that have been opened by at least one reviewer.
* `COMPLETE`: Projects marked as complete by a reviewer.

## Execution modes <a href="#execution-modes" id="execution-modes"></a>

Robosaur supports two export modes:

* Stateful export (default).
* Stateless export.

### Stateful project export (default) <a href="#stateful-project-creation--export" id="stateful-project-creation--export"></a>

In stateful mode, the state file configured through `projectState` is treated as the source of truth.

Only projects recorded in the state file, typically projects created by Robosaur, are checked against `statusFilter` and exported.

Robosaur also tracks the last exported project status. Subsequent runs only export projects if the project status has progressed forward since the previous export.

### Stateless project export <a href="#stateless-project-export" id="stateless-project-export"></a>

Stateless mode supports exporting projects that were not created by Robosaur. To enable this mode, configure the following fields.

1. `"executionMode"` : Defines whether the exported projects were created with Robosaur. Fill with `"stateless"` for projects created outside Robosaur and `"stateful"` for projects created with Robosaur. The default value is `"stateful"`.
2. `"projectFilter"` : Defines which projects should be exported. Contains the following attributes:
   * `"kind"` (required): Fill with `TOKEN_BASED`, `ROW_BASED`, or `DOCUMENT_BASED` .
   * `"date"`
     * `"newestDate"` (required): Ignores all projects created after this date.
     * `"oldestDate"` : Ignores all projects created before this date.

Example:

```json
...
"export": {
  "source": "local",
  "prefix": "quickstart/token-based/export",
  "teamId": "1",
  "statusFilter": [],
  "executionMode": "stateless",
  "projectFilter": {
    "kind": "TOKEN_BASED",
    "date": {
      "newestDate": "2022-03-11",
      "oldestDate": "2022-03-07"
    }
  },
  "format": "JSON_ADVANCED",
  "fileTransformerId": null
},
...
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.datasaur.ai/integrations/robosaur/commands/export-projects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
