Overview
This node integrates with Azure Service Bus to send and receive messages from queues or topics. It supports two main operations:
- Send: Send a JSON message to a specified queue or topic.
- Receive: Receive messages from a queue or topic subscription, with options to control how many messages to fetch, how long to wait for messages, and what to do with the messages after receiving them (complete, abandon, or dead-letter).
Common scenarios include:
- Integrating workflows with Azure messaging infrastructure for asynchronous communication.
- Processing incoming messages from Azure Service Bus queues or topics in n8n workflows.
- Sending notifications or commands to other systems via Azure Service Bus.
Example use cases:
- Receiving orders placed on an e-commerce platform through a Service Bus queue and processing them.
- Sending alerts or status updates to a topic that multiple subscribers listen to.
- Peeking at messages without removing them from the queue for monitoring purposes.
Properties
| Name | Meaning |
|---|---|
| Connection String | Connection string used to authenticate with Azure Service Bus. |
| Queue or Topic Name | The name of the queue or topic in Azure Service Bus where messages are sent or received. |
| Subscription Name (Se for Tópico) | The subscription name if using a topic. Leave empty if using a queue. |
| Maximum Number of Messages | Maximum number of messages to receive in a single request (only for receive operation). |
| Max Wait Time (Ms) | Maximum time in milliseconds to wait for messages before ending the receive request (only for receive). |
| Post Processing Action | What to do with the message after receiving it: - Complete (remove message) - Abandon (return to queue) - Dead-Letter (move to dead-letter queue) (only for receive). |
| Receive Mode | Whether to remove messages from the queue or just peek: - Receive And Complete - Peek (Preview Only) (only for receive). |
Output
The node outputs an array with one item containing a json object structured as follows depending on the operation:
Send Operation:
{ "success": true, "operation": "send", "queueOrTopic": "<queue_or_topic_name>", "subscriptionName": "<subscription_name_if_any>", "messageSent": <the JSON message body sent> }Receive Operation:
{ "success": true, "operation": "receive", "queueOrTopic": "<queue_or_topic_name>", "subscriptionName": "<subscription_name_if_any>", "messagesReceived": [ <array_of_message_bodies_received> ] }
If the receive mode is set to "peek", messages are only previewed and not removed from the queue.
The node does not output binary data.
Dependencies
- Requires access to Azure Service Bus via a valid connection string.
- Uses the official Azure SDK for JavaScript (
@azure/service-bus) bundled within the node. - No additional environment variables or external configurations beyond the connection string are required.
Troubleshooting
- Authentication Errors: If the connection string is invalid or lacks permissions, the node will throw an error when trying to connect. Verify the connection string and its permissions.
- Message Not Received: Ensure the queue/topic and subscription names are correct. For topics, a subscription name must be provided; otherwise, no messages will be fetched.
- Timeouts: The
Max Wait Timecontrols how long the node waits for messages. If set too low, it might return no messages even if some arrive shortly after. - Post Processing Failures: If the node fails to complete, abandon, or dead-letter messages, check the permissions associated with the connection string.
- Peek Mode: When using peek mode, messages are not removed. This can cause confusion if expecting messages to disappear from the queue.
Error messages generally indicate the operation and the underlying Azure SDK error message, e.g., "Erro ao executar a operação 'receive': <error message>". Check connectivity, permissions, and parameter correctness to resolve.