NATS

The NATS connection allows the Intelligence Hub to connect to NATS servers for reading and writing messages, including support for JetStream streams. This page describes the connection, input, and output settings, and supported features.

Connection Settings

SettingDescription
HostThe hostname or IP address of the NATS server.
PortThe port the NATS server listens on. Default is 4222.
Authentication TypeHow the connection authenticates with the server. Default is None. See the options below.
Username and PasswordThe username and password required by the server. Shown when the Authentication Type is Username / Password.
TokenThe authentication token required by the server. Stored as a secret. Shown when the Authentication Type is Token.
Connect Timeout (seconds)Maximum time to wait when establishing a connection to the server. Valid range is 1–300 seconds, default 10 seconds.
Request Timeout (ms)How long to wait for a read, write, or request to complete before failing. Valid range is 100–60000 milliseconds, default 5000 ms.
Use TLS?Enable for NATS servers that require transport layer security. Disabled by default. See additional TLS options below.

Authentication Type Options:

OptionDescription
NoneConnect without credentials.
Username / PasswordAuthenticate with a username and password.
TokenAuthenticate with a single token value.

TLS Options (shown when Use TLS? is enabled):

OptionDescription
Ignore Self-Signed CertificateAccepts any certificate returned from the server. Use only for testing.
CA CertificateThe server CA certificate imported into the certificate store. Shown when Ignore Self-Signed Certificate is disabled.
Client Certificate/Key PairThe client certificate/key pair from the certificate store, used when the server requires mutual TLS.

Input Settings

NATS subjects support subscriptions and can be used as a source in an Event Trigger .

SettingDescription
Input TypeControls what is read. Default is Last Value. See the options below.
SubjectThe NATS subject to read from. Branch inputs may include wildcards. See Subject Wildcards below.
Request BodyThe message body to send with a Request input. Shown when the Input Type is Request.
Use JetStreamWhen enabled, the last value is read from a JetStream stream rather than the core NATS last value. Disabled by default. Shown for Last Value.
Stream NameThe JetStream stream to read from. Shown when Use JetStream is enabled.
Payload TypeThe type of payload to process. Default is Any. See the options below.
Include MetadataWhen enabled, NATS message metadata (such as subject and headers) is included alongside the value in the read data. Disabled by default.

Input Type Options

TypeDescription
Last ValueListens on a subject and returns the last received value.
RequestSends a message (the Request Body) on the subject and waits for a reply.
BranchSubscribes with a wildcard subject and returns the last message received per matching subject.

Payload Type Options

TypeDescription
AnyThe payload can be JSON, String, or Binary.
JSONThe payload is deserialized as JSON. Non-JSON payloads ignored.
UTF-8The payload is treated as a string.
BinaryThe payload is treated as a byte array.

Output Settings

SettingDescription
SubjectThe NATS subject to publish messages to.
Use JetStreamWhen enabled, messages are published to a JetStream stream. Otherwise the message is published to core NATS. Disabled by default.
Stream NameThe JetStream stream to publish to. Shown when Use JetStream is enabled.
Include HeadersWhen enabled, custom headers are attached to each published message. Disabled by default.
HeadersA list of Name/Value header pairs to attach to the message. Shown when Include Headers is enabled.

Subject Wildcards

Branch inputs and subscriptions can use NATS subject wildcards:

  • * matches exactly one token. For example, factory.*.temperature matches factory.line1.temperature and factory.line2.temperature.
  • > matches one or more remaining tokens and must be the last token. For example, factory.> matches factory.line1.temperature and factory.line1.motor.speed.

JetStream

NATS JetStream provides persistence on top of core NATS. Enable Use JetStream on an input or output and provide a Stream Name to read the last value from, or publish messages to, a persisted stream rather than transient core NATS messaging.