
OPA (Open Policy Agent) Compile
CertifiedEnterprise EditionPartially compile an OPA policy
OPA (Open Policy Agent) Compile
Partially compile an OPA policy
Uses the OPA Compile API to partially evaluate a Rego query, returning residual queries. Metrics and explain outputs are optional and disabled by default.
type: io.kestra.plugin.ee.opa.policy.CompileExamples
Compile an OPA policy (partial evaluation)
id: compile_policy
namespace: company.team
tasks:
- id: compile_policy
type: io.kestra.plugin.ee.opa.policy.Compile
url: "{{ secret('OPA_URL') }}"
token: "{{ secret('OPA_TOKEN') }}"
query: "data.authz.allow == true"
input:
user:
role: "analyst"
department: "finance"
unknowns:
- "data.records"
options:
disableInlining: []
metrics: true
Properties
query *string
Rego query to compile
Rego query to partially evaluate (e.g., data.policy.allow == true).
url *string
OPA base URL
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150explain string
Explain
Return query explanation in addition to result. Allowed values: notes, full, fail, debug.
input object
Input document
Input data rendered with flow variables and passed to partial evaluation.
metrics booleanstring
Enable metrics
Return query performance metrics; defaults to false.
options object
Compile options
Additional options forwarded to OPA compile (see OPA docs).
token string
Bearer token
unknowns array
Unknowns
Paths to treat as unknown during partial evaluation so OPA emits residual queries.
Outputs
defined boolean
Whether result is defined
queries object
Compiled queries (if present)
response object
Raw OPA response
result object
Compile result