# tools.convert

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/tools-convert/
Language: en

`type: "tools.convert"`

Converts a document between formats inside a chain. The pair is checked when the workflow is saved.

Status: 1 credit · from and to required · the pair is validated

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `from` | string | required | The source format. |
| `to` | string | required | The target. **The pair is checked on save.** |
| `url` | string |  | Fetch the source from there. |
| `content` | string |  | The source as text. |
| `base64` | string |  | The source as bytes. |

One of `url`, `content` and `base64` is required — none of them, and the definition is refused.

```javascript
{ id: "pdf", type: "tools.convert", config: {
    from: "markdown", to: "pdf", content: "{{steps.write.output.text}}" } }
```

## An impossible pair never reaches a run {#validated}

> **Checked against the real matrix, on save**
>
> 244 pairs exist. A conversion that is not one of them is refused where you are reading the message, rather than failing on the fifth step of a scheduled run.

## Output {#output}

```javascript
{{steps.pdf.output.base64}}       // binary targets
{{steps.pdf.output.content}}      // text targets
{{steps.pdf.output.mimeType}}
```

## Saving it {#then}

Pass `base64` straight to a [file.save](/sdk/workflows/steps/file-save) step as `contentBase64` — that is how a drafted report becomes a PDF in a bucket.

- [file.save](/sdk/workflows/steps/file-save): Writing the result.
- [api.tools.convert()](/sdk/ref/tools/convert): The matrix.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
{"id": "pdf", "type": "tools.convert", "config": {
    "from": "markdown", "to": "pdf", "content": "{{steps.write.output.text}}"}}
```

```python
"{{steps.pdf.output.base64}}"      # binary targets
"{{steps.pdf.output.content}}"     # text targets
"{{steps.pdf.output.mimeType}}"
```
