Class: Temporalio::WorkflowHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/workflow_history.rb

Overview

Representation of a workflow’s history.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventsObject (readonly)

History events for the workflow.



7
8
9
# File 'lib/temporalio/workflow_history.rb', line 7

def events
  @events
end

Instance Method Details

#workflow_idString

Returns ID of the workflow, extracted from the first event.

Returns:

  • (String)

    ID of the workflow, extracted from the first event.



15
16
17
18
19
20
# File 'lib/temporalio/workflow_history.rb', line 15

def workflow_id
  start = events.first&.workflow_execution_started_event_attributes
  raise 'First event not a start event' if start.nil?

  start.workflow_id
end