BetterStack Structured Logging Sub-Automation - n8n Workflow

A powerful, reusable n8n workflow template to centralize log management by sending structured messages (level, message) to BetterStack via an HTTP Request n8n node. Simplify monitoring across your n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

DevOps Engineers needing centralized logging for automated processes.
n8n power users running numerous n8n templates that require robust error monitoring.
Developers wanting to separate logging logic from core automation business logic within their n8n workflow designs.
Users looking for specialized n8n templates focusing on observability.

Overview

Maintaining comprehensive observability is critical for complex automation setups. This specific n8n workflow template addresses the need for centralized, structured logging by acting as a dedicated logging service. Instead of repeating logging API calls in every primary n8n workflow, you simply call this reusable n8n workflow using the Execute Workflow n8n node. This approach makes your main n8n templates cleaner, easier to maintain, and ensures consistent log formatting. When an error or key event occurs in any of your active n8n workflows, this logging n8n workflow handles the secure transmission of the log data (message and severity level) to BetterStack, dramatically improving incident response and monitoring capabilities.

How it Works

This automation functions primarily as a callable service within your broader n8n environment. The flow is initiated by a specific n8n trigger designed for inter-workflow communication:


  1. Trigger Reception: The n8n workflow starts with the 'Recieve log message' n8n trigger (an Execute Workflow Trigger). This trigger waits to be called by another active n8n workflow or n8n template, expecting structured input data containing level (e.g., 'error', 'info') and message.

  2. Data Structure: The received data, captured by the n8n trigger, is then dynamically mapped.

  3. API Transmission: The 'Send Log to BetterStack' n8n node, configured as an HTTP Request, takes the structured inputs (message and level) and formats them into the necessary JSON payload required by the BetterStack Logs API.

  4. Secure Sending: Using stored Header Authentication credentials, the n8n node securely performs a POST request to the BetterStack endpoint, completing the logging process.

  5. Demonstration Path: The included 'Test workflow' n8n node (Manual Trigger) and 'Send test log message' n8n node demonstrate how to correctly call this logging service from any other n8n workflow, passing the necessary input variables.

Installation Guide

To deploy and utilize this logging n8n workflow template effectively, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and import it directly into your n8n instance via the 'Workflows' view.

  2. Configure BetterStack Credentials: This n8n workflow requires HTTP Header Authentication for secure access to the BetterStack Logs API.

Go to 'Credentials' in n8n.
Create a new 'HTTP Header Auth' credential.
Set the 'Header Name' to Authorization.
Set the 'Header Value' to your BetterStack Bearer token (e.g., Bearer YOURAPIKEY).
* Assign this credential to the 'Send Log to BetterStack' n8n node.

  1. Set Endpoint: Edit the 'Send Log to BetterStack' n8n node and input your specific BetterStack Logs ingestion endpoint URL.

  2. Usage in other n8n templates: In your primary n8n workflow, use an 'Execute Workflow' n8n node. Set it to call this logging workflow's ID, and ensure you pass the expected parameters: level and message.

Node Details

Recieve log message (Execute Workflow Trigger): This critical n8n trigger sets up the workflow as a reusable API endpoint callable by other n8n templates. It defines the required inputs: level and message.
Send Log to BetterStack (HTTP Request n8n node): This n8n node is responsible for the actual communication with the logging service.
Function: Performs a POST request to the BetterStack Logs API.
Key Configuration: Uses a JSON body ({"message":"{{ $json.message }}", "level": "{{ $json.level }}"}) which dynamically pulls data from the starting n8n trigger. It uses HTTP Header Auth credentials for secure transmission.
Test workflow (Manual Trigger): Used exclusively for testing this n8n workflow logic upon import.
Send test log message (Execute Workflow n8n node): Demonstrates how any other n8n workflow calls this logging sub-workflow. It passes sample data (level: error, message: This is a test log message) to test the functionality of the logging n8n node.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

Transforming complexity into simplicity.

Featured*