New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate SurrealDB CRUD operations in SurrealQL with Kestra. Run queries, parse results, and post structured updates to Slack from one declarative flow.
This blueprint orchestrates a full SurrealDB CRUD lifecycle in SurrealQL and pushes the final query result into Slack. It walks through creating records, deleting rows, updating fields, joining across tables with subqueries, and reading data back, then routes the result to a chat channel so the team sees the outcome without opening the database. It solves the gap between running ad hoc SurrealQL statements and getting reliable, observable, scheduled data operations with downstream notifications.
The flow runs a sequence of io.kestra.plugin.surrealdb.Query tasks against a SurrealDB instance, then logs and notifies on the final result.
company inserts a company record with name = 'Kestra' and a time::now() timestamp.delete_anna removes the author:anna record so the flow is idempotent on re-run.add_author_tbl (disabled by default) shows how to create an author:anna row with nested name fields and an admin flag.fix_admin_permission runs an UPDATE that flips admin = false for the matching author.create_article_tbl inserts an article row that links to author:anna and to the company via a SELECT VALUE id subquery.query runs SELECT title FROM article with fetchType: FETCH_ONE to capture a single row into outputs.log_query_results writes {{ outputs.query.row }} via io.kestra.plugin.core.log.Log.slack posts {{ outputs.query.row.title }} to an incoming webhook using io.kestra.plugin.slack.notifications.SlackIncomingWebhook.Shared SurrealDB connection settings (host, database, namespace, username, password) are centralized in pluginDefaults so every Query task inherits them.
pluginDefaults instead of repeating credentials per task.{{ outputs.query.row }}.SurrealDB ships a powerful query engine but no scheduler, retry layer, or notification fabric. Kestra fills that gap with declarative YAML, event and cron triggers, automatic retries, full execution history, and per-task logs and outputs. You get lineage across the entire CRUD sequence, can fan out to Slack, email, or webhooks on success or failure, and can wire the same flow to events from other systems (S3 uploads, Kafka messages, API calls) without writing glue code.
localhost, namespace test, database test, user root.SLACK_WEBHOOK: incoming webhook URL used by the slack task to post the query result.pluginDefaults if you are not running locally with the root user.SLACK_WEBHOOK secret.add_author_tbl (set disabled: false) on the first run to seed the author:anna record.outputs.query.row in the Outputs panel to see the captured SurrealDB row.CREATE/UPDATE payloads with flow inputs to drive parameterized writes.outputs.query.row with io.kestra.plugin.core.flow.If to alert only on specific titles or values.