pub struct BuiltGraph { /* private fields */ }Expand description
A graph that passed every build check, ready to run many times.
Cheap to clone and safe to share across tasks; in-memory checkpoints
are dropped after each run.
Implementations§
Source§impl BuiltGraph
impl BuiltGraph
Sourcepub fn trace_path(&self) -> Option<&Path>
pub fn trace_path(&self) -> Option<&Path>
Returns the trace file this graph writes, one root span per run.
None when tracing is off or goes to a custom sink.
The file is created at build.
Sourcepub async fn run(&self, input: impl Into<String>) -> Result<Value, KitError>
pub async fn run(&self, input: impl Into<String>) -> Result<Value, KitError>
Runs the graph once on input and returns the last node’s output.
Fails with Failed or Paused when the run ends without one.
Transient failures are retried by the graph engine.
Sourcepub async fn run_with(
&self,
input: impl Into<String>,
) -> Result<GraphReport, KitError>
pub async fn run_with( &self, input: impl Into<String>, ) -> Result<GraphReport, KitError>
Runs the graph once on input and returns the full report.
Same failures as run.
The run id in the report works with resume.
Sourcepub async fn resume(&self, run_id: RunId) -> Result<Value, KitError>
pub async fn resume(&self, run_id: RunId) -> Result<Value, KitError>
Continues graph run run_id from its latest checkpoint and returns
the last node’s output; a finished run returns it again. Needs
durable storage and a run this same workflow started.