New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate SurrealDB queries with Kestra. Insert records, run SurrealQL SELECT statements, and store results as artifacts for downstream tasks.
Run SurrealQL statements against a SurrealDB instance and persist the results as downloadable artifacts inside Kestra internal storage. This blueprint chains record creation, relational inserts, and SELECT queries to demonstrate how to use SurrealDB as both an operational and analytical data store within a Kestra pipeline. The stored output is referenceable by downstream tasks using the standard {{ outputs.query.uri }} expression, which makes SurrealDB a first class citizen alongside Postgres, Redis, BigQuery, and other engines in your orchestration graph.
The flow runs four io.kestra.plugin.surrealdb.Query tasks in sequence against the same SurrealDB instance:
article creates an article record with a timestamp, an author reference, body text, and a subquery resolving the parent account.account creates the ACME Inc account record.query runs SELECT * FROM article, account with fetchType: STORE, which writes the rowset to Kestra internal storage and exposes its URI as a task output.query_condition runs a filtered SELECT with a FETCH clause to pull related author and account records, again storing the result as an artifact.Connection parameters (host, database, namespace, username, password) are centralized via pluginDefaults so every task inherits the same SurrealDB endpoint.
pluginDefaults.SurrealDB ships with a powerful query engine but no native scheduler, retry policy, or cross system lineage. Kestra adds declarative YAML, event and schedule triggers, automatic retries on transient failures, full execution history, and the ability to chain SurrealDB queries with HTTP calls, file processing, notifications, or loads into other warehouses. You also get artifact storage out of the box, so query results survive the run and can feed downstream tasks or audits.
plugin-surrealdb plugin available in your Kestra installation.This blueprint uses hardcoded development defaults (root / root against localhost). For any non local environment, replace the pluginDefaults values with {{ secret('SURREALDB_HOST') }}, {{ secret('SURREALDB_USERNAME') }}, and {{ secret('SURREALDB_PASSWORD') }}.
localhost with namespace test and database test.query and query_condition outputs to download the stored results.Schedule or webhook trigger to run the queries on a cadence or on demand.CREATE statements with parameterized inputs to ingest real records.Query with retry policies for resilience against transient connection errors.