Logger icon

Logger

Logger Node to start a Logger Workflow

Overview

This node, named "Logger," is designed to send data from the current workflow execution to a separate Logger workflow for logging purposes. It allows users to specify which data to send and how to format it before triggering the Logger workflow. This is useful in scenarios where you want to keep detailed logs of workflow executions, track specific values, or audit data changes without cluttering the main workflow.

Practical examples include:

  • Sending error details or status updates to a centralized logging workflow.
  • Aggregating multiple items' data into a single log entry.
  • Tracking custom key-value pairs during workflow runs for monitoring or debugging.

Properties

Name Meaning
Logger Workflow ID The ID of the external Logger workflow that will receive the logged data.
Data to Be Sent to the Logger Mode of sending data:
- First Item: Send only the first input item.
- All Items: Send all input items individually.
- 1 Item with Aggregated Item Values Array: Send one item containing an array aggregating values from all input items.
Return Data From SubFlow Whether to return the data output from the Logger workflow (subflow) instead of continuing with the original input data.
Values to Log A collection of key-value pairs to include in the log. Each pair has a "Name" and a "Value" string. Multiple pairs can be added and reordered.

Output

The node outputs data in the standard n8n format with a json field containing:

  • timeStamp: ISO timestamp when the log was created.
  • workflowId: ID of the current workflow.
  • workflowName: Name of the current workflow.
  • workflowIsActive: Boolean indicating if the current workflow is active.
  • executionId: ID of the current execution.
  • itemIndex: Index of the input item (0 if aggregated).
  • data: An object or array containing the logged key-value pairs as specified by the user.

If the "Return Data From SubFlow" option is enabled, the node outputs the data returned by the Logger workflow instead of the original input data.

The node does not output binary data.

Dependencies

  • Requires an existing Logger workflow identified by its workflow ID.
  • Uses the n8n internal method to execute another workflow programmatically.
  • No external API keys or services are required beyond what the Logger workflow itself may need.

Troubleshooting

  • Common issues:

    • Incorrect or missing Logger Workflow ID will cause failure to trigger the subflow.
    • Mismatch between expected data structure in the Logger workflow and the sent data may cause errors downstream.
    • If "Return Data From SubFlow" is enabled but the Logger workflow returns no data, the node output may be empty.
  • Error messages:

    • Errors thrown during execution typically relate to invalid parameters or failure to execute the Logger workflow.
    • To resolve, verify the Logger workflow ID is correct and accessible.
    • Ensure the Logger workflow is active and properly configured to accept the incoming data format.

Links and References

Discussion