Product
|
Directus v12.7: AI Flow Operations, OpenRouter, Card Select, and a WYSIWYG That Keeps Your HTML
Generate text and images inside Flows, connect OpenRouter, pick values from cards, and preserve editing with some deprecated HTML, with stricter env parsing and query limits under the hood.

Bryant Gillespie
Staff Product Engineer

Flows can now call AI directly. v12.7 adds AI Text and AI Image operations, OpenRouter as a provider, single and multiple choice card interfaces, and a set of WYSIWYG options that keep HTML the editor used to strip. Under the hood, environment variables are parsed more strictly and queries, WebSocket messages and subscriptions all got firmer limits.
Before we dive in, I want to highlight a few potential breaking changes you should be aware of:
Breaking Changes
🟡 Environment variables are cast more strictly: @directus/env now knows every built-in variable and its type. That changes how some values are read:
Booleans only accept
true,false,1and0, in any case. A value such asyesis invalid, and some variables that previously treated any non-empty value as enabled (for exampleSERVE_APP=FALSE) now read it correctly.Plain number durations are read as milliseconds, so
ACCESS_TOKEN_TTL=900means 900 ms. Add a unit, such as15m, to be explicit.Invalid values log a warning and fall back to the default, or to
falsefor booleans without one.KEY=with no value in a.envfile now counts as not configured. UseKEY=""for an empty value. For a database user without a password, that meansDB_PASSWORD="", sinceDB_PASSWORD=is now reported as missing.Empty string and list values are kept as empty instead of falling back to the default. For example, an empty
EMAIL_SENDMAIL_PATHis no longer replaced by/usr/sbin/sendmail.useEnvreturns parsed values: durations and sizes are numbers, and lists are arrays. Theenvpassed to API extensions is now typed asRecord<string, unknown>, so narrow values before you use them.
🟡 Query parsing is bounded: filter and deep are now rejected with an InvalidQueryError once they exceed a node count or nesting depth. The limits are set by QUERY_FILTER_MAX_NODES (default 10000), QUERY_FILTER_MAX_DEPTH (default 50) and GRAPHQL_QUERY_SELECTION_LIMIT (default 10000). The node limit is the one you’re most likely to hit, since every value counts: an _in filter with more than 9997 values is now rejected. Set a limit to Infinity to opt out. Dynamic variables are also held to stricter limits, and $CURRENT_USER, $CURRENT_ROLE, $CURRENT_ROLES and $CURRENT_POLICIES paths in filters now respect MAX_RELATIONAL_DEPTH.
🟡 WebSocket messages respect MAX_PAYLOAD_SIZE: A message larger than MAX_PAYLOAD_SIZE (default 1mb) now closes the connection with code 1009. Previously the setting applied only to REST bodies.
🟡 Subscription delete events enforce read permissions: To receive delete events over WebSockets, a user now needs read access to at least the id field, with no item rules, on the collection.
🟡 Proxy support for outbound requests for S3: Directus now honors HTTP_PROXY, HTTPS_PROXY and NO_PROXY, read from the process environment rather than your .env or config file. If these are already set and S3 should be reached directly, add the S3 host to NO_PROXY. STORAGE_<LOCATION>_CONNECTION_TIMEOUT (5 seconds by default) now also covers the proxy handshake, so raise it for slow proxies.
You can see the full list of breaking changes in the changelog.
OpenRouter as an AI Provider
OpenRouter joins the list of AI providers. Model selection in AI settings is searchable, which helps with a catalog this size, and prompts are cached across tool steps. OpenRouter’s image models also show up in the AI Image operation’s model picker.
The AI SDK packages are updated to their latest v6 releases too, adding support for current OpenAI image models and Claude 5 structured output.
AI Text and AI Image Flow Operations
Two new operations bring AI into your automations. AI Text generates text or structured data with any configured AI provider and model. AI Image generates images with OpenAI, Google or OpenRouter models and saves them straight to the File Library.
Both read provider keys from Settings > AI, so you configure a provider once and use it everywhere. Drafting summaries, tagging content or creating a hero image when an item is published can now happen in a Flow, without a custom extension.
Card Select Interfaces
New single and multiple choice card interfaces let editors pick values from cards with icons, images and search. They’re a better fit than a dropdown when the choice is visual, such as a page layout or a block style. If you’ve been using the Directus Labs card select extension, you can now switch to the built-in interfaces.
A WYSIWYG With Wider Support for Previously Deprecated HTML
Content migrated from other systems often carries markup the WYSIWYG now strips or rewrites. v12.7 adds options under advanced that give you the option to preserve more of that markup:
Layout Elements keeps
<div>,<aside>,<header>,<footer>,<nav>and<main>.Form Elements keeps forms, buttons and inputs as non-editable blocks.
HTML Comments keeps stored comments, with a toolbar toggle to show them.
Further options keep inline styles and
<style>tags, legacy<iframe>and table attributes, and<b>and<i>tags.Paragraph wrapping let’s you choose if the editor adds
<p>tags inside list items, blockquotes and table cells or not.
The editor also now keeps inline images in their line of text inside paragraphs, headings, list items and captions, preserves <a name> anchors, inline <svg> and image maps by default, and no longer drops a div’s class when turning it into a paragraph.
Calendar Event Colors
The calendar layout can now color event cards from a field you choose, with text contrast calculated automatically so labels stay readable.
Other Improvements
Performance: Typing in item forms no longer re-renders every field on each keystroke, tables only re-render rows whose data changed, and field, relation and collection lookups in the Data Studio are faster.
Database defaults:
uuidv7()is now an allowed default function.Security: Redacted keys no longer leak into flow logs from webhook bodies or arrays,
directus_users.auth_datais now concealed, regexes with runaway worst-case matching were reworked, and dependencies were updated to address CVEs.Extensions: Failed reloads no longer crash or unload flows and extensions, and API hook extensions now receive the
extensions.unloadevent.GraphQL: Multiple aliased relational fields in a Many-to-Any fragment no longer return null or error, and the M2A alias is no longer dropped from a selection.
Insights: Multi-query panels, such as a bar chart with an X-axis display field, no longer render empty at random.
Many-to-any display: Related values now show each item’s display template instead of junction IDs.
SDK: The realtime WebSocket URL now respects a subpath in the client URL.
Errors: New
withZodSupportandformatZodErrorhelpers in@directus/errorsbuildInvalidPayloadErrorandInvalidQueryErrorfrom Zod errors.
Check out the full release notes on GitHub for the complete changelog.
Directus v12.7 is Available Now
Update your instances to get AI Text and AI Image operations, OpenRouter, card select interfaces, the new WYSIWYG options, and everything else in this release. Before you do, check your .env for empty KEY= values, plain-number durations and non-standard booleans, and make sure large _in filters stay within the new query limits.
As always, back up your database before upgrading.
Ready to move faster?
30 minutes with a product specialist. See how Directus fits your stack.
KEEP EXPLORING
Explore the product context, implementation paths, and more guides from Directus.