Kafka Decimal icon

Kafka Decimal

Sends messages to a Kafka topic with Decimal support

Kafka Decimal

AI-generated

Overview

This node allows you to send messages to a Kafka topic, with optional support for Confluent Schema Registry and Avro serialization (including Decimal logical types). It is designed for scenarios where you need to publish data from n8n workflows into Kafka topics, such as integrating with event-driven architectures, streaming pipelines, or microservices that consume Kafka.

Common use cases:

  • Publishing workflow results or notifications to Kafka.
  • Sending JSON or custom messages to Kafka consumers.
  • Integrating with systems that require Avro-encoded messages using a schema registry.

Practical examples:

  • Forwarding processed order data to a Kafka topic for downstream analytics.
  • Sending alerts or events from n8n to a real-time processing system via Kafka.
  • Publishing financial transaction data with decimal precision using Avro schemas.

Properties

Name Type Meaning
Topic string Name of the Kafka topic to publish to.
Send Input Data boolean If true, sends the incoming item’s JSON as the message; if false, uses the "Message" field.
Message string The message to be sent (used only if "Send Input Data" is false).
JSON Parameters boolean If true, headers are provided as a JSON object; otherwise, use the UI collection.
Use Schema Registry boolean Whether to encode the message using a Confluent Schema Registry (Avro).
Schema Registry URL string URL of the schema registry (required if "Use Schema Registry" is true).
Event Name string Namespace and name of the schema in the registry (required if "Use Schema Registry" is true).
Headers fixedCollection Key-value pairs for message headers (if "JSON Parameters" is false).
Headers (JSON) json Flat object of header parameters as JSON (if "JSON Parameters" is true).
Options > Acks boolean Wait for acknowledgement from all replicas if true.
Options > Compression boolean Send data compressed with GZIP if true.
Options > Timeout number Time to await a response (in milliseconds).

Output

The node outputs an array of result objects, each corresponding to the outcome of sending messages to Kafka. The structure typically includes:

[
  {
    "topicName": "string",
    "partition": number,
    "errorCode": number,
    "baseOffset": string,
    "logAppendTime": string,
    "logStartOffset": string
  }
]
  • If no messages are returned, it outputs [{"success": true}].
  • On error (when "Continue On Fail" is enabled), it outputs [{"error": "Error message"}].

Note: This node does not output binary data.

Dependencies

  • Kafka Cluster: Requires access to a running Kafka cluster (brokers).
  • Kafka Credentials: Must provide credentials (clientId, brokers, SSL, and optionally SASL authentication).
  • Confluent Schema Registry: If "Use Schema Registry" is enabled, requires a reachable schema registry and valid schema configuration.
  • n8n Credentials: Node expects a credential named kafka to be configured in n8n.

Troubleshooting

Common issues:

  • Authentication errors: If username/password are missing when authentication is enabled, the node will throw:
    "Username and password are required for authentication"
  • Schema Registry misconfiguration: If the schema registry URL or event name is incorrect, or the registry is unreachable, the node will throw:
    "Verify your Schema Registry configuration"
  • Invalid headers JSON: If "Headers (JSON)" is not valid JSON, the node will throw:
    "Headers must be a valid json"
  • Connection errors: Issues connecting to Kafka brokers or schema registry may result in connection or timeout errors.

How to resolve:

  • Double-check all credential fields and ensure the Kafka cluster and schema registry are accessible from n8n.
  • Validate any JSON input for headers before submitting.
  • Ensure the schema exists in the registry and the event name matches the expected format.

Links and References

Discussion