OptionalAdhocOptional TTL (time-to-live) in minutes for server-side caching of ad-hoc SQL queries.
When set to a value > 0 and the query uses the SQL field (ad-hoc mode), results
will be cached using a hash of the SQL string as the cache key.
Subsequent identical SQL executions within the TTL window return cached results.
Has no effect on saved queries (they use QueryInfo.CacheConfig instead).
OptionalAuditoptional - if provided and either ForceAuditLog is set, or the query's property settings for logging query runs are set to true, this will be used as the Audit Log Description.
OptionalCacheWhen set to true, the RunQuery will first check the LocalCacheManager for cached results. If cached results exist and are still valid (based on smart cache fingerprinting), they will be returned immediately without hitting the server. This is useful for frequently-accessed, relatively-static query results.
Note: The LocalCacheManager must be initialized before this can work. For queries with CacheValidationSQL configured, the server will validate cache freshness using fingerprint comparison (maxUpdatedAt + rowCount) before returning fresh data.
OptionalCacheOptional TTL (time-to-live) in milliseconds for cached results when CacheLocal is true. After this time, cached results will be considered stale and fresh data will be fetched. If not specified:
OptionalCategoryOptional, if provided, the query to be run will be selected to match the specified CategoryID
OptionalCategoryOptional, if provided, the query to be run will be selected to match the specified Category by hierarchical path (e.g., "/MJ/AI/Agents/") or simple category name for backward compatibility
OptionalEnrichmentOptional, additive post-query enrichment directive. When set, RunQuery resolves
the enricher registered under Enrichment.EnricherKey (via the MJGlobal
ClassFactory) and awaits it on the result rows just before returning, appending
whatever derived column(s) the enricher produces (e.g. an ML model prediction).
This is a runtime-only directive — there is no persisted per-query column for it (a saved annotation is a deliberate follow-up), so it requires no schema change. It is fully decoupled and resilient: when no enricher is registered under the key (the providing package isn't loaded) RunQuery no-ops, and any enrichment failure is logged and falls back to the un-enriched rows — a scoring problem never breaks the query.
OptionalForceoptional - if set to true, the query run will ALWAYS be logged to the Audit Log, regardless of the query's property settings for logging query runs.
OptionalMaxOptional maximum number of rows to return from the query. If not provided, all rows will be returned.
OptionalParametersOptional parameters to pass to parameterized queries that use Nunjucks templates. Key-value pairs where keys match parameter names defined in QueryParameter metadata. Values will be validated and type-converted based on parameter definitions.
OptionalQueryProvide either QueryID or QueryName. If both are provided QueryName is ignored
OptionalQueryProvide either QueryID or QueryName. If both are provided QueryName is ignored
OptionalSQLRaw SQL to execute directly (alternative to QueryID/QueryName). Must be a SELECT or WITH (CTE) statement — mutations are rejected server-side via SQLExpressionValidator. When provided, QueryID and QueryName are ignored. The query runs on a read-only connection with security validation.
OptionalStartOptional - if provided, this value will be used to offset the rows returned. Used for pagination in conjunction with MaxRows.
Parameters for running a query, must provide either QueryID or QueryName. If both are provided QueryName is ignored. QueryName and CategoryPath together uniquely identify a Query, just as QueryID does. CategoryPath supports hierarchical paths (e.g., "/MJ/AI/Agents/") for navigation through nested categories.