On this page
Sommatic Docs
Open portal

Parse Data

Parses a raw string into a structured data object.

View as Markdown
Open in
Data Partial data.parse Version 1.0.0 Execution: sync

Parses a JSON or CSV string into structured data, which replaces the payload.

Essential for handling incoming data from external systems, files, or legacy APIs that return data as serialized strings (JSON, CSV, XML, YAML).

Supported Formats:

  • JSON: Standard JSON parsing.
  • CSV: Comma-Separated Values (can output Array of Objects).
  • XML: Converts XML to JSON structure.
  • YAML: Parse YAML to JSON.

Use Cases:

  • Converting an HTTP response body string into useable JSON variables.
  • Parsing a CSV file uploaded by a user.

How it works

  1. Resolves the config. The input is input_data when it is set and not empty; otherwise the whole incoming payload.
  2. If the input is not a string: with format json an object is returned unchanged through out; anything else fails.
  3. json: JSON.parse; the result (object, array or primitive) becomes the payload.
  4. csv: splits lines on \n or \r\n and drops blank lines. With csv_options.has_header (default true) returns an array of objects keyed by the trimmed header names; without it, an array of arrays. Values stay strings.
  5. xml and yaml are declared but not implemented: they fail.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-parse-csv",
  "label": "Parse inventory CSV",
  "operator_slug": "data.parse",
  "operator_version": "1.0.0",
  "config": {
    "input_data": "{{ $json.raw_csv }}",
    "format": "csv",
    "csv_options": {
      "has_header": true,
      "delimiter": ","
    }
  }
}

Configuration

input_data string Optional

The string to parse. Use expressions to pick a specific field (e.g., {{ $json.raw_text }}). If empty, the entire payload is evaluated.

format string Optional

Default: json

Allowed values: jsoncsvxmlyaml

csv_options object Optional
has_header boolean Optional

Default: true

delimiter string Optional

Default: ,

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

csv_options
delimiter (default ,) and has_header (default true). Quotes are not handled: a delimiter inside quotes splits the field and the quotes are kept. Missing trailing values are left out of the row object.

Output ports

out default

Parsing succeeded. The parsed value is the whole data (here, CSV with header).

Data
[
  {
    "sku": "A-1",
    "qty": "3"
  },
  {
    "sku": "B-2",
    "qty": "5"
  }
]
error

The input is not a string, the text is malformed or the format is not implemented.

Data
{
  "ok": false,
  "errors": [
    "Parse Error (json): Unexpected end of JSON input"
  ],
  "port": "error"
}

In expressions

What a later node can read from this node's output with $("Parse Data").item.json.<path> (write your node's label instead of Parse Data). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Parse Data").item.json.parsedanyThe worker does not return it: reads as undefinedThe structured result (Object/Array). —

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

Errors

Message Port Cause and fix
Input data is not a string error input_data resolved to a non-string (or the payload is an object) and format is not json. Point input_data at the text field, for example {{ $json.raw_csv }}.
Parse Error (json): <JSON.parse message> error The text is not valid JSON.
Parse Error (xml): Format xml not supported yet. error xml (and likewise yaml) has no parser.

Input contract

raw string Required

The raw string to parse.

Output contract

parsed any Optional

The structured result (Object/Array).

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "data.parse",
  "name": "Parse Data",
  "category": "data",
  "version": "1.0.0",
  "description": "Parses a raw string into a structured data object.\n\n  Essential for handling incoming data from external systems, files, or legacy APIs that return data as serialized strings (JSON, CSV, XML, YAML).\n\n  **Supported Formats:**\n  - **JSON:** Standard JSON parsing.\n  - **CSV:** Comma-Separated Values (can output Array of Objects).\n  - **XML:** Converts XML to JSON structure.\n  - **YAML:** Parse YAML to JSON.\n\n  **Use Cases:**\n  - Converting an HTTP response body string into useable JSON variables.\n  - Parsing a CSV file uploaded by a user.",
  "capabilities": [
    "parsing",
    "format-conversion",
    "transform"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "input_data": {
        "type": "string",
        "title": "Input Data",
        "description": "The string to parse. Use expressions to pick a specific field (e.g., {{ $json.raw_text }}). If empty, the entire payload is evaluated."
      },
      "format": {
        "type": "string",
        "enum": [
          "json",
          "csv",
          "xml",
          "yaml"
        ],
        "default": "json",
        "title": "Format"
      },
      "csv_options": {
        "type": "object",
        "properties": {
          "has_header": {
            "type": "boolean",
            "default": true
          },
          "delimiter": {
            "type": "string",
            "default": ","
          }
        }
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "raw": {
        "type": "string",
        "description": "The raw string to parse."
      }
    },
    "required": [
      "raw"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "parsed": {
        "type": "any",
        "description": "The structured result (Object/Array)."
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Success",
      "is_default": true,
      "description": "Parsing successful."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Parsing failed (e.g. malformed JSON)."
    }
  ],
  "execution_mode": "sync",
  "tags": [
    "json",
    "csv",
    "xml",
    "parser"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}

Execution

Execution
sync
Stateful
No
Retries (retryOnFail)
No
Capabilities
parsingformat-conversiontransform
Tags
jsoncsvxmlparser

Notes and limits

  • The output contract mentions parsed, but the parsed value replaces the payload directly.
  • If the parsed value is falsy (0, false, null, ""), the engine stores the whole envelope { ok, data, port } as the output instead.
  • When the envelope has no data (or data is falsy), the engine stores the whole envelope as the node output: on error the next node receives { ok: false, errors: [...], port: "error" } as its payload.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs