Log to File

Action doc.text

action.log_to_file

Append a structured line to a log file on disk. Supports JSON Lines (.jsonl), plain text with customizable templates, and CSV formats. The file is created automatically if it does not exist. Each workflow execution appends one line.

Ideal for building audit trails, event logs, or data collection pipelines that can be analyzed later.

Ports

DirectionNameData TypeDescription
InputInputAnyIncoming payload to log
OutputOutputAnyPassthrough with log metadata

Configuration

FieldTypeDefaultDescription
filePathTextPath to the log file (e.g., ~/logs/events.jsonl)
formatDropdownjsonlLog format: JSON Lines, Plain Text, or CSV
lineTemplateText AreaTemplate for each line. Supports {{var}}. Visible when format = text.
includeTimestampBooleantrueAdd an ISO 8601 timestamp to each JSON line. Visible when format = jsonl.

Output Variables

VariableTypeDescription
logFileStringAbsolute path to the log file
linesWrittenNumberTotal number of lines in the file
writtenBooleanWhether the line was written successfully

Example

Log API responses to a file on a schedule: