Plex
Media & VideoPlex Media Server hosts your own library of movies, shows, music, and photos. Agents browse libraries and metadata, search, build playlists, watch active sessions, set watched state and playback progress, and react when new media is added.
What This Integration Enables
A Plex Media Server is yours. It runs on hardware you control, holding files you own, and that single fact shapes every workflow built on this connector. The server's address cannot be assumed, so discovery is a real step: the account host knows which servers a token can reach and which connection URIs to try, while the server itself knows everything about the library. Getting a clear answer to "is the token wrong or is the server unreachable" is the difference between a workflow that reports a useful failure and one that reports nothing at all.
FlowRunner agents browse library sections and items, read the cheap prebuilt views the Plex apps themselves use instead of listing whole sections and filtering them, search, read and write metadata, build and maintain playlists, watch active sessions including whether a stream is transcoding, read session history that survives the playback ending, and set watched state and playback progress. The operations that reach files on disk, or that discard manual work, are the ones this page treats carefully, because on a self-hosted server there is no vendor backup to fall back on.
Without FlowRunner
With FlowRunner
Use Case Scenarios
New media arrives already filed
The recently added trigger fires. The agent reads the item with Get Metadata, searches the library for an existing entry at a different quality, corrects the title and year, and adds it to the right collection playlist. Because Plex marks a field written this way as locked, the correction survives the next agent refresh instead of being overwritten by whatever the metadata source decides next time. A weekly digest of what landed and what was corrected posts into Discord, and the running catalog lives in Airtable so the library is queryable from outside Plex.
Watching the server while people are watching it
A monitoring flow polls List Active Sessions and reads not just who is watching but whether the stream is transcoding, which is the number that predicts a struggling server long before anyone complains. When concurrent transcodes cross a threshold the agent posts an alert to Slack with the users, the players, and the titles involved. Terminating a session is available and is not automatic, because it interrupts a person mid-episode, and if it is ever used the agent sends a reason so their client explains itself rather than simply stopping.
Deduplicating a library without deleting a file by accident
A quarterly sweep matches library items on title and year, pulls each candidate's resolution, file size, and watch state, and assembles the pairs. It also reads the server's own preferences, because whether removing an item is a library tidy up or a file deletion is decided by a server setting rather than by the request. Then it hands the whole thing over.
Human-in-Loop Highlight
Deleting a metadata item on Plex does one of two very different things, and which one it does is not in the request. On a server with media deletion enabled it removes the file from disk; on a server without it, it removes the library entry and leaves the file alone. That means an agent can issue a correct, well formed call and have it either tidy a duplicate row or permanently destroy a file that exists in no other place, depending on a preference someone set months ago. So the dedup agent reads Get Server Preferences first and puts the answer in front of the librarian along with the evidence: "Two entries match The Third Man (1949). Entry A is 1080p, 8.4 GB, watched by three accounts. Entry B is 720p, 2.1 GB, never watched. This server has media deletion enabled, so removing an entry deletes its file from disk. Remove B, or keep both?" The librarian answers. The agent does the matching, the metadata reads, and the reporting at machine speed, and the one call whose blast radius the API cannot tell it stays with the person who owns the storage.
Agent Capabilities
31 actionsAccount and Server
6- Get Account Retrieves the account the token belongs to. It works without a server address at all, which is what separates a bad token from an unreachable server.
- List Servers Discovers the servers this token can reach, including the connection URIs Plex knows about. The operation that makes a workflow portable across a self-hosted setup whose address was never fixed.
- Get Server Info Returns the server's identity and capabilities, including the machine identifier that playlist operations need.
- Get Server Identity Confirms a server address is reachable and really is a Plex server. It needs no token, which makes it the right way to test a connection separately from testing a credential.
- Get Server Preferences Reads the server's settings, including whether media deletion is enabled. The evidence this page's human gate is built on.
- List Managed Accounts Lists the managed and home accounts on the server, which is how a workflow resolves who a session belongs to.
Libraries
6- List Library Sections Lists the library sections on the server. Section keys are small stable integers but they differ between servers, so a flow that may point at either resolves them rather than hard coding them.
- List Library Items Lists the items in a section. Without a size it returns the whole section, which on a large library is a very large response, so paging parameters belong on any real use.
- Get Library View Returns one of the prebuilt views the Plex apps use for their own home screens, such as recently added, on deck, unwatched, or collections. Far cheaper than listing a section and filtering it.
- Get Global View Returns a prebuilt view across every section rather than one.
- Refresh Library Section Rescans a section to pick up new files. Its force option is not a hurry up flag: it discards existing metadata and refetches from the metadata agents, overwriting manual edits such as custom posters and titles.
- Delete Library Section Removes a library section. The files on disk survive, but watch state, ratings, collections, artwork, and playlist membership do not, and re-adding the folder rebuilds none of it.
Metadata and Search
7- Get Metadata Retrieves an item's full metadata by its rating key.
- Get Metadata Children Retrieves an item's children, such as the seasons of a show or the tracks of an album.
- Get Metadata Related Retrieves the related content Plex associates with an item.
- Update Metadata Writes metadata fields onto an item. A field written this way is marked locked, so a later agent refresh will not overwrite it, which makes the change sticky rather than a suggestion.
- Delete Metadata Item Removes an item. Whether this also deletes the file from disk depends on the server's own media deletion setting rather than on the request, which is why it carries this page's human gate.
- Search Searches the server across libraries. The lookup behind duplicate detection and every "do we already have this" check.
- Get Home Hubs Returns the hub rows the Plex home screen is built from, which is a cheap way to read what the server currently considers notable.
Sessions
3- List Active Sessions Lists what is playing right now with the user, the player, the position, and whether the stream is transcoding. The read a load monitoring flow is built on.
- Get Session History Returns playback history, which survives the playback ending while the active list does not.
- Terminate Session Stops a session in progress. It interrupts a person who is watching, so a reason should always be sent or their client simply stops with no explanation.
Playlists
7- List Playlists Lists the playlists on the server.
- Get Playlist Items Returns a playlist's contents in order.
- Create Playlist Creates a playlist. Plex addresses playlist contents by a library URI built from the server's machine identifier, which is why a playlist cannot be created from rating keys alone.
- Add Items To Playlist Adds items to an existing playlist.
- Remove Playlist Item Removes one entry from a playlist. It takes the playlist entry's own id rather than the media's rating key, because the same title can legitimately appear in a playlist more than once.
- Update Playlist Updates a playlist's title and summary.
- Delete Playlist Removes a playlist. The media itself is untouched.
Playback
2- Set Watched State Marks an item watched or unwatched. Marking a show or a season cascades to every episode inside it.
- Set Playback Progress Sets the resume position on an item. The value is in milliseconds, so a number that looks like a sensible count of seconds resumes a fraction of a second in.
Triggers
1 triggersEvent Triggers
1- On Recently Added Fires when new media appears, for one library section or across the whole server. Its first pass records the current state and emits nothing, so starting a flow does not fire once per item already in the library. Plex does have webhooks, but they are configured in its own web app with no management API, so there is nothing for a realtime trigger to register and this one polls.
Frequently Asked Questions
What can FlowRunner do with Plex?
FlowRunner agents can run Get Account, List Servers, and Get Server Info in Plex, plus 28 more actions.
Does connecting Plex to FlowRunner require OAuth?
No. Plex connects to FlowRunner with an API key, no OAuth flow required.
Can Plex trigger a FlowRunner workflow automatically?
Yes. Plex supports 1 trigger that can start a FlowRunner workflow automatically.
Start building with Plex
$100 in credits. No card required. Connect in minutes.