KMP PHP API Reference

WorkflowInstance extends BaseEntity
in package

WorkflowInstance Entity

A running or completed workflow execution, pinned to a specific workflow version. Tracks execution state, context, and active nodes.

Table of Contents

Constants

ACTIVE_STATUSES  : mixed = [self::STATUS_RUNNING, self::STATUS_WAITING]
STATUS_CANCELLED  : mixed = 'cancelled'
STATUS_COMPLETED  : mixed = 'completed'
STATUS_FAILED  : mixed = 'failed'
STATUS_PENDING  : mixed = 'pending'
STATUS_RUNNING  : mixed = 'running'
STATUS_WAITING  : mixed = 'waiting'

Properties

$active_entity_key  : string|null
$active_nodes  : array<string|int, mixed>|null
$branch_id  : int|null
$completed_at  : DateTime|null
$context  : array<string|int, mixed>|null
$created  : DateTime|null
$entity_id  : int|null
$entity_type  : string|null
$error_info  : array<string|int, mixed>|null
$id  : int
$modified  : DateTime|null
$started_at  : DateTime|null
$started_by  : int|null
$status  : string
$workflow_approvals  : array<string|int, WorkflowApproval>
$workflow_definition  : WorkflowDefinition
$workflow_definition_id  : int
$workflow_execution_logs  : array<string|int, WorkflowExecutionLog>
$workflow_version  : WorkflowVersion
$workflow_version_id  : int
$_accessible  : array<string, bool>
Fields that can be mass assigned.

Methods

getBranchId()  : int|null
Get the branch ID for authorization checks.
isCompleted()  : bool
Check if the instance completed successfully.
isRunning()  : bool
Check if the instance is currently running.
isTerminal()  : bool
Check if the instance has reached a terminal state.
isWaiting()  : bool
Check if the instance is waiting for external input.

Constants

ACTIVE_STATUSES

public mixed ACTIVE_STATUSES = [self::STATUS_RUNNING, self::STATUS_WAITING]

Properties

$branch_id

public int|null $branch_id

Associated branch ID (when applicable)

$_accessible

Fields that can be mass assigned.

protected array<string, bool> $_accessible = ['workflow_definition_id' => true, 'workflow_version_id' => true, 'entity_type' => true, 'entity_id' => true, 'status' => true, 'context' => true, 'active_nodes' => true, 'error_info' => true, 'started_by' => true, 'started_at' => true, 'completed_at' => true]

Methods

getBranchId()

Get the branch ID for authorization checks.

public getBranchId() : int|null

Child classes should override for complex branch relationships.

Return values
int|null

The branch ID, or null if no association

isCompleted()

Check if the instance completed successfully.

public isCompleted() : bool
Return values
bool

isRunning()

Check if the instance is currently running.

public isRunning() : bool
Return values
bool

isTerminal()

Check if the instance has reached a terminal state.

public isTerminal() : bool
Return values
bool

isWaiting()

Check if the instance is waiting for external input.

public isWaiting() : bool
Return values
bool
On this page

Search results