# Input and Output Transformers

## Input Transformers

**Input transformers** are used to map the outputs of the previous node to the inputs of the current node.

By selecting a node and clicking on the *Input* tab, we can add custom logic to the input transformer.

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FalhrkiVQgKLLpj7U5KyZ%2FScreenshot%202024-10-21%20at%2016.12.03.png?alt=media&#x26;token=cfcf4aca-0d94-4526-80b9-db0c7581d4cd" alt=""><figcaption></figcaption></figure>

The **input** parameters of the **OpenAI** Node will be mapped with the **input** parameters of the **Input** Node.

In a workflow, if nodes are connected directly, an input transformer field will be empty and must to be written manually. However, if the parameters of the nodes are connected, the appropriate mapping will be automatically established - [here's an example](https://docs.getdynamiq.ai/low-code-builder/connecting-nodes).

Input transformers use the next format of JSONPath syntax:

```
$.{node_name}.output.{parameter_name}
```

## Output Transformers

**Output transformers** serve a similar purpose as input transformers but are applied to the output of the nodes. They are particularly useful in cases where the output is shared among multiple nodes. This allows us to write the output transformer once, avoiding the need to create individual Input Transformers for each node that receives this output.

You can specify the logic for output transformers in the Output tab.

<figure><img src="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2F5GH6YDdlNFelYz6w9YTA%2FImage%2021.10.2024%20at%2017.20.jpg?alt=media&#x26;token=5204894e-9d3f-434a-a870-f411a645e55a" alt=""><figcaption><p>Example of usage of Output Transformers</p></figcaption></figure>

In this example, the ScaleSerp Node returns a dictionary of data containing both output and metadata. By using output transformers, we can extract only the results found under the *result* key.&#x20;

Output transformers are also useful for ensuring proper parsing when passing an output to the Output Node that does not include an input transformer.
