SDK reference
SDK reference

step

Record a meaningful milestone and optional checkpoint-local facts.

Signature

run.step(name: string, options?: WorkflowStepOptions): void

Example

const invoices = await loadInvoices(batchId)
run.step("source-loaded", {
  properties: { count: invoices.length },
})

loadInvoices is your application's helper. The marker records that your code reached this checkpoint. Use operation() when you need a measured duration.

Parameters

ParameterMeaning
nameStable semantic checkpoint name
options.propertiesOptional bounded JSON-safe facts attached to this step

Step properties belong to that event; they do not amend the run's current context. Use setProperties() for run-wide context.

When to use it

Choose checkpoints that help explain decisions or side effects: payment-captured, source-loaded, validation-finished. Do not add a step for every line of implementation code.

Use operation() when you need a measured duration. Steps after completion has been requested or the run has failed are ignored.

On this page