ores.workflow.workflow_instance

Table of Contents

Tracks the lifecycle of a workflow execution, including its type, status, the serialised request that triggered it, and any result or error produced. Instances are append-mostly; status transitions are the primary mutation.

Flags

Primary key

UUID primary key for the workflow instance.

Natural keys

Columns

tenant_id

Tenant that owns this workflow instance.

type

Workflow type name, e.g. 'provision_parties_workflow'.

state_id

FK to the FSM state record (ores_workflow_fsm_states_tbl) for this instance.

request_json

Serialised JSON payload of the originating request.

result_json

Serialised JSON result, populated on successful completion.

error

Human-readable error message, populated on failure.

correlation_id

Distributed tracing correlation ID (Nats-Correlation-Id header value).

created_by

Username or service identity that initiated the workflow.

current_step_index

Zero-based index of the step currently being executed.

step_count

Total number of steps in this workflow definition.

materialised_steps_json

JSON snapshot of the step sequence built at instance start. Prevents a non-deterministic build_steps from reshaping an in-flight workflow after a service restart.

completed_at

Timestamp when the workflow reached a terminal state.

last_event_at

Timestamp of the most recent step-completed event processed.

SQL

Flags

C++

Flags

Repository

Domain includes

#include <chrono>
#include <optional>
#include <string>
#include <boost/uuid/uuid.hpp>

Conventions

Custom repository methods

See also

Emacs 29.1 (Org mode 9.6.6)