feat(wfe-core): add step config API for attaching runtime JSON config

Adds StepBuilder::config() to attach arbitrary JSON configuration to
individual steps, readable at runtime via context.step.step_config.
Bumps version to 1.6.1.
This commit is contained in:
2026-04-05 11:52:40 +01:00
parent 17a50d776b
commit 978109d3fc
3 changed files with 54 additions and 1 deletions

View File

@@ -43,6 +43,14 @@ impl<D: WorkflowData> StepBuilder<D> {
self
}
/// Attach arbitrary JSON configuration to this step.
///
/// The step can read it at runtime via `context.step.step_config`.
pub fn config(mut self, config: serde_json::Value) -> Self {
self.builder.steps[self.step_id].step_config = Some(config);
self
}
/// Add a compensation step for saga rollback.
pub fn compensate_with<C: StepBody + Default + 'static>(mut self) -> Self {
let comp_id = self.builder.add_step(std::any::type_name::<C>());