Microsoft Access Database Capacity & Ledger Integrity Sentinel
Audits Microsoft Access databases for transaction ledger mismatches, unposted backlogs, and automates audit hold remediation.
Poll SurrealDB for integrity violations in real time, alert Slack with the violating rows, and log the result for data platform teams.
A business invariant encoded only in application code, a balance that should never go negative, a record that should never exist without its parent, can still slip through if a bug or a manual data fix bypasses that code path. SurrealDB itself has no built-in constraint check that pages anyone the moment such a row appears; it just sits there until a report looks wrong. This blueprint turns a single SurrealQL query encoding that invariant into a standing, real-time compliance check.
This blueprint was created by Mohit Jeswani.
watch_integrity_violations (io.kestra.plugin.surrealdb.Trigger) polls query every 5
minutes and only fires an execution when it returns at least one row; a clean poll
produces no execution at all, so every execution of this flow represents a real,
currently-existing violation.evaluate (io.kestra.plugin.core.output.OutputValues) classifies the violation count
this poll found as WIDESPREAD_INTEGRITY_VIOLATION at or above
max_isolated_violation_count, otherwise INTEGRITY_VIOLATION.route (io.kestra.plugin.core.flow.If) posts to Slack either way, since both
severities represent a real violation, with the widespread case worded for urgency and
carrying the same real row data either way.summary logs the violation count and severity, closing the governance cycle.errors alerts Slack if the flow itself fails, for example a broker connection drop.Trigger
used for data-integrity enforcement, distinct from this repo's existing SurrealDB
blueprints, which use the scheduled Query task for cleanup and audit flows rather than a
continuously-polling violation trigger.SurrealDB answers a query on request; it does not keep polling on its own, decide what
counts as a widespread versus isolated violation, or notify a Slack channel the moment one
appears. Kestra keeps max_isolated_violation_count as a flow input, turns a violating query
result into a Slack page carrying the real rows, and keeps a full execution history of every
violation ever caught.
surrealdb/surrealdb Docker
image, with at least one table your query can check an invariant against.SURREALDB_USERNAME / SURREALDB_PASSWORD: used by watch_integrity_violations. In
Kestra OSS, provide them as the base64-encoded environment variables
SECRET_SURREALDB_USERNAME and SECRET_SURREALDB_PASSWORD.SLACK_WEBHOOK_URL: used by both Slack tasks and the errors block. In Kestra OSS,
provide it as the base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Default | Purpose |
|---|---|---|
max_isolated_violation_count |
3 |
Row count at or above which a poll is classified as widespread rather than isolated |
{{ trigger.rows }} / .size: the violating rows this poll found and how many, as the
Trigger reports them (reusing the underlying Query task's own output shape).{{ outputs.evaluate.values.violation_count }} / .severity: the same count, and
INTEGRITY_VIOLATION or WIDESPREAD_INTEGRITY_VIOLATION.query is the entire governance policy; this blueprint does not validate that it
actually encodes a real invariant, a loosely-written query can match far more (or fewer)
rows than intended.fetchType: FETCH keeps rows in memory for the Slack payload; a query that can legitimately
match a very large number of rows should lower fetchType to STORE and alert with the
storage URI instead of inlining every row into one Slack message.inputs: to override per execution; query, namespace, and
database are trigger-level configuration set directly on the trigger block.docker run -p 8000:8000 surrealdb/surrealdb:latest start --user root --pass root) and add the SURREALDB_USERNAME, SURREALDB_PASSWORD,
and SLACK_WEBHOOK_URL secrets.query, namespace, and database on watch_integrity_violations to a real
invariant check against a real table.WIDESPREAD_INTEGRITY_VIOLATION fires
instead of the isolated case.SELECT count() FROM ... query via io.kestra.plugin.surrealdb.Query in the
widespread branch to size the full scope of the violation beyond this one poll's rows.io.kestra.plugin.surrealdb.Query, gated behind an explicit confirm_quarantine input.WIDESPREAD_INTEGRITY_VIOLATION to an on-call paging channel and the isolated case
to a lower-urgency channel, since the two likely have different owners.