In ftrack, the Event Server (often referred to as the Event Hub) is a central service that manages real-time communication between ftrack Studio and external clients. It allows developers to automate workflows by listening for specific triggers or publishing custom data across the pipeline.
Core Functionality
Core Functionality
- Real-Time Triggers: The server automatically generates events when actions occur in ftrack, such as a task status being updated or a new version being published.
- Event Routing: It acts as a central hub where clients (like Python scripts or ftrack Connect) subscribe to specific event "topics" they are interested in.
- Bidirectional Communication: Clients can both listen to events and publish their own, allowing for custom Actions and complex integrations.
- UI Updates: The UI relies on the event server for "live" features such as notifying users when new data is available in the spreadsheet views, or triggering inbox notifications.
Implementation and Access
- Python API: The most common way to interact with the event server is through the ftrack Python API. Each
Sessionobject has anevent_hubattribute for connecting and subscribing to events. - JavaScript API: For web-based tools, the @ftrack/api provides similar functionality through an
EventHubclass. - Headless Environments: For servers where ftrack Connect cannot run, you can create a standalone Python listener that connects directly to the ftrack server URL.
Key Concepts
- Topic: A string identifier (e.g.,
ftrack.update) used to categorize events. - Subscription: A filter applied by a client to receive only relevant events.
- Synchronous vs. Asynchronous: Some events are blocking (synchronous), meaning the server waits for a response before continuing, while others are simply broadcasted (asynchronous).