Skip to main content

Message node

Transform

What it does​

The Message node turns rows into a formatted message: the text or bytes of a file or an API body. It builds the message; a Load node delivers it.

Formats: Delimited (CSV, TSV or any delimiter), JSON, NDJSON, YAML, XML, Fixed-width, Parquet, EDI X12 (850 Purchase Order, 810 Invoice) and EDIFACT (ORDERS, INVOIC).

When to use​

  • A partner or API needs a specific format: a pipe-delimited file, an XML document, an EDI order.
  • You need control the Load node does not offer: delimiter, quoting, line ending, encoding, element names.
  • You need one message for the whole run, one per row, or one per group.

Configure​

Select the node and press Configure to open Configure Message. The preview updates as you change any option. It uses sample rows from the upstream node's last run, or generated rows when there is no run. XLSX, Parquet and EDI previews run on the project's runtime; a project on a Private Agent that polls for work shows a message in place of those previews.

Save and Done stay unavailable while a required setting is missing. Cancel discards the changes made since the dialog opened or was last saved. A message confirms each save.

Shape library

  • Load from library: apply a saved shape to this node.
  • Save current config as a new shape: name the current settings so other Message nodes can reuse them. A shape belongs to the account or to one project. Changing a shape's format or settings saves a new version.

Format and output

  • Message format: one of the formats above. Each format shows its own options.
  • Emission: single (one message for the run), per_row (one per input row) or group_by (one per distinct value of the chosen fields).
  • Output field: the column that holds the message. The default is message.
  • Compression: optional gzip. A compressed message is base64 text.

Format options

FormatOptions
DelimitedDelimiter (comma, tab, pipe, semicolon or custom), quote character, quoting (minimal quotes only fields that contain a delimiter, quote or line break; all quotes every field), header row, line ending (LF or CRLF), encoding.
JSONPretty (2-space indent) or compact, encoding, optional column list.
NDJSONOne JSON object per line. Line ending, encoding, optional column list.
YAMLA list of mappings with 2-space indent. Encoding, optional column list.
XMLRoot element name, item (row) element name, optional namespace URI, XML declaration, indentation. Field mappings rename a field or make it an attribute; other fields become child elements. Names are adjusted to be valid XML names.
Fixed-widthA table of columns with name, width, alignment, pad character and overflow. The table order is the output order. Overflow truncate cuts the value to the width; error fails the node. Optional header row.
ParquetColumn types are inferred from the first non-null value (UTF8, INT64, DOUBLE, BOOLEAN, TIMESTAMP_MILLIS). Override a column's type when the guess is wrong. The message is base64 text. The preview shows the schema and up to 100 sample rows.
EDI X12, EDIFACTTransaction set, sender and receiver IDs and qualifiers, control numbers, and Test or Production usage. See below.

Encodings are UTF-8, ASCII and Latin-1. A character that ASCII or Latin-1 cannot hold is replaced, and the run log names the node and the first character affected.

EDI

  • Each input row is one line item. The first row supplies the header fields: poNumber and poDate for orders; invoiceNumber, invoiceDate and poNumber for invoices.
  • The full envelope is written: ISA, GS, ST, SE, GE and IEA for X12; UNB, UNH, UNT and UNZ for EDIFACT. Segment counts and totals are calculated.
  • X12 keeps the ISA segment at its fixed 106 characters. EDIFACT starts with a UNA segment when the separators are not the defaults.
  • Amounts are written to at most two decimal places.
  • The preview lists the segments.

Excel is not in the format list. A node saved with the Excel format keeps working and keeps its options. To write a new Excel file, use a Load node.

Ports​

PortDirectionKindNotes
inindataRows to format.
outoutdataOne row per message, holding the message and its details.
metadataoutdataOne summary row per message, without the message itself.
erroroutcontrolReceives the input rows when the rows cannot be formatted.

Each out row holds the message plus format, encoding, byteSize, recordCount, checksum, compressed and emissionMode. byteSize and checksum describe the message in the same row. The metadata row carries the same details.

Examples​

A pipe-delimited file for a partner.

Format Delimited, delimiter pipe, header on, Emission single. Three rows in give one row out, whose message column holds the whole file:

orderId|customer|total
10|C1|49.99
11|C3|120.00

With Emission per_row, the same input gives three rows, each with a one-line message. Use this when the destination takes one request per record.

One message per region. Emission group_by on region gives one row per region, each holding the message for that region's rows.

Troubleshooting​

SymptomCauseWhat to do
The node fails with an overflow errorA fixed-width value is longer than its column and overflow is error.Widen the column, or set overflow to truncate.
Characters are replaced in the fileThe encoding is ASCII or Latin-1.Use UTF-8 if the destination accepts it.
A Parquet column has the wrong typeThe first non-null value suggested another type.Override the column type.
The receiver rejects an EDI fileHeader fields are missing from the first row, or IDs are wrong.Check poNumber or invoiceNumber on the first row, and the sender and receiver IDs.
No file is writtenThe Message node formats only.Connect out to a Load node.