Pipeline specifications¶
A pipeline specification is the reviewable YAML or JSON definition of a pipeline. It names the steps and their data contracts, but never contains connection credentials. Git is the source of truth. When you apply a commit, Braidplane stores an immutable version for validation and deployment.
Use filenames ending in .pipeline.yaml, .pipeline.yml, or .pipeline.json.
The examples below use YAML.
Top-level shape¶
metadata:
slug: customer-export
name: Customer export
steps:
- kind: query
slug: read-customers
query:
data_source_ref: customers-db
operation_type: sql
operation_ref: active-customers
output_contract:
representation: rows
fields:
- name: customer_id
type: string
required: true
metadata.slug and every step slug use lowercase letters, digits, and hyphens.
Slugs are stable identifiers; names are display labels. steps must contain at
least one step and form an acyclic graph.
Before deployment or execution, every step must belong to one connected data flow. Multiple sources may join downstream, and one producer may feed multiple sinks. Explicit query-parameter step references also connect the graph. Sharing a connection, project, schedule or trigger does not connect independent flows. Validation lists disconnected groups and their step slugs: split those flows into separate pipelines or connect them through an actual data dependency. Connectivity does not impose a step-count or resource limit.
Draft save and formatting preserve incomplete or disconnected work. Existing deployed or pinned versions must pass the rule at their next deployment or run, including replay and recovery. Stored versions, run history and retained artifacts remain unchanged; remediation requires new reviewed definitions.
An enabled schedule can catch up from its creation time, including a cron
occurrence exactly at creation. After any trigger edit, including enabling or
re-enabling, only occurrences after the new revision's update time are eligible.
A missed occurrence within the active revision follows its skip or fire_once
policy.
Set schedule.preflight_lead_time in the API, or pass --preflight-lead-time
when creating or updating a schedule with the CLI. The value is optional and
accepts whole-minute durations from 1m through 24h. A daily 09:00 schedule
with 1h becomes eligible for preflight at 08:00, while 6h makes it eligible
at 03:00. Use a calendar cron expression so the dispatcher can calculate each
occurrence in the schedule's timezone. Omit the lead time when updating the
schedule to turn preflight off.
Preflight refreshes the selected pipeline's source schema metadata and checks
its contracts in the schedule's environment. Look in the schedule's History
tab or use pipeline trigger fire list to see upcoming preflights and
diagnostics for previous fires. The result includes the version checked.
For latest_deployed, the check uses the version deployed when preflight
starts, and the run uses the deployment current when execution starts. Preflight
never executes the pipeline or blocks its scheduled run.
To send failed preflights to email or Slack, create an alert policy, select Scheduled preflight failed, and attach the destination. The policy must explicitly select this notification type. Each failed occurrence can produce one warning, including when a schema refresh fails or the check times out.
Schedule, webhook and completion retries use the retry policy captured for the
original execution. Set jitter to true in the retry policy or pass
--retry-jitter in the CLI to spread retries between half and all of the
calculated fixed or exponential delay, after applying max_delay_seconds.
Each queued retry keeps its chosen dispatch time across redeliveries.
When max_elapsed_seconds is set, queue time, downtime and admission
wait count toward that budget. A new attempt may start at the deadline, but an
attempt starting after it is refused with max_elapsed_exhausted. Attempts that
already executed can still finish recording their result after the deadline.
Step kinds¶
| Kind | Purpose | Required block |
|---|---|---|
input |
Accept one run-scoped JSON payload | input.output_contract |
query |
Read from a connector | query |
transform |
Transform earlier results with sql_v1 |
transform |
sink |
Write one earlier result to a connector | sink |
Query steps are graph roots. A transform uses a map of SQL table aliases to earlier step slugs. A sink consumes exactly one earlier step:
- kind: transform
slug: select-customer-ids
transform:
inputs:
customers: read-customers
sql: SELECT customer_id FROM customers
output_kind: rows
- kind: sink
slug: write-customers
sink:
input: select-customer-ids
data_source_ref: archive
operation_type: s3
operation_ref: write-customer-export
config:
key: exports/customers.json
overwrite: true
idempotency_class: naturally_idempotent
S3 terminal sinks require a non-empty string at sink.config.key, even when
the saved or inline operation already contains a key. CLI and API-backed
definition validation check this requirement. A connection test checks the
connection separately; it does not validate the sink definition.
This example overwrites a stable object key. Choose another replay class if the operation does not satisfy that guarantee.
Every transform or sink reference must point to an earlier input, query, or transform step. Query-parameter step references must point to an earlier query or transform step. Multiple query roots are allowed when they converge downstream.
Connections and operations¶
data_source_ref is a logical name, not the slug of a saved connection.
Bind each logical reference to a compatible data source separately for every
project environment. That keeps one specification portable across runtime
targets.
Set operation_type to the connector operation family:
- Query:
stripe,sql,bigquery,snowflake,http,hubspot,ftp,mongodb,git, ors3 - Sink:
sql,bigquery,snowflake,http,hubspot,ftp,mongodb,git, ors3
google_workspace is available only where the deployment enables that
connector. Check the connection options in your workspace before using it in a
pipeline.
Define exactly one operation target:
operation_ref: slug of a saved connector operation; recommended when the operation is managed and tested independently.operation_inline: connector-specific statement embedded in the spec.
Connector guides define the accepted statement fields.
Parameters and {{placeholders}}¶
Use {{name}} in a connector operation when part of the operation must receive
a value at execution time. Names are case-sensitive. For example, a saved SQL
query might contain:
SELECT customer_id, email
FROM customers
WHERE customer_id = {{customer_id}}
A saved query defines each ordinary parameter's name, type, whether it is
required, and any default. Supported types are text, integer, boolean,
date, and uuid. The pipeline query step supplies the value under the same
name. An inline operation has no saved parameter definition, so put every
ordinary placeholder value in the query step's parameters map and use the
connector's supported value types. Reserved {{runtime.*}} expressions may
also appear directly in supported inline-operation fields.
- kind: query
slug: read-customer
query:
data_source_ref: customers-db
operation_type: sql
operation_ref: customer-by-id
parameters:
customer_id: "{{runtime.input.customer_id}}"
Here, {{customer_id}} belongs to the saved operation, while
{{runtime.input.customer_id}} tells the pipeline where its value comes from.
Start the run with a non-secret input value:
braidplane pipeline start customer-export \
--input-json '{"customer_id": 42}'
A query parameter value can be:
- a literal JSON-compatible value, such as
customer_id: 42; - a per-run non-secret value,
{{runtime.input.customer_id}}; - an environment value,
{{runtime.env.batch_size}}; - a write-only environment secret,
{{runtime.secrets.API_TOKEN}}; or - an earlier query or transform result, such as
$steps.read-customers.rows.
The runtime.* namespaces are reserved and supplied by Braidplane. {{input}}
is also reserved for the upstream payload consumed by a sink; it is not an
ordinary query parameter. Keep connection credentials on the data source, not
in pipeline literals or per-run input.
Current runtime parameter catalog¶
These values are supplied at execution time. They are not saved query
parameters, and the runtime. prefix is reserved.
| Expression | Value and format | Resolution, missing values, and exposure |
|---|---|---|
{{runtime.run.date}} |
Current UTC date, YYYY-MM-DD |
Pinned once before pipeline execution; reused by all operations, retries, and recovery. Standalone query execution uses its own current time. |
{{runtime.run.datetime}} |
Current UTC timestamp, RFC 3339 (for example, 2026-05-14T22:30:00Z) |
Pinned once before pipeline execution; reused by all operations, retries, and recovery. Standalone query execution uses its own current time. |
{{runtime.previous_success.exists}} |
Boolean. | Pipeline parameter/config fields and supported connector bindings. Unavailable in standalone queries. False when no qualifying success remains. Selected once with the run timestamp; never changes during retries or recovery. |
{{runtime.previous_success.run_slug}} |
Prior attempt's slug, or null. | Same pinned selection and locations as exists; never a sink replay identity. |
{{runtime.previous_success.started_at}} |
RFC 3339 UTC text, or null. | Same pinned selection and locations as exists; supports date operations when non-null. |
{{runtime.previous_success.finished_at}} |
RFC 3339 UTC text, or null. | Same pinned selection and locations as exists; supports date operations when non-null. |
{{runtime.input.<key>}} |
Non-secret JSON value supplied for this run. Keys match [A-Za-z_][A-Za-z0-9_]* and cannot be secret-like. |
Resolved on the execution copy before validation. A missing key fails the run. Values are request-local: run records, events, logs, and UI retain only input key names. |
{{runtime.env.<key>}} |
Environment scalar: text, integer, boolean, date (YYYY-MM-DD), or UUID string. |
Resolved on the execution copy before validation. A missing key fails the run. |
{{runtime.secrets.<key>}} |
Write-only environment secret. | Resolved only inside the runtime boundary before execution. A missing key fails the run; plaintext is redacted and is never persisted, returned, logged, or rendered. |
{{runtime.incremental.lower_bound}} and .value / .cursor |
The decoded prior checkpoint, or its comparable watermark value / opaque cursor. | Injected for incremental source execution. On the first run each bound is null; the source must handle that case. |
{{runtime.incremental.upper_bound}} and .value / .cursor |
The bounded upper checkpoint, or its comparable watermark value / opaque cursor. | Injected for incremental source execution. It is null until a bound is available; successful execution observes the next watermark or cursor. |
{{runtime.run.slug}} |
Current attempt's run slug. | Available throughout pipeline execution in parameter/config fields and supported connector bindings. Standalone queries have no pipeline run slug. Retries and recovery use their own attempt slug; use runtime.sink.replay_identity when the key must retain the original effect identity. |
{{runtime.sink.idempotency_key}} |
Resolved sink idempotency key. | Injected only while a sink operation executes, when a non-empty key is configured. |
{{runtime.sink.idempotency_class}} |
Declared sink idempotency class as text. | Injected only while a sink operation executes, when the class is known. It describes the declared delivery contract, not proof of provider behavior. |
{{runtime.sink.record_id}} |
Destination record ID from the current row. | Available only in the URL path of a bounded HTTP record update. The source column is selected by record_updates.identity_field. |
{{runtime.sink.replay_identity}} |
Stable sink effect identity, normally the run slug. | Injected only while a sink operation executes. Authorized recovery reuses the original run's identity, so a deterministic sink key can target the same external effect. It is not a general source or transform parameter. |
Runtime input preserves JSON numbers in objects and arrays through queued execution.
A numeric token can contain up to 128 bytes and 38 coefficient digits after leading
zeros, including trailing zeros. The explicit exponent must be between −308 and
308. After expansion, at most 38 integer digits and 38 fractional places are
supported. Equivalent spellings such as 1.250e2 and 125 resolve to the same
value and checkpoint identity. Connector types and arithmetic retain their own
limits. Use a JSON string when the spelling itself matters.
Existing jobs use the same JSON format. Reload uses the stored number subject to these bounds. A job or checkpoint written with an already rounded value retains that value. Supplying the corrected number can therefore select a different inline source checkpoint.
In Environments → Compare runtime variables, define each key's type, description, required status, and optional default. An environment uses its override first and otherwise inherits the organization default. New environments inherit defaults as soon as they are created.
The comparison shows the value source for each environment. It flags missing required values and type mismatches. Valid values can differ across targets. Open the comparison from a pipeline's binding setup to include every runtime variable referenced by that exact version.
All fields are reserved bindings rather than saved-query parameter declarations. Use whole-value placeholders to retain their declared type; interpolation produces text and rejects null. Run dates may appear in pipeline query parameters, sink config, and connector fields with named-parameter support. Plain previous-success fields are available through supported connector bindings; date operations belong in pipeline query parameters and sink config. Environment, input, and secret values may appear in pipeline query parameters, inline connector fields, and sink config; the selected connector must support the resulting field type. Environment values may also supply an incremental lookback duration. Sink metadata is available in sink config and sink connector bindings only. Incremental bounds are available in incremental query parameters and source connector bindings only. Runtime bindings are unavailable in transform SQL, data-source identities, and pipeline metadata.
Retained-input recovery¶
Retained-input recovery can repair terminal sink failures and explicit worker-loss
attempts after queue ownership is fenced. It reuses the recorded version, source
and transform outputs, and effect identity. Worker-loss recovery requires complete
retained inputs and repeat-safe sinks. Recovery refuses targets or inputs that
change with runtime.run.slug. Use runtime.sink.replay_identity for a deterministic
S3 key with overwrite: true.
Bounded eligible checkpoints are saved before sink dispatch, with a 10 MiB total limit and the organization's retention policy. Complete file inputs remain encrypted outside that JSON allowance and follow replay-checkpoint retention (seven days by default). Recovery streams the original retained bytes under a new live execution claim. Public run/checkpoint JSON exposes file metadata only; missing or expired file inputs are refused without rereading the source. Event payloads and runs with resolved environment secrets are excluded from this early retention. Missing inputs, unknown ledger-only attempts and unsafe effects remain refused unless supported readback confirms the effect. Readback is available for deterministic S3 output and bounded HTTP record updates. Worker-loss detection and fencing are automatic. With the default one-minute job timeout and two-minute rescue threshold, the target is three minutes after worker loss when PostgreSQL and worker capacity are available. Rescue uses attempt age; worker observations diagnose stale activity but do not establish ownership. Longer job settings, queue backlog or a database outage extend this delay.
Each runtime sink write claims its effect durably before dispatch. A slow worker or a lost database connection leaves that claim in place. Recovery can write an unclaimed effect and skips a confirmed effect. It never starts another writer for an unresolved claim. A returning worker cannot claim new effects after its run has been fenced.
For deterministic S3 overwrite, an unresolved claim can be confirmed automatically by reading the object and matching the complete prepared bytes, content type and user metadata. This requires object read permission as well as write permission. Matching readback records confirmation without another PUT. A missing or different object, failed read, unavailable retained input or an unsupported readback path keeps recovery blocked. No declaration of idempotency overrides an unresolved writer. An accepted request may still settle later at the provider; recovery does not promise general exactly-once delivery.
After worker loss, monitor the run until native rescue records a terminal
worker-ownership failure. Use the existing recovery action below; no stopped-worker
confirmation is required. Recovery uses the retained version and source/transform
outputs, even if source data has changed. Repeating recovery skips confirmed
writes. If recovery is refused, inspect provider effects and the retained-input
explanation before starting a new evaluation, which reads sources again. Configure
long-running jobs through the deployment's worker.job_timeout and
worker.rescue_stuck_jobs_after settings, keeping at least a minute between them.
The UI recovery action, API and pipeline run recover CLI share these checks;
a new evaluation reads current sources again.
Run dates and safe run/sink/history identities may appear in user-authored output paths or requests. Environment values are non-secret and may be retained in pinned deployment materialization. Input values and secret plaintext are never runtime history fields; only safe input key names are retained. Checkpoint values follow the connector checkpoint's persistence and inspection policy. Missing sink metadata fails if referenced; it does not become an empty string. Standalone queries supply run dates but require explicit pipeline/sink/incremental context for other runtime bindings. Connector field restrictions still apply: for example, a SQL value uses a named bound parameter, not SQL identifier or statement interpolation.
Incremental bounds are connector-defined JSON: an object bound exposes each
of its top-level fields through .field; scalar bounds also appear as .value
and .cursor. Missing .value or .cursor is null. Object field types follow
the connector's checkpoint schema; watermark timestamps use the source's
serialized timestamp format rather than the run's wall clock. Incremental bounds
are supplied only to query execution, never directly to transform SQL.
{{input}} has a different role: it is the exact upstream payload binding for
a sink operation, such as rows: "{{input}}" or body: "{{input}}", and is
resolved when the sink dispatches. $steps.<step-slug>.<field> is also
different: it is a typed reference to a completed earlier step result, resolved
just before a later query or transform runs. Supported fields depend on the
result type; common fields are rows, column_names, and row_count, while
HTTP and cursor results also expose fields such as body, headers, file,
and next_cursor. A missing, unfinished, or unsupported step field fails the
step. A string beginning with $steps. inside a resolved runtime input or
environment value remains a literal string rather than becoming a new step
reference.
Date expressions and previous success¶
Use date-operation expressions in pipeline query.parameters and sink.config values.
They work in the shared CLI/backend validator and in Builder-authored specs.
Pass them through named query parameters, including for SQL; the connector
continues to bind parameter values safely. Expressions are not evaluated inside
SQL text, saved operation definitions, transform SQL, runtime inputs, or secrets.
Plain run and previous-success bindings are also available in connector fields
that support named parameter substitution.
Date operations on runtime.env.<key> require a date-typed environment variable.
Operations on runtime.input.<key> require an ISO date (YYYY-MM-DD) or RFC 3339
timestamp string. Timestamps normalize to UTC before calendar operations.
Text-typed environment variables, numbers, booleans, objects, arrays, null, and
secrets cannot supply date operations. Resolved strings remain data and cannot
introduce new expressions.
parameters:
since: "{{runtime.run.datetime | offset:-24h}}"
report_date: "{{runtime.run.date | add_days:-1}}"
prior_finished: "{{runtime.previous_success.finished_at}}"
has_previous: "{{runtime.previous_success.exists}}"
reporting_month: "{{runtime.env.reporting_date | add_months:-1}}"
requested_day: "{{runtime.input.requested_at | format:date}}"
| Operation | Behavior |
|---|---|
offset:DURATION |
Fixed elapsed duration, such as -24h, 30m, or 1h30m. Go duration units apply (ns, us/µs, ms, s, m, h); d is unsupported. |
add_days:N |
Integer calendar-day offset in UTC. |
add_months:N |
Integer calendar-month offset, clamped to the target month's final day. March 31 minus one month becomes February 28, or February 29 in a leap year. The UTC time of day is preserved. |
format:date |
YYYY-MM-DD string. |
format:datetime |
RFC 3339 UTC string. |
format:unix |
Integer Unix seconds. |
Chain at most four operations with |; put format last. Calendar offsets
are bounded to integers from -120000 to 120000, and results must remain within
years 0001 through 9999. The default output preserves the date/datetime kind.
UTC has no daylight-saving changes. Calendar arithmetic in other timezones, custom format strings,
.addDate(...), runtime.date, scripting, and general evaluation are unsupported.
Invalid syntax, unknown fields, invalid durations, and operations on null values
fail validation or execution. A whole-value reference preserves booleans, null,
and integer Unix seconds; interpolation produces text. Null cannot be interpolated.
Unknown namespaces, misspelled built-ins, unsupported metadata fields, and malformed expressions fail authoring validation. Sink metadata requires sink execution; incremental bounds require incremental source execution. Dynamic environment, input, and secret keys resolve against the selected context rather than a fixed built-in list. Missing keys fail before connector dispatch. Connector-defined checkpoint fields remain supported. A known null bound or absent previous success differs from an unknown parameter, which never becomes null or literal text.
Runtime fields use an entity namespace followed by a field name. The replacement
names are runtime.run.date, runtime.run.datetime, runtime.run.slug,
runtime.sink.idempotency_key, runtime.sink.idempotency_class,
runtime.sink.record_id, and runtime.sink.replay_identity. Flat run/sink names have no aliases for new
authoring. Historical inspection retains the exact executed definition.
One lookup selects the most recently finished successful attempt strictly before the new run starts, within the same organization, project, environment, pipeline, and exact immutable pipeline version. Equal completion times use the later stored run record to break ties. Failed, running, recovery replay, and backfill runs are excluded; successful retry attempts qualify. A new version starts with no prior success. The metadata does not attest to unchanged external data or mutable saved-operation definitions. Retention can remove otherwise qualifying history, which is treated as absent.
The selected run identity and timestamps are saved in the run timeline before connector dispatch. Concurrent successes cannot change that run's selection. A conflicting context for the same run identity fails before dispatch. Retries and sink recovery reuse the saved time and selection; their own lifecycle start/end timestamps still describe the new attempt. Legacy runs without retained context cannot be retried or recovered through this path: start a new run. No runtime input values or secrets are read from prior history. This lookup creates no trigger, dependency, or ordering between pipelines.
Do not quote {{name}} inside SQL or use it for table or column names. SQL
connectors bind it as a typed value. Other connectors substitute parameters only
in the fields documented by their connector guide. A missing required value or
a value that cannot be converted to its declared type stops the operation with
a validation or execution error.
Finite SQL file exports¶
PostgreSQL, MySQL, BigQuery and Snowflake query operations can set format: file
to export one complete JSON object containing column_names, rows, and row_count. Use a file output
contract and connect it directly to a native-file destination with format: file.
PostgreSQL and MySQL use a read-only repeatable-read transaction. BigQuery reads
bounded pages from one SELECT job. Snowflake reads one driver result under the
source account's grants; use a read-only role. Duplicate column names and multiple
result sets are refused. Row transforms cannot consume this file.
Streamed SQL files have no default row quota. Operators can set a positive
execution_limits.stream_max_rows; a positive saved-query row_limit also applies.
Materialized row results keep their separate max_result_rows protection.
Transfer-byte and response-byte limits must be positive. The response allowance bounds each row, metadata and BigQuery page; the
transfer allowance bounds the entire serialized object. Results are staged in encrypted
database chunks before destination writing, so storage grows with result size.
Cancellation or failure never publishes a partial result as successful, and an
uncertain destination write requires inspection before retrying. This operation
does not provide offset resume, CDC or exactly-once delivery.
SQL transforms¶
sql_v1 runs one SELECT over named, row-normalized inputs. It supports
projections, aliases, comparisons and boolean filters, IS NULL, grouped
aggregates, ORDER BY, literal LIMIT/OFFSET, non-recursive CTEs, and
JSON_OBJECT(...) or JSON_ARRAY(...) projection helpers.
It rejects writes, multiple statements, recursive CTEs, unsupported subqueries,
and expressions outside the validated subset. HAVING supports post-group
predicates over bounded groups and aggregates. Input aliases must match the
names under transform.inputs; derived projections should have explicit aliases.
Set output_kind to rows, json, or csv to control serialization. Local
validation reports unsupported syntax before the spec is committed. The
API reference defines the pipeline contract.
Test SQL with an offline fixture¶
Run the SQL with synthetic inputs before applying a mapping or deploying a
pipeline. Use a braidplane binary built from this checkout and put it on your
path before running these commands.
cd examples/pipelines/sql-fixture
braidplane pipeline mapping test \
--step map-products --file products.sql --fixture fixture.json \
--input-contract input-contract.json --output-contract output-contract.json
The command uses local files and needs no credentials, network or browser
session. It reports JSON on stdout and exits 0 on success. The sample renames
item_code to sku and converts price to an exact decimal. Run the same
command with --file products-missing-price.sql to see the required
unit_price regression. The command exits 1 and returns a diagnostic with the
step, code and failing field when available. Runtime, setup and assertion
failures omit sample values and output. Use only synthetic values, since
successful output appears on stdout and may be retained by your CI logs.
Name each fixture input after its SQL relation. Supply row inputs as arrays of
objects. With a JSON contract, use an object or an array of objects matching its
root shape. With a CSV contract, use a JSON string containing the CSV header and
rows. Pass inline or previously resolved shapes using the optional contract
flags. Use --input-contracts in place of --input-contract for a JSON object
keyed by relation name. That allows different input representations per
relation. Use --output-kind json or --output-kind csv to match the
transform when it does not emit rows.
The optional expected value asserts the entire serialized output. Object key
order is ignored, array order matters and numbers are compared exactly. For CSV,
supply the expected CSV as a JSON string. Without expected, the command shows
the output after running any supplied contract checks. Fixtures are limited to
1 MiB, at most 64 input relations and at most 1,000 rows per relation. A passing
fixture covers only the supplied inputs. Empty inputs exercise no row values.
In your project's Builder, open the transform's Field mapping workspace and choose
Edit mapping. Paste the contents of fixture.json into SQL fixture and
choose Test fixture. The preview uses the transform SQL and declared
contracts, or the current mapping draft and its available shapes while editing
fields. Exact catalog references use authorized contract metadata. Testing
keeps samples out of the pipeline draft and runs without provider access.
Contracts¶
To use a project catalog revision in place of an inline contract, see ODCS support and enforcement.
Contracts describe the payload crossing a step boundary. Declare an upstream
output_contract, a downstream input_contract, or both when you want both
sides documented and checked.
output_contract:
name: customers
representation: rows
fields:
- name: customer_id
type: string
required: true
validations:
min_length: 1
- name: created_at
type: datetime
nullable: true
Representations are rows, json, csv, file, and multipart_form.
Transforms support rows, json, and csv; multipart form is limited to HTTP
boundaries. Field types are string, integer, number, boolean, object,
array, datetime, and decimal.
Fields can set required, nullable, and description. A decimal field
requires precision from 1 to 38 and scale from 0 through
the precision; Braidplane rejects inexact values. Applicable validation rules
include enum, min, max, min_length, max_length, format (email,
uuid, or url), and unique. Validation rejects incompatible contracts
before a run starts.
Sink replay safety¶
Every sink declares what Braidplane may do when a write might have happened but the run did not finish cleanly. This matters after a timeout or worker crash: a retry could otherwise write the same records twice.
| Class | What it means on retry |
|---|---|
naturally_idempotent |
Repeating the exact write has the same visible result. A deterministic file overwrite or an upsert by a stable business key can qualify; a plain insert does not. |
idempotent_with_key |
Braidplane sends the same stable idempotency key again, and the provider guarantees that the repeated key does not create another effect. |
deduplicated_by_ledger |
Braidplane records the attempt before calling the provider. It skips a recorded success, but refuses to guess when an attempt is still in progress because the remote outcome is unknown. |
unsafe |
There is no repeat-safety guarantee. After an attempt starts, Braidplane refuses automatic retry and operator replay. |
The declaration does not make an operation safe by itself. Choose a class the
connector supports and that the specific operation actually satisfies. For
example, the S3 walkthrough uses naturally_idempotent because it overwrites a
deterministic object key. If a sink cannot be replayed safely, recover it
manually and verify the destination before starting another write.
Update HTTP records from rows¶
An HTTP sink normally sends its upstream payload in one request. Set
sink.config.record_updates to send one update per row to an existing record.
Use an inline PATCH or PUT operation with a fixed path ending in
/{{runtime.sink.record_id}}. The source column named by identity_field supplies the
destination's stable record ID as a string. The sink checks every ID before
the first write, rejects duplicates, and encodes each ID as one path segment.
IDs must be nonblank, at most 256 bytes, and free of surrounding whitespace.
The path segments . and .. are invalid.
The inventory pipeline example reads item IDs and labels with inline PostgreSQL. Its HTTP sink updates each item’s display name:
sink:
input: changed-items
data_source_ref: inventory-api
operation_type: http
idempotency_class: deduplicated_by_ledger
operation_inline:
type: http
method: PATCH
path: "/inventory/items/{{runtime.sink.record_id}}"
body: "{{input}}"
config:
record_updates:
identity_field: item_id
fields: {label: displayName}
max_records: 25
readback: {identity_field: recordID}
Each entry in fields maps a source column to a case-sensitive destination
field. Supply string values for every mapped field. Bind "{{input}}" as the
JSON body or place it under one field, such as {"attributes": "{{input}}"}.
Use PATCH for partial updates. Use PUT only when the mapped fields form the
complete representation the API requires for replacement. Assign each mapped
field to one authoritative writer.
A write response with HTTP 200 or 201 confirms delivery when its JSON matches
the requested state. A 204 response triggers one immediate GET of the same
record. GET must return HTTP 200 with matching JSON. A 202 response leaves
delivery uncertain. A fresh delivery makes at most two requests per row.
Missing, null or non-string fields cannot confirm a string value, including
an empty string. Set readback.identity_field to the top-level field
containing the record's string ID. Mapped fields are read from the top level
unless readback.fields_object names a nested object containing them. If the
API requires field selection on GET, set readback.select_parameter to the
query parameter that accepts comma-separated destination field names. The example above
expects a response like {"recordID": "r1", "displayName": "Alba"}.
Set max_records between 1 and 100. The sink accepts up to 100 field mappings,
caps the projected batch at 1 MiB and has a 60-second deadline. Bound the
source window to fit. An oversized batch fails before dispatch.
Use idempotency_class: deduplicated_by_ledger. Recovery skips confirmed
records and reads the destination for an uncertain write. A matching ID and
mapped values confirm delivery. A mismatch leaves the effect unresolved for
operator investigation. A later run has a new delivery identity and can update
the same record. An incremental source commits its checkpoint after all required
writes are confirmed.
Before the first write, the runner must retain every source and transform output needed for recovery. The complete repair checkpoint, including the pipeline and intermediate outputs, must fit within 10 MiB. Event-input runs and pipelines that resolve environment secrets cannot retain these repair inputs. Configure provider credentials on the data source.
Incremental query sources¶
An incremental query reads from the last successfully committed position instead of reading the full source every time. The checkpoint belongs to the deployed pipeline version and source step. Braidplane commits a new checkpoint only after all dependent sinks succeed, so a failed run reads the same window again.
An HTTP sink can require a terminal response before its dependent checkpoint advances.
For an endpoint that returns 204 on completion and 202 when queued, set
"acknowledgement": {"status_codes": [204], "success": []} on the HTTP operation.
Use checkpoint_kind: watermark for a comparable source value such as an
updated_at timestamp or increasing ID:
incremental:
checkpoint_kind: watermark
field: updated_at
lookback_window: 15m
ordering:
- updated_at
- id
dedupe_key: id
The source operation must use {{runtime.incremental.lower_bound.value}} in its
filter and return the configured field. Braidplane observes the greatest
returned value as the next checkpoint. A lookback_window moves the lower bound
back to include late records; that overlap can return records again, so use a
stable ordering and make the transform or sink tolerate repeats. dedupe_key
names the record identity available for that deduplication; it does not remove
duplicates by itself.
Use checkpoint_kind: cursor for an opaque continuation token from an API:
incremental:
checkpoint_kind: cursor
cursor: next_page_token
The operation accepts {{runtime.incremental.lower_bound.cursor}} and returns
the named next cursor. Braidplane stores the token without interpreting it.
Cursors cannot use a lookback window.
These concepts are distinct: a rolling window is a deliberate overlap around a
watermark, a prior timestamp is metadata about an earlier run, and an
incremental lower bound is the committed source checkpoint used to start the
next source read. For example, runtime.run.datetime | offset:-24h means a
rolling 24-hour window; runtime.previous_success.finished_at means when the
prior attempt finished; runtime.incremental.lower_bound.value means the last
committed data watermark, adjusted by lookback_window when configured. Extraction
can precede completion by minutes, so finished_at cannot replace a checkpoint.
On the first run there is no lower bound. Do not put an initial checkpoint in
the specification; checkpoint seeds and backfill ranges are runtime settings.
Only add incremental to a query step when its connector guide documents the
checkpoint kind. PostgreSQL, MySQL, BigQuery, Snowflake, and MongoDB support
watermarks; HTTP and HubSpot support cursors. FTP, Git, and S3 currently perform
full reads.
Validate before committing¶
braidplane pipeline format --file pipelines/customer-export.pipeline.yaml --format yaml
braidplane pipeline validate --local --file pipelines/customer-export.pipeline.yaml
The format command sends the complete file to the configured API and prints the formatted result to stdout; it does not edit the file. The formatter rejects extra YAML documents and JSON values. It requires pipeline read permission.
Local validation checks syntax, step ordering, references, operation types, contracts, transform SQL, and graph semantics without contacting Braidplane. After configuring a project and environment, server validation additionally checks bindings and cached connector schema:
braidplane pipeline validate \
--project '<project-slug>' \
--environment '<environment-slug>' \
--file pipelines/customer-export.pipeline.yaml
Use --output json or --output yaml for machine-readable results. A server
response includes structured diagnostics and exits nonzero when invalid. Local
success reports a file count; local failures and request errors remain on stderr.
The output option does not change what validation does.
Each pipeline file must contain one YAML document or JSON value. Formatting, validation, and Git reconciliation reject additional documents or values.
Start from the downloadable PostgreSQL-to-S3 specification for a complete query-transform-sink example.
Check readiness across environments¶
Open the project Overview to see which enabled environments are ready for the current pipelines. Each environment counts affected logical refs and bindings per pipeline and missing organization variable keys once across pipelines. Follow the links to configure a binding, set a variable, or inspect a pipeline’s readiness matrix. The runtime environments page contains the full binding inventory.
Open a pipeline and choose Readiness to compare its current configuration
across enabled environments. Expand a requirement to see where the pipeline
uses it. If the logical reference is missing, create it with
braidplane data-source-ref create. Follow Manage bindings to bind the
reference or change an unsuitable target. Use Compare runtime variables
to address a missing organization variable. If a query or sink uses
operation_ref, readiness looks up the saved operation on the data source
bound in each environment. Use Review saved operations to inspect that
source’s query library. A saved operation on the development source does
not satisfy a reference on a different production source. Inline operations
use the existing pipeline validation path.
A ready environment has passed the listed configuration checks. Use the run
history and inspect the destination to verify execution and output.
Run braidplane pipeline apply --project PROJECT --dry-run to preview the
readiness of the Git definitions before importing them. Omit --dry-run to
import them. In both reports, each assessed definition in synced includes
a readiness object with a status for each enabled environment. For example,
a pipeline can sync successfully while production reports missing_binding
for a data-source ref or missing_variable for an organization runtime
variable key. The diagnostic includes the next action and omits variable
values and credentials. Import failures appear in failures. If the service
cannot assess readiness, check the report's readiness_warning.
Use GET /api/organizations/{slug}/projects/{project_slug}/readiness to check the
current persisted pipelines in every enabled project environment. To check one
pipeline, use GET /api/organizations/{slug}/projects/{project_slug}/pipelines/{pipeline_slug}/readiness.
Both endpoints require read access to pipelines, environments and data sources.
Looking up saved operations also requires read access to queries.
Each blocked environment lists the affected pipeline, step, field path and
next action for each unmet requirement. Readiness checks logical refs, bindings,
source and sink suitability, saved-operation compatibility where contract metadata
is available, and effective organization runtime variable values without running
a connector. An empty project with enabled environments returns
informational. A project with no enabled environments returns warning.
Check for unused runtime configuration¶
On the project’s Environments page, choose Check unused refs and bindings to see which pipeline-owned logical refs and environment bindings its current specs no longer reference. On the organization’s runtime variable comparison, choose Check organization pipeline usage to identify unused keys. A definition can still require a value even when no pipeline references its key.
In a data source’s query library, Check pipeline usage checks the saved operations on the current page against organization pipelines and their environment bindings. The check uses current canonical specs. Older deployed versions can still use these items. These read-only checks report unknown usage when they cannot resolve the relevant specs or metadata. Cleanup findings are informational.
For an incident involving writes, pause and drain the pipeline in the affected environment before selecting a recovery.