The LumeRun object is the central data structure in the Lume SDK. It represents a single execution of a Lume pipeline and holds all its associated state and results. An instance of this object is returned by lume.run() and lume.run_status().

Attributes

id

Type: str

The unique identifier for the run, prefixed with run_. This ID is used to query the run’s status and access its results.

Example: "run_01HYE5ZJ..."

status

Type: str

The current state of the run in its lifecycle. See the Run Lifecycle documentation for a full list of possible statuses.

Example: "TRANSFORMING"

metadata

Type: dict

A dictionary containing detailed results and metrics after a run completes. See the detailed Metadata Schema below for the full structure.

Methods

wait()

run.wait()

Blocks execution and polls the run’s status until it reaches a terminal state (SUCCEEDED, FAILED, PARTIAL_FAILED, or CRASHED). This method updates the LumeRun object in-place.

Note on Production Use: While wait() is convenient for scripts, for scalable, event-driven applications, we strongly recommend using Webhooks to receive notifications about run completion instead of polling.

Parameters

  • timeout (int, optional): The maximum number of seconds to wait. If the timeout is reached, a TimeoutError is raised. Defaults to 3600 (1 hour).
  • poll_interval (int, optional): The number of seconds to wait between status checks. Defaults to 5.

Returns

  • None

Example

run.wait(timeout=600, poll_interval=10)
print(f"Run finished with status: {run.status}")

refresh()

run.refresh()

Manually refreshes the LumeRun object in-place, updating its status and metadata with the latest information from the Lume server. This is equivalent to calling run = lume.run_status(run.id).

Parameters

  • None

Returns

  • None

Example

# Check status now
run.refresh()
print(f"Current status is: {run.status}")

Metadata Schema

The metadata attribute contains a rich, structured object detailing the outcome of a completed run.

Top-Level Structure

{
  "run": {},
  "pipeline": {},
  "results": {},
  "validation": {},
  "errors": []
}

run Object

Contains identifiers and high-level information about the run itself.

FieldTypeDescription
run_idstringThe unique identifier for this run.
flow_versionstringThe flow version that was executed.
source_pathstringThe unique source path that triggered this run.
statusstringThe terminal status of the run.

pipeline Object

Details the performance of each stage in the sync-transform-sync pipeline.

FieldTypeDescription
created_attimestampWhen the run was first accepted by the Lume API.
completed_attimestampWhen the run reached a terminal state.
duration_secondsfloatTotal time from created_at to completed_at.
stagesobjectTimings for each individual pipeline stage.

pipeline.stages Object

FieldTypeDescription
sync_source_secondsfloatTime spent syncing data from your source.
transform_secondsfloatTime spent executing the transformation logic.
sync_target_secondsfloatTime spent writing results to your target.

results Object

Summarizes the outcome of the data transformation.

FieldTypeDescription
input_rowsintegerTotal number of rows synced from the source.
mapped_rowsintegerNumber of rows successfully transformed.
rejected_rowsintegerNumber of rows that failed validation.
target_locationsobjectURIs pointing to the output locations.

results.target_locations Object

FieldTypeDescription
mappedstringThe path where mapped (successful) data was written.
rejectsstringThe path where rejected (failed) data was written.

validation Object

Provides a detailed summary of data quality test outcomes.

FieldTypeDescription
tests_executedintegerTotal number of validation tests performed.
tests_failedintegerTotal number of validation tests that failed.
error_ratefloatThe ratio of tests_failed to tests_executed.
top_errorsarrayAn array of objects summarizing the most common failures.

validation.top_errors Array Object

FieldTypeDescription
error_codestringA machine-readable code for the error.
fieldstringThe target field where the error occurred.
countintegerThe number of times this specific error occurred.

errors Array

This array is empty for SUCCEEDED or PARTIAL_FAILED runs. If the run FAILED, it contains objects detailing the cause.

FieldTypeDescription
stagestringThe pipeline stage where the failure occurred.
error_codestringA machine-readable code for the system error.
messagestringA human-readable description of the error.