Parse to model
Description
Parses an input stream into a typed model. Pick the model in the inspector and choose the wire format. Branches on success/error so the pipeline can handle malformed input. An array variant parses the stream into an array of the chosen model.
When to use
Use Parse to model to turn raw JSON, YAML, or XML from a stream into a typed model your
pipeline can work with. Pick the target model in the inspector; the node reads the stream,
validates it against that model, and emits the parsed value on its Model output. Because
parsing can fail on malformed or unexpected input, the node sits on the execution flow
and branches: the success pin fires with the parsed Model, the error pin fires when
parsing fails.
It is the usual first step after receiving structured data — parse the body of a Receive HTTP trigger, or the response body of an HTTP request, then wire the Model output into a Break node to read individual fields. When the payload is a list rather than a single object, use the array variant (Parse to model (array)), which emits an array of the chosen model instead.
See the Models tutorial for a full worked example.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Input | Input stream | — | The input stream to parse — for example the body output of a Receive HTTP trigger or an HTTP response body. |
| Format | Data format | JSON | The wire format to parse: JSON, YAML, or XML. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Model | model | The parsed model value, available on the `success` branch. Wire into a Break node to read its fields. |
Execution pins
| Pin | Direction |
|---|---|
| In | Input |
| Success | Output |
| Error | Output |
Example
Parse an incoming webhook body. Wire the body output of Receive HTTP into the Input of
Parse to model, select the expected model in the inspector, and leave Format at JSON.
On the Success execution output, wire the Model output into a Break node to read its
fields; on the Error execution output, wire a Log message or Fail node so malformed
payloads are surfaced.