On this page
Sommatic Docs
Open portal

Queue / Topic Consumer

Consumes messages from an external Message Queue or Pub/Sub Topic.

View as Markdown
Open in
Triggers Experimental queue.trigger Version 1.0.0 Execution: async

Entry node for queue-driven workflows. It reshapes the run's input into { message_id, queue, content, attributes } and rejects messages from another queue than subscription; in this version no broker consumer starts it.

This trigger connects to external brokers (like RabbitMQ, Kafka, SQS, or Redis) and initiates a workflow instance for each incoming message.

Key Features:

  • Backpressure: Supports prefetch to limit concurrent workflow instantiations.
  • Reliability: Supports Auto or Manual Acknowledgement (Ack/Nack) to ensure message delivery guarantees.

Use Cases:

  • Processing tasks offloaded from a main web server.
  • Event-driven architecture integrating with legacy systems.

How it works

  1. What starts it: no backend component consumes a broker for this node in this version. The workflow runs when it is started explicitly with a message-shaped input { message_id, queue, content, attributes }.
  2. Resolves the node config. When subscription is set and the input's queue is set and different, it returns error.
  3. Otherwise outputs message_id (default unknown), queue (the input's, or subscription), content (the input's content, or the whole input) and attributes (default {}).

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-orders-queue",
  "label": "Orders queue",
  "operator_slug": "queue.trigger",
  "operator_version": "1.0.0",
  "config": {
    "source": "pi-credential-xxxx",
    "subscription": "orders.created",
    "prefetch": 10,
    "ack_mode": "auto"
  }
}

Configuration

source string Required

Resource ID of the message broker connection.

subscription string Required

The specific channel to listen to.

prefetch integer Optional

Max unacknowledged messages.

Default: 10

ack_mode string Optional

Auto: Ack on workflow start. Manual: Requires specific app to Ack.

Default: auto

Allowed values: automanual

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

source
Declared and required, but not read. prefetch and ack_mode are not read either: no message is acknowledged by this node.
subscription
Only used to reject messages from another queue and as the default queue in the output.

Output ports

out default

The message is accepted.

Data
{
  "message_id": "msg-7f3a9c",
  "queue": "orders.created",
  "content": {
    "order_id": "ord_123",
    "total": 129.99
  },
  "attributes": {
    "content-type": "application/json"
  }
}
error

The input's queue differs from subscription. The output is the envelope { ok, errors, port }.

Data
{
  "ok": false,
  "errors": [
    "Queue mismatch: orders.created is not equal to orders.cancelled"
  ],
  "port": "error"
}

In expressions

What a later node can read from this node's output with $("Queue / Topic Consumer").item.json.<path> (write your node's label instead of Queue / Topic Consumer). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Queue / Topic Consumer").item.json.message_idstring= "msg-7f3a9c"
$("Queue / Topic Consumer").item.json.queuestring= "orders.created"
$("Queue / Topic Consumer").item.json.contentobject= {…}The message body.
$("Queue / Topic Consumer").item.json.attributesobject= {…}Message headers/metadata.
$("Queue / Topic Consumer").item.json.content.order_idstringNot suggested by the editor= "ord_123"—
$("Queue / Topic Consumer").item.json.content.totalnumberNot suggested by the editor= 129.99—
$("Queue / Topic Consumer").item.json.attributes.content-typestringNot suggested by the editor= "application/json"—

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
Queue mismatch: <subscription> is not equal to <queue> error The workflow was started with a message from another queue.

Output contract

message_id string Optional
queue string Optional
content object Optional

The message body.

attributes object Optional

Message headers/metadata.

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "queue.trigger",
  "name": "Queue / Topic Consumer",
  "category": "triggers",
  "version": "1.0.0",
  "description": "Consumes messages from an external Message Queue or Pub/Sub Topic.\n\n  This trigger connects to external brokers (like RabbitMQ, Kafka, SQS, or Redis) and initiates a workflow instance for each incoming message.\n\n  **Key Features:**\n  - **Backpressure:** Supports `prefetch` to limit concurrent workflow instantiations.\n  - **Reliability:** Supports Auto or Manual Acknowledgement (Ack/Nack) to ensure message delivery guarantees.\n\n  **Use Cases:**\n  - Processing tasks offloaded from a main web server.\n  - Event-driven architecture integrating with legacy systems.",
  "capabilities": [
    "queue-consumer",
    "high-throughput",
    "async-processing"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "source",
      "subscription"
    ],
    "properties": {
      "source": {
        "type": "string",
        "title": "Connection / Broker",
        "description": "Resource ID of the message broker connection."
      },
      "subscription": {
        "type": "string",
        "title": "Queue Name / Topic",
        "description": "The specific channel to listen to."
      },
      "prefetch": {
        "type": "integer",
        "default": 10,
        "title": "Prefetch Count",
        "description": "Max unacknowledged messages."
      },
      "ack_mode": {
        "type": "string",
        "enum": [
          "auto",
          "manual"
        ],
        "default": "auto",
        "title": "Ack Mode",
        "description": "Auto: Ack on workflow start. Manual: Requires specific app to Ack."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": null,
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "message_id": {
        "type": "string"
      },
      "queue": {
        "type": "string"
      },
      "content": {
        "type": "object",
        "description": "The message body."
      },
      "attributes": {
        "type": "object",
        "description": "Message headers/metadata."
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Message Received",
      "is_default": true
    },
    {
      "port_id": "error",
      "label": "Error"
    }
  ],
  "execution_mode": "async",
  "tags": [
    "queue",
    "consumer",
    "kafka",
    "rabbitmq"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Retries (retryOnFail)
No
Capabilities
queue-consumerhigh-throughputasync-processing
Tags
queueconsumerkafkarabbitmq

Notes and limits

  • When the input has no content, the whole input (including any $trigger_state the backend adds) becomes content.
  • With sample data the engine skips the node and passes the sample input on out unchanged.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs