npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-kafka-wait-event

v1.1.0

Published

Kafka Wait Event node for n8n - Wait for specific Kafka events with timeout

Readme

n8n-nodes-kafka-wait-event

n8n-nodes-kafka-wait-event License

A custom n8n node that waits for specific Kafka events with configurable timeout. This node allows you to pause workflow execution until a matching Kafka message is received or a timeout occurs.

Features

  • 🕐 Configurable Timeout: Set custom timeout in seconds
  • 🔍 Message Filtering: Filter by message key or JSON path expressions
  • 🎯 Offset Management: Consistent consumer group for proper offset tracking
  • 🔄 Auto Retry: Built-in connection retry logic with exponential backoff
  • 🛡️ Error Handling: Graceful timeout and error handling
  • 📊 Full Message Context: Returns complete message metadata (topic, partition, offset, timestamp, headers)

Installation

Via npm (Recommended)

npm install n8n-nodes-kafka-wait-event

Self-hosted n8n

If you're running n8n in a Docker container or self-hosted environment:

  1. Install the package in your n8n installation:

    npm install n8n-nodes-kafka-wait-event
  2. Set the N8N_CUSTOM_EXTENSIONS environment variable:

    export N8N_CUSTOM_EXTENSIONS="/path/to/node_modules/n8n-nodes-kafka-wait-event"
  3. Restart n8n

Prerequisites

  • n8n version 1.0.0 or higher
  • Kafka cluster accessible from n8n
  • Kafka credentials configured in n8n (uses built-in Kafka credentials)

Usage

Basic Configuration

  1. Kafka Credentials: Use the built-in n8n Kafka credentials
  2. Topic Name: Specify the Kafka topic to listen to
  3. Group ID: Set a consumer group ID (default: n8n-kafka-wait-event)
  4. Timeout: Maximum time to wait for a message (default: 30 seconds)

Advanced Filtering

Message Key Filter

Filter messages by exact key match:

Key Filter: "user-123"

JSON Path Value Filter

Filter messages by JSON content using JSONPath expressions:

Value Filter: $.eventType
Expected Value: "user_created"

Advanced Options

  • Heartbeat Interval: Consumer heartbeat frequency (default: 3000ms)
  • Session Timeout: Consumer session timeout (default: 30000ms)
  • Max Wait Time: Maximum fetch request wait time (default: 5000ms)

Example Workflow

{
  "nodes": [
    {
      "name": "Wait for User Event",
      "type": "n8n-nodes-kafka-wait-event.kafkaWaitEvent",
      "parameters": {
        "topicName": "user-events",
        "groupId": "user-workflow-handler",
        "timeoutSeconds": 60,
        "filterOptions": {
          "valueFilter": "$.eventType",
          "expectedValue": "user_created"
        }
      },
      "credentials": {
        "kafka": "kafka-prod"
      }
    }
  ]
}

Output Format

When a matching message is received, the node outputs:

{
  "topic": "user-events",
  "partition": 0,
  "offset": "1234567",
  "key": "user-123",
  "value": {
    "eventType": "user_created",
    "userId": "123",
    "timestamp": "2024-01-01T12:00:00Z"
  },
  "timestamp": "1704110400000",
  "headers": {}
}

Error Handling

  • Timeout: If no matching message is received within the timeout period, the node throws a NodeOperationError
  • Connection Issues: Built-in retry logic attempts connection up to 3 times with exponential backoff
  • Filter Errors: Invalid JSONPath expressions or parsing errors are handled gracefully

Comparison with Kafka Trigger

| Feature | Kafka Wait Event | Kafka Trigger | |---------|------------------|---------------| | Node Type | Execution | Trigger | | Usage | Wait for specific events in workflow | Start workflow on any message | | Timeout | Configurable timeout | Continuous listening | | Consumer Groups | Consistent for offset tracking | New group per execution | | Filtering | Key + JSONPath filtering | No built-in filtering | | Workflow Integration | Pauses workflow execution | Initiates workflow |

Development

Building

npm run build

Linting

npm run lint
npm run lintfix  # Auto-fix issues

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related