EventBridge

How to integrate Nomad Media with AWS EventBridge for event-driven workflows.

EventBridge Integration

Nomad Media sends events through AWS EventBridge. By default, events are sent on a custom Nomad Media event bus. This can be changed to the default EventBridge bus via the Nomad Media system settings.

Nomad Media Configuration

Enable EventBridge in your Nomad Media system settings by setting eventBridgeEnabled to true:

{
  "application/nomadSettings": {
    "eventBridgeEnabled": true
  }
}

The custom Nomad Media event bus is named nomad-{project-prefix}, where the project prefix is a short identifier for your Nomad Media installation. For example, if your project prefix is my-project, the event bus will be named nomad-my-project.

Nomad Media Events

Nomad Media currently triggers the following events:

Event TypeEventDescription
Asset WorkflowAsset RegisteredTriggered after an asset has been registered (typically right after it's discovered in S3) but before any processing has started. Asset status will be Registering at this point.
Asset WorkflowAsset AvailableTriggered after the asset has completed processing and the status has changed to Available. All related assets will be associated at this point.
Asset WorkflowAsset Face AssignedTriggered after a known face has been discovered in the asset and a person record has been associated.
Content ChangeRecord AddedTriggered after a content record has been added.
Content ChangeRecord UpdatedTriggered after any content record has been updated.
Content ChangeRecord DeletedTriggered after any content record has been deleted.

Event Structure

The Nomad Media event detail is contained in the EventBridge event envelope detail attribute. Each event uses the same structure:

{
  "detail-type": "{Nomad event type}",
  "detail": {
    "contentId": "{contentId or assetId}",
    "contentDefinitionName": "{title of the content definition}",
    "contentDefinitionId": "{contentDefinitionId}",
    "event": "{name of the event}",
    "identifiers": {
      "name1": "value1",
      "name2": "value2"
    }
  }
}

The identifiers object is a dynamic dictionary of all field values for the record. The fields vary by content definition. When filtering, sorting, or specifying returned fields in a query, you can reference any field by name from this identifiers list.

For more information on the EventBridge event envelope, see the AWS EventBridge documentation.

Consuming Nomad Media Events

To consume an event raised by Nomad Media, create a custom EventBridge rule on the Nomad Media custom event bus. The rule can be configured to trigger a Lambda function or REST API endpoint for specified events or content definitions.

For more information on creating EventBridge rules, see the AWS documentation.

Filtering tip: Use EventBridge content-based filtering to reduce Lambda invocations. Add restrictive filters to your rule so that only specific events for specific content definitions trigger your handler. See EventBridge content-based filtering.

Example: Consuming New Available Assets

This example shows how to trigger a custom integration every time Nomad Media finishes processing a newly uploaded asset.

Step 1 — Enable EventBridge

Ensure eventBridgeEnabled is set to true in your Nomad Media system settings (see Nomad Media Configuration above).

Step 2 — Create a Lambda handler

Create a Lambda function to contain your custom integration logic:

// handleNomadAssetAvailableEvent/index.js
exports.handler = async (event, context) => {
    console.log('Received event:', JSON.stringify(event, null, 2));
    // Add custom integration logic for the Asset Available event
};

Step 3 — Create an EventBridge rule

Create a rule on the Nomad Media custom event bus (e.g. nomad-my-project) that filters for the Asset Available event and targets your Lambda function.

Event pattern:

{
  "source": ["nomad.my-project"],
  "detail-type": ["Asset Workflow"],
  "detail": {
    "event": ["Asset Available"]
  }
}

Set the rule's target to your Lambda handler function, save the rule, and test.