# document.save

Canonical URL: https://developers.iagenify.com/pt/sdk/workflows/steps/document-save/
Language: pt

`type: "document.save"`

Scrie un documente in un stoccaj e lo indexa, perciocè una ricerca semântica posteriore puè trovalo per significat.

Status: storage and path required · indexes it · chunks reported

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storage` | string | obrigatório | Onde va. |
| `path` | string | obrigatório | Nome del document. |
| `content` | any |  | Contenzios textu. |
| `contentBase64` | string |  | Bytes — a PDF, a DOCX. |

```javascript
{ id: "index", type: "document.save", config: {
    storage: "…", path: "digests/{{input.week}}.md",
    content: "{{steps.write.output.text}}" } }
```

## Qua indexare adcresce {#difference}

> **Chiude un ciclo una catena non puère chiudere da sè**
>
> La ricerca semantica solo trova quello che era indexat. Senza questo passo un flusso di lavoro potrebbe produrre centa reporti e mai essere in grado di trovare uno di essi da quello che dice.

## Saída {#output}

```javascript
{{steps.index.output.document}}   // its identifier
{{steps.index.output.chunks}}     // how many pieces were indexed
{{steps.index.output.bytes}}
```

## Retrouvalo {#finding}

```javascript
{ id: "recall", type: "storage.query", config: {
    storage: "…", action: "search", query: "{{input.question}}" } }
```

## Custo {#cost}

I bytes contant a par l'archivament, come ogni file. La ricerca che trova posteriore costa un credito per chiamata.

- [file.save](/pt/sdk/workflows/steps/file-save): Scrivere senza indexare.
- [storage.query](/pt/sdk/workflows/steps/storage-query): - Indagazione.
- [Etapas do fluxo de trabalho](/pt/sdk/workflows/steps): Os 23 tipos.

```python
{"id": "index", "type": "document.save", "config": {
    "storage": "…", "path": "digests/{{input.week}}.md",
    "content": "{{steps.write.output.text}}"}}
```

```python
"{{steps.index.output.document}}"   # its identifier
"{{steps.index.output.chunks}}"     # how many pieces were indexed
"{{steps.index.output.bytes}}"
```

```python
{"id": "recall", "type": "storage.query", "config": {
    "storage": "…", "action": "search", "query": "{{input.question}}"}}
```
