Skip to main content
Version: 3.0 (next)

Azure IoT Edge Nodes

When MaestroHub runs as an Azure IoT Edge module, these nodes talk to the local edge hub: Send to Output hands a message to the edge hub's routes, Twin Report updates the module twin's reported properties, Read Twin reads the twin, and Respond to Direct Method answers a method call. Everything goes to the edge hub on the device, so the nodes keep working while the device is offline from Azure.

Configuration Quick Reference​

FieldWhat you chooseDetails
ParametersConnection, Function, Function Parameters, Timeout OverrideSelect the Azure IoT Edge connection and a function, fill its ((parameters)) with expressions, and optionally override the timeout.
SettingsDescription, Timeout (seconds), Retry on Timeout, Retry on Fail, On ErrorNode description, maximum execution time, retry behavior and error handling. All execution settings default to pipeline-level values.

Send to Output​

Supported Function Types:

Function NamePurposeCommon Use Cases
Send to OutputSend a message on a named module outputTelemetry to IoT Hub through $upstream, features for a local analytics or AI module

How It Works​

  1. The node resolves the function's ((parameters)).
  2. It sends the message on the module output, with its properties, over the connection's session with the edge hub.
  3. At QoS 1 it waits for the edge hub to acknowledge before completing.

Success means the edge hub accepted and stored the message. Routes then deliver it; a message whose output no route matches is dropped by the edge hub, and a module cannot see its routes. Check result.outputName against the deployment's routes.

If the edge hub cannot be reached, the send fails as a retryable error and Store & Forward holds the message until the connection is back. A message over 256 KB, an invalid output name or a reserved property name is refused permanently and never retried: with Store & Forward enabled on the connection, the node completes with the message buffered and it goes straight to the dead-letter queue; without Store & Forward, the node fails.

Output​

ExpressionDescription
$node["Name"].result.outputNameThe module output the message was sent on
$node["Name"].result.topicThe MQTT topic published to, properties included
$node["Name"].result.bytesWrittenBody size in bytes
$node["Name"].result.qosThe QoS the message was sent with (0 or 1)
$node["Name"].result.messageIdThe message ID sent: the one you set, or a generated unique ID when the field is empty
{
"result": {
"outputName": "telemetry",
"topic": "devices/factory-edge-01/modules/maestrohub/messages/events/%24.on=telemetry&%24.mid=7f1c-01&%24.ct=application%2Fjson&%24.ce=utf-8",
"bytesWritten": 156,
"qos": 1,
"messageId": "7f1c-01"
}
}

Twin Report​

Patches the reported properties of MaestroHub's module twin. A null value deletes a property. The edge hub keeps the patch while the device is offline and syncs it later.

ExpressionDescription
$node["Name"].result.statusCodeThe status the edge hub answered with — 204 means accepted
$node["Name"].result.versionThe reported-properties version after the patch, when the edge hub says
$node["Name"].result.bytesWrittenPatch size in bytes

A patch over 32 KB is refused permanently and never retried, in the same way.

Read Twin​

Reads the module twin: the desired properties set from the cloud, the reported properties, or both, each with its $version.

ExpressionDescription
$node["Name"].result.sectionWhich part of the twin was requested: all, desired or reported
$node["Name"].result.desiredThe desired properties, with their $version — present unless section is reported
$node["Name"].result.reportedThe reported properties, with their $version — present unless section is desired
{
"result": {
"section": "all",
"desired": { "sampling": "5s", "$version": 4 },
"reported": { "version": "3.0.1", "$version": 12 }
}
}

Respond to Direct Method​

Answers a direct-method call that started the run through the Azure IoT Edge Method Trigger. Map Request ID from {{ $trigger._metadata.requestId }}, and set a status and a JSON payload (up to 128 KB; text that is not JSON is sent as a JSON string).

A call is answered once. Answering fails, and is not retried, when the call was already answered, when its response budget ran out (the caller got 504), or when the connection to the edge hub restarted since the call arrived (the caller got 503). This node is never buffered by Store & Forward: an answer is only useful while the caller waits.

ExpressionDescription
$node["Name"].result.requestIdThe direct-method call that was answered
$node["Name"].result.statusThe status returned to the caller
$node["Name"].result.bytesWrittenAnswer payload size in bytes

Every node also delivers its call facts under _metadata: $node["Name"]._metadata.method, $node["Name"]._metadata.connectionId and $node["Name"]._metadata.protocol (azureiotedge).

Starting a pipeline from the edge hub

To run a pipeline for each message routed to a MaestroHub input, or for each desired-property change, use the Azure IoT Edge Triggers. The connection is set up in the connection guide.