Skip to content

Source formats

Flux Importer reads five formats, from an upload, a URL or pasted text. This page says how each one is read, how it's split into records, and how you name a value inside a record.

The format is set by the template’s source.format. The wizard picks it from the file name’s extension (.csv, .json, .jsonl or .ndjson, .xml, .xlsx), and you can change it under How to read it in the Source step. A URL whose path names no format is read as CSV until you change it.

Every format is read as a stream, one record at a time, so a large file never has to fit in memory. Excel workbooks are the exception: see XLSX.

What Limit
An uploaded file, or a URL source’s download maxSourceBytes: 50 MiB by default
An .xlsx workbook 10 MiB, or maxSourceBytes when that’s lower
Pasted text 1 MiB, and never XLSX
One record 4 MiB

Set maxSourceBytes on fluxImporterRoutes() in astro.config.mjs; see Configuration. On Node, EmDash’s local storage adapter holds a whole upload in memory while it writes it, which is why the default is modest.

A URL source must send its response headers within 15 seconds and finish within 120 seconds. See URL sources.

Every format must be UTF-8. A UTF-8 byte-order mark at the start is skipped. JSON, JSON Lines and XML files that start with a UTF-16 byte-order mark are refused with unsupported_encoding (“The file is UTF-16; save it as UTF-8”). Re-save other encodings as UTF-8 before you import them.

  • Delimiter: a comma. Other delimiters (semicolons, tabs) aren’t detected; save the file as comma-separated.
  • Quoting: a field in double quotes can hold commas and line breaks; "" inside quotes is one ".
  • Line endings: LF or CRLF. Blank lines are skipped.
  • Header: the first row always holds the column names. Each name is trimmed; an empty one becomes column_1, column_2 and so on, by position. Two columns with the same name are refused when the job is created (Duplicate header "…", a csv_syntax error).
  • Values: every value is text. Mappings convert it: see Field mappings.
  • Rows: a row with more or fewer fields than the header fails as one record (column_count); the others go on. A quote that’s never closed stops the job (Unterminated quoted field).

Before the job starts, every column the template reads by from is checked against the header, and a missing one is a template problem (Column "…" not found in the source).

The file is one JSON document. The records are an array in it:

  • No records path: the document itself must be an array, and each element is a record.
  • A records path: dot-separated keys from the top of the document to the array, such as data.products. Only that array is read; the rest of the document is skipped.
{
"data": {
"products": [
{ "sku": "A-100", "name": "Desk lamp", "price": { "amount": 39.5, "currency": "EUR" } },
{ "sku": "A-101", "name": "Floor lamp", "price": { "amount": 89, "currency": "EUR" } }
]
}
}

With "records": "data.products", this file has two records. A document that’s an object without a records path, or a path that doesn’t lead to an array, is refused when the job is created (invalid_source), and the message says what it found instead.

Numbers, booleans, null, objects and arrays keep their JSON types. An integer too large to hold exactly (beyond 2⁵³, such as a 19-digit ID) is kept as its text, so distinct IDs stay distinct. Nesting is limited to 1,000 levels.

A record that isn’t valid JSON fails on its own (invalid_record), and the job goes on. Broken structure around the records, such as a missing ], stops the job with source_syntax and the byte offset.

One JSON value per line (.jsonl or .ndjson). Lines end in LF, with or without a CR before it. Blank lines are skipped. Values keep their JSON types as in JSON, and a line that isn’t valid JSON fails as one record.

{"sku": "A-100", "name": "Desk lamp", "price": {"amount": 39.5}}
{"sku": "A-101", "name": "Floor lamp", "price": {"amount": 89}}

JSON Lines takes no records path.

XML needs a records path: the element names from the root to the record element, separated by /, such as feed/item. Every element at exactly that position is one record.

<?xml version="1.0" encoding="UTF-8"?>
<feed>
<item id="A-100">
<name>Desk lamp</name>
<price currency="EUR">39.50</price>
<tag>lighting</tag>
<tag>office</tag>
</item>
</feed>

With "records": "feed/item" this file has one record. How it reads:

  • An element with only text reads as that text: name is "Desk lamp".
  • Attributes are @ plus the name: @id is "A-100", price/@currency is "EUR".
  • An element with attributes or children keeps its text under #text: price/#text is "39.50". Reading price itself gives the text too, because it has no child elements.
  • A repeated element becomes a list: tag is ["lighting", "office"].
  • CDATA reads as text. Comments and processing instructions are ignored.
  • Names with a namespace prefix are used as written, such as media:content.

Every value is text, as in CSV. Only the five predefined entities (&amp;, &lt;, &gt;, &quot;, &apos;) and numeric character references are allowed. A DOCTYPE with an internal subset is refused (xml_dtd_not_allowed), and so is an XML declaration that names an encoding other than UTF-8 or ASCII.

Excel workbooks in the .xlsx format. When the job is created, the chosen sheet is converted to JSON Lines and the job reads that copy, so the whole workbook is held in memory once. That’s why workbooks have the lower 10 MiB limit.

  • Sheet: source.sheet is a sheet name (matched ignoring case) or its number from 1. Without it the first sheet is read.
  • Header row: source.headerRow is the row number of the column names. Without it, row 1. Rows above it are ignored.
  • Header names: trimmed. An empty one is named after its column letter, as in column_C. A repeated one gets _2, _3 and so on added. Each rename is a job warning.
  • _row: every record also has _row, the row’s number in the sheet, unless a header is already named _row. Templates can read it like any column.
  • Rows: rows without values are skipped, and cells to the right of the last header are ignored.
  • Values: numbers stay numbers, booleans stay booleans, text stays text, and an empty or error cell is empty. A formula cell gives the value saved in the file. A cell formatted as a date becomes ISO 8601 text without a timezone: 2026-03-01, or 2026-03-01T09:30:00 when it has a time. Both the 1900 and 1904 date systems are read.

A cell that can’t be read is left out with a warning; a row whose only values can’t be read is skipped. A workbook that can’t be read at all stops job creation with invalid_source: an encrypted workbook, an old .xls file, ZIP64 or split archives, or a part larger than 100 MiB uncompressed.

The converted copy is at most maxSourceBytes, and at most 32 MiB on Cloudflare Workers, where it’s held in memory to be stored. A workbook can’t be pasted; upload it or fetch it from a URL.

Flux Importer doesn’t import ZIP archives as a source format. An .xlsx workbook is itself a ZIP archive, which the XLSX reader opens; there’s no reader for a .zip of CSV, JSON or XML files. Unzip the archive and import each file.

A template names a value in a record with a from path:

Format Path Example
CSV, XLSX The column name, exactly as in the header. Dots and spaces are part of the name. Unit price, price.amount (a column with that name)
JSON, JSON Lines Object keys separated by . price.amount, brand.name
XML Element names separated by /, optionally ending in @attribute or #text price, price/@currency, price/#text

Rules for JSON and XML paths:

  • No key or element name may be empty (a..b is invalid).
  • A JSON key that itself contains a . can’t be named by a path. Use an expression for it.
  • There are no array indexes. A path stops at the first array and returns it, so tags returns the whole list. Mappings that take lists (multiSelect, reference, taxonomies, bylines, json) use it as it is; for one item, use an expression such as tags[0].
  • A path that isn’t there reads as empty. Before a JSON, JSON Lines or XML job starts, the first 20 records are checked, and a path none of them has is a job warning (Path "…" was not found in the first 20 records).

The Source step shows a sample of the records and the paths it found, up to 1,000 paths and 32 levels deep, so you can pick them in the Map step instead of typing them.