Skip to main content
Version: 3.0 (next)
AWS IoT Greengrass Trigger node

AWS IoT Greengrass trigger node

AWS IoT Greengrass Trigger Node

Overview​

The AWS IoT Greengrass Trigger starts a pipeline each time a message arrives on a topic filter of a Greengrass core device's local broker. Messages published by other client devices, by Greengrass components through the MQTT bridge, and by AWS IoT Core through the bridge all arrive the same way. The subscription is on the plant network, so the trigger keeps firing while the site is offline.


Core Functionality​

Event-driven runs. One pipeline run per message that matches the Subscribe function's topic filter. + and # wildcards let one trigger cover a whole line of devices.

Automatic subscription management. The subscription is opened when the pipeline is enabled and closed when it is disabled or deleted.

Reconnect and resubscribe. When the connection to the core drops and comes back, every trigger's filter is subscribed again. With cloud discovery, a reconnect that cannot reach AWS reuses the core endpoints discovered earlier; see offline operation.

Refused filters are reported. If the core's client device auth policy does not grant mqtt:subscribe on the filter, the subscription fails with an error naming the filter instead of silently never firing.

QoS

Use QoS 1 on the Subscribe function so the core redelivers a message that arrived while a run was being queued. MaestroHub acknowledges a QoS 1 message only after the run's trigger event is stored.


Configuration Options​

Basic Information​

FieldTypeDescription
Node LabelString (Required)Display name for the node on the pipeline canvas
DescriptionString (Optional)Explains what this trigger initiates

Parameters​

ParameterTypeDefaultRequiredConstraintsDescription
Connection IDstring""Yes--Greengrass connection profile to use.
Function IDstring""Yes--Subscribe to Topic function within the connection.
Trigger Modeselect"always"Noalways / onChangealways: trigger on every message. onChange: only trigger when the payload differs from the last one on the same topic.
EnabledbooleantrueNo--Enable or disable the trigger.
Dedup Max Keysnumber1000If onChange1--10,000Maximum tracked topic hashes for change detection.
Function Requirement

The selected function must be a Subscribe to Topic function. Publish Message functions cannot back a trigger.

Settings​

Description

A free-text area for documenting the node's purpose. It is saved with the pipeline.

Execution Settings

SettingOptionsDefaultDescription
Timeout (seconds)numberPipeline defaultMaximum execution time for this node (1--600). Leave empty for the pipeline default.
Retry on TimeoutPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry the node if it times out.
Retry on FailPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry on failure.
On ErrorPipeline Default / Stop Pipeline / Continue ExecutionPipeline DefaultBehavior when the node fails after all retries.

Output​

Each run receives the message body under result and the MQTT facts under _metadata. Every _metadata value is a string.

{
"_metadata": {
"type": "greengrass_trigger",
"connectionId": "7b2a0cf0-c9f5-444c-835e-fc2cb957be07",
"functionId": "85bab7a5-70da-4bb3-9639-9a59a414c01f",
"protocol": "greengrass",
"topic": "factory/line3/telemetry",
"qos": "1",
"retained": "false",
"timestamp": "2026-09-25T10:30:00.123456789Z"
},
"result": {
"line": "line3",
"temperature": 71.5
}
}

Accessing Message Data​

FieldExpressionDescription
Message Payload$trigger.resultThe message body (parsed JSON object, or the raw value)
Topic$trigger._metadata.topicThe topic the message was published on; useful behind a wildcard filter
QoS$trigger._metadata.qosDelivery QoS, "0" or "1"
Retained$trigger._metadata.retained"true" when the message is the topic's retained message, delivered on subscribe
Protocol$trigger._metadata.protocolAlways greengrass
Connection ID$trigger._metadata.connectionIdThe Greengrass connection profile used
Function ID$trigger._metadata.functionIdThe Subscribe function that received the message
Trigger Type$trigger._metadata.typeAlways greengrass_trigger
Timestamp$trigger._metadata.timestampWhen MaestroHub received the message
Strings, not booleans

$trigger._metadata.retained is the string "false", which is truthy in an expression. Compare it explicitly: {{ $trigger._metadata.retained == "true" }}.


Validation Rules​

Connection ID

  • Must be provided and reference a Greengrass connection profile
  • Error: "Connection is required"

Function ID

  • Must reference a Subscribe to Topic function of the selected connection
  • Error: "Subscribe Function is required"

Usage Examples​

Line telemetry from client devices​

Scenario: sensors on line 3 publish to the core's broker as client devices.

Configuration: Subscribe function on factory/+/telemetry, QoS 1, Trigger Mode always. Downstream nodes read $trigger.result.temperature and use $trigger._metadata.topic to tell the devices apart.

Commands from the cloud​

Scenario: operators send setpoints from AWS IoT Core; the core's MQTT bridge relays line3/commands from IotCore to LocalMqtt.

Configuration: Subscribe function on line3/commands. The pipeline writes $trigger.result.setpoint to the PLC.

Change-only state relay​

Scenario: a device republishes its full state every few seconds, but downstream should run only when it changes.

Configuration: Trigger Mode = onChange. Identical payloads on the same topic are suppressed; a changed payload fires.