This is an n8n community node that provides integration with PubNub real-time messaging platform.
n8n is a fair-code licensed workflow automation platform.
PubNub is a real-time communication platform for building live chat, multiplayer games, IoT device control, and other real-time features.
Follow the installation guide in the n8n community nodes documentation.
- Go to Settings > Community Nodes
- Click Install
- Enter
n8n-nodes-pubnubin Enter npm package name - Click Install
To use this package in your n8n instance, you can install it via npm:
npm install n8n-nodes-pubnubTo use this node, you'll need to configure your PubNub credentials:
- Publish Key: Your PubNub Publish Key (required for publishing messages)
- Subscribe Key: Your PubNub Subscribe Key (required for subscribing to channels)
- Secret Key: Optional secret key for encryption and access manager
- User ID: Optional unique identifier for this client (auto-generated if not provided)
You can find your keys in the PubNub Admin Portal.
This package provides two nodes:
The main node for interacting with PubNub. Supports the following operations:
- Publish: Send a message to a channel
- Supports metadata, TTL, and history storage options
- Signal: Send a lightweight signal (max 30 characters)
- Fetch Messages: Retrieve message history from a channel
- Supports pagination, metadata, and message actions
- Delete Messages: Delete messages from a channel
- Message Counts: Get message counts for channels
- Here Now: Get current occupancy and user list for channels
- Where Now: Get channels where a specific user is present
- Set State: Set state data for a user on channels
- Get State: Get state data for a user on channels
- Add Channels: Add channels to a channel group
- Remove Channels: Remove channels from a channel group
- List Channels: List all channels in a channel group
- Delete Group: Delete a channel group
A trigger node that starts your workflow when PubNub events occur:
- Trigger On: Choose to trigger on messages, presence events, or both
- Channels: Subscribe to specific channels (comma-separated)
- Channel Groups: Subscribe to channel groups (comma-separated)
- Filter Expression: Apply message filtering
- With Presence: Receive presence events
- Time Token: Start receiving messages from a specific timetoken
- Include Message Actions: Include message actions in events
- Include Metadata: Include message metadata
- Add a PubNub node to your workflow
- Select Message resource and Publish operation
- Enter your channel name (e.g.,
my-channel) - Enter your message as JSON:
{"text": "Hello World!", "timestamp": "{{$now}}"} - Configure credentials and execute
- Add a PubNub Trigger node to start your workflow
- Set Trigger On to Message
- Enter channel name(s) (e.g.,
chat-room,notifications) - Configure credentials
- Activate the workflow - it will now trigger whenever messages arrive
- Add a PubNub node
- Select Presence resource and Here Now operation
- Enter channel name(s)
- Enable options: Include UUIDs and Include State
- Execute to see who's currently online
- Add a PubNub node
- Select History resource and Fetch Messages operation
- Enter channel name
- Set count to desired number of messages (e.g., 50)
- Enable Include Metadata if needed
- Execute to retrieve historical messages
To develop or modify this package:
# Clone the repository
git clone https://github.com/pubnub/n8n-nodes-pubnub.git
cd n8n-nodes-pubnub
# Install dependencies
npm install
# Build the package
npm run build
# Watch for changes during development
npm run dev- Initial release
- PubNub node with message, history, presence, and channel group operations
- PubNub Trigger node for real-time subscriptions
- Full credential support with auto-generated User ID fallback
If you encounter issues or have questions:
- Check the PubNub Documentation
- Visit the n8n Community Forum
- Open an issue on GitHub
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request