FlowmageDocs

Read

Reads data

Reads a file from storage so the flow can use what is in it.

Settings

SettingWhat it is
File nameRequiredA file's name is the whole key — exports/report.csv is a name, not a folder.
EncodingOne read carries up to 5 MB; a larger file fails unless you read it in parts.
OffsetThe byte to start at — 0, or the nextOffset of the previous part.
LengthRead at most this many bytes (up to 5 MB) — a part, never a failure. A text part ends on a whole character.
Allow a partial readPast 5 MB, return the first part with truncated and nextOffset instead of failing.
Technical details
KeyValue
nametexta file name, listed in `requires.files`
encoding"text" or "base64", by default "text"
offsetnumber, by default 0
lengthnumber
allowPartialtrue/false, by default false

Output

FieldType
nameFile namestring
contentTypestring
sizeSize (bytes)number
binaryBinary (text reads answer metadata only)boolean
truncatedA part — the file goes on past itboolean
nextOffsetOffset of the next part (only on a part)number
textText (text encoding only)string
base64Base64 (base64 encoding only)string
Sample output, and the expression for each field
  • binaryfalse
  • contentType"text/csv"
  • name"report.csv"
  • size8
  • text"a,b\n1,2\n"
  • truncatedfalse

Errors

When a step of this node stops a run, the run page shows a code. Look it up:

Example step

The step as a flow file holds it. Replace each value in <…>.

{
  "config": {
    "allowPartial": false,
    "encoding": "text",
    "name": "<file name>",
    "offset": 0
  },
  "label": "Read",
  "type": "file.read",
  "version": 1
}