setProperties
Append context discovered after a run starts without rewriting history.
Signature
run.setProperties(properties: WorkflowProperties): voidExample
const run = flowmark.workflow("invoice.import", {
properties: { batchId },
})
run.setProperties({ provider: "backup", sourceFormat: "csv" })Initial context belongs in workflow(name, { properties }). Use this marker
for facts discovered while the run is executing.
Merge behavior
Each call appends a context amendment event. The run's current properties use a shallow merge; when a top-level key repeats, the newest value wins. Nested objects are replaced, not deeply merged. Previous event history remains unchanged.
Step-local context instead belongs in
step(name, { properties }). A completed business
outcome belongs in done({ result }).
Bounds and lifecycle
Only bounded JSON-safe plain objects are supported; see data types and bounds. Invalid payloads are reported through instrumentation diagnostics. Amendments after completion request or terminal failure are ignored.