azure-servicebus

Azure Service Bus nodes for n8n

Package Information

Downloads: 214 weekly / 214 monthly
Latest Version: 1.0.21
Author: Arthur Gigli

Documentation

n8n Community Node: Azure Service Bus (Advanced)

This n8n package provides robust integration with Azure Service Bus, allowing for the creation of reliable and resilient workflows.

Its key feature is the advanced control over the message lifecycle (acknowledgment), inspired by official n8n nodes, ensuring that messages are not lost in case of a workflow failure.

Prerequisites

  • An n8n instance (version 1.110.0 or higher).
  • An Azure account with a configured Service Bus instance.

Installation

  1. Go to your n8n instance.
  2. From the main menu, navigate to Settings > Community Nodes.
  3. Click Install.
  4. Enter the package name: @eugigli/n8n-nodes-azure-servicebus and click "Install".

After installation, the nodes will be available in the nodes panel.

Nodes Included

This package contains two nodes:

  1. Azure Service Bus Trigger: Starts a workflow when a message is received in a queue or a topic subscription.
  2. Azure Service Bus: An action node to send messages or manage existing messages (Complete, Abandon, etc.).

Node: Azure Service Bus Trigger

This is the starting point for event-driven workflows.

Acknowledgment Control (Acknowledge Message When)

This is the trigger's core feature. It defines when a message should be considered successfully processed and removed from the queue.

Option Description Use Case
Immediately (Auto Complete) The message is removed from the queue as soon as it's received by the trigger. Non-critical workflows where losing a message in case of failure is not a concern.
Only on Successful Execution (Default and Recommended) The message is only removed from the queue if the entire workflow executes without any errors. If a failure occurs, the message will remain in the queue to be processed again. Critical and reliable workflows. Guarantees "at-least-once" processing.
On Execution Finish The message is removed from the queue when the workflow finishes, regardless of whether it succeeded or failed. Use cases where you want to ensure a message is processed only once, even if the processing fails (e.g., for logging purposes only).
Manually (with Action Node) The trigger does nothing with the message. The responsibility for removing (or managing) it is handed off to an "Azure Service Bus" action node at the end of the workflow. Complex workflows with multiple success and failure paths, where you need full control over the message's final state.

Other Features

  • Supports queues and topic subscriptions.
  • Supports session-enabled entities (none, any, specific).
  • Configurable parallel message processing limit.

Node: Azure Service Bus (Action)

This node allows you to interact with Service Bus at any point in your workflow.

Available Operations (for Queues)

Operation Description
Send Sends a new message to a queue or topic. Supports custom properties and sessions.
Complete (Used with the Manual Trigger) Acknowledges a message, permanently removing it from the queue.
Abandon Abandons a message's lock, making it immediately available for processing again.
Dead-Letter Moves a message to the dead-letter queue (DLQ) for later analysis.
Receive Manually fetches and consumes messages from a queue (unlike the trigger, which listens continuously).

Example: Reliable Message Processing Workflow

This is the most powerful pattern for this set of nodes.

  1. Trigger Node:

    • Configure the Azure Service Bus Trigger to listen to your queue.
    • For Acknowledge Message When, select Manually (with Action Node).
  2. Workflow Logic:

    • Add the nodes that perform your business logic (e.g., call an API, save to a database, etc.).
  3. Error Handling:

    • After your logic, add an "IF" node to check if the previous steps were successful.
  4. Finalization:

    • On the "true" path of the IF node (success): Add an Azure Service Bus action node.
      • Operation: Complete
      • Message Object: Use the expression {{ $json }} to pass the original message data.
    • On the "false" path of the IF node (failure): Add another Azure Service Bus action node.
      • Operation: Dead-Letter
      • Message Object: Use the same expression ={{ $json }}.

This workflow guarantees that a message is only removed from the queue if everything goes well; otherwise, it is sent to the DLQ for analysis, ensuring it is never lost.

Credentials

Credentials are configured using the full Connection String from your Azure Service Bus namespace.

License

MIT

Discussion