SDK reference
SDK reference

workflow and runId

Start a new execution under a stable workflow name.

Signature

flowmark.workflow(name: string, options?: WorkflowRunOptions): Flow

Each call immediately queues a start event and returns a run handle.

Example

const run = flowmark.workflow("invoice.import", {
  properties: { batchId },
  environment: "production",
  release: "2026.10.2",
})
console.log(run.runId)

Options

FieldTypeBehavior
idstringExecution ID; generated if omitted. Reuse it to continue this run
propertiesWorkflowPropertiesBounded context on the start event
environmentstringOverrides the client default
releasestringOverrides the client default
correlationIdstringExplicit grouping; nonblank, max 128 characters
parentRunIdstringParent's external run ID; nonblank, max 200 characters

Use stable names such as invoice.import; put instance IDs in properties. Reuse id across requests of the same execution. Do not reuse an order ID as the run ID across retries or later jobs.

Returned handle

Flow exposes runId, step, operation, progress, error, setProperties, done, and fail.

runId is the external SDK identifier, not the dashboard database UUID. Propagate it explicitly if you need parent links.

Errors and lifecycle

Invalid start context/configuration or a shut-down client can throw FlowmarkConfigError. Delivery errors after starting use instrumentation diagnostics. workflow() after shutdown is not supported. See delivery and diagnostics.

On this page