# pipe

## Definition

In a config modifier schema, use `pipe` to stack the outcome of a previous keyword as the input of the next. The keywords need to exist at the same nesting level for the keywords to be evaluated in order.

Think of `pipe` like a data assembly line. Instead of running just one action, `pipe` takes the starting payload, runs the first action, takes the _result_ of that action, and feeds it directly into the second action, and so on. This allows you to chain multiple transformations together in a specific sequence.

> **Exclusive keywords**
>
> If `properties`, `if`, `concat`,  `switch`, `pipe`, `merge`, `prefer`, or `items` are present at the same nesting level, only the first keyword listed will run. We recommend not listing these keywords together at the same nesting level. 

## Order of execution

This keyword executes in the following order: 

1. `omit`
2. `constant`
3. `references`
4. `use`
5. `get`
6. Mutually exclusive keywords at this level:
   - `properties` 
   - `if` 
   - `concat` 
   - `switch` 
   - **`pipe`** 
   - `merge` 
   - `prefer` 
   - `items`
7. `default`
8. `plugin`

## Example

You can change `VisitDateTime` to ISO format.

**Example: Pipe input from initial payload**

```json
{
  "Visit": {
    ...
    "VisitDateTime": "2025-06-11 00:00:00Z",
    ...
  }
}  
```

**Example: Pipe selector**

```json
$.Visit.VisitDateTime
```

**Example: Config modifier with pipe keyword**

```yaml
pipe:
  - plugin:
      name: text
      action: split
      parameters:
        separator: Z
        getIndex: 0
  - plugin:
      name: date-time
      action: parse
      parameters:
        custom: yyyy-MM-dd HH:mm:ss
        timeZone: America/New_York
```

Based on this example config modifier schema, `VisitDateTime` is updated to ISO format.

**Example: Pipe output in processed payload**

```json
{
  "Visit": {
    ...
    "VisitDateTime": "2025-06-11T00:00:00.000-04:00",
    ...
  }
}
```
