Class: Temporalio::Client::WorkflowExecution

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

Overview

Info for a single workflow execution run.

Direct Known Subclasses

Description

Defined Under Namespace

Classes: Description

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_infoApi::Workflow::V1::WorkflowExecutionInfo (readonly)

Returns Underlying protobuf info.

Returns:



13
14
15
# File 'lib/temporalio/client/workflow_execution.rb', line 13

def raw_info
  @raw_info
end

Instance Method Details

#close_timeTime?

Returns When the workflow was closed if closed.

Returns:

  • (Time, nil)

    When the workflow was closed if closed.



22
23
24
# File 'lib/temporalio/client/workflow_execution.rb', line 22

def close_time
  @raw_info.close_time&.to_time
end

#execution_timeTime?

Returns When this workflow run started or should start.

Returns:

  • (Time, nil)

    When this workflow run started or should start.



27
28
29
# File 'lib/temporalio/client/workflow_execution.rb', line 27

def execution_time
  @raw_info.execution_time&.to_time
end

#history_lengthInteger

Returns Number of events in the history.

Returns:

  • (Integer)

    Number of events in the history.



32
33
34
# File 'lib/temporalio/client/workflow_execution.rb', line 32

def history_length
  @raw_info.history_length
end

#idString

Returns ID for the workflow.

Returns:

  • (String)

    ID for the workflow.



37
38
39
# File 'lib/temporalio/client/workflow_execution.rb', line 37

def id
  @raw_info.execution.workflow_id
end

#memoHash<String, Object>?

Returns Memo for the workflow.

Returns:

  • (Hash<String, Object>, nil)

    Memo for the workflow.



42
43
44
45
# File 'lib/temporalio/client/workflow_execution.rb', line 42

def memo
  @memo = Internal::ProtoUtils.memo_from_proto(@raw_info.memo, @data_converter) unless defined?(@memo)
  @memo
end

#parent_idString?

Returns ID for the parent workflow if this was started as a child.

Returns:

  • (String, nil)

    ID for the parent workflow if this was started as a child.



48
49
50
# File 'lib/temporalio/client/workflow_execution.rb', line 48

def parent_id
  @raw_info.parent_execution&.workflow_id
end

#parent_run_idString?

Returns Run ID for the parent workflow if this was started as a child.

Returns:

  • (String, nil)

    Run ID for the parent workflow if this was started as a child.



53
54
55
# File 'lib/temporalio/client/workflow_execution.rb', line 53

def parent_run_id
  @raw_info.parent_execution&.run_id
end

#run_idString

Returns Run ID for this workflow run.

Returns:

  • (String)

    Run ID for this workflow run.



58
59
60
# File 'lib/temporalio/client/workflow_execution.rb', line 58

def run_id
  @raw_info.execution.run_id
end

#search_attributesSearchAttributes?

Returns Current set of search attributes if any.

Returns:



63
64
65
66
67
68
# File 'lib/temporalio/client/workflow_execution.rb', line 63

def search_attributes
  unless defined?(@search_attributes)
    @search_attributes = SearchAttributes.from_proto(@raw_info.search_attributes)
  end
  @search_attributes
end

#start_timeTime

Returns When the workflow was created.

Returns:

  • (Time)

    When the workflow was created.



71
72
73
# File 'lib/temporalio/client/workflow_execution.rb', line 71

def start_time
  @raw_info.start_time.to_time
end

#statusWorkflowExecutionStatus

Returns Status for the workflow.

Returns:



76
77
78
# File 'lib/temporalio/client/workflow_execution.rb', line 76

def status
  Internal::ProtoUtils.enum_to_int(Api::Enums::V1::WorkflowExecutionStatus, @raw_info.status)
end

#task_queueString

Returns Task queue for the workflow.

Returns:

  • (String)

    Task queue for the workflow.



81
82
83
# File 'lib/temporalio/client/workflow_execution.rb', line 81

def task_queue
  @raw_info.task_queue
end

#workflow_typeString

Returns Type name for the workflow.

Returns:

  • (String)

    Type name for the workflow.



86
87
88
# File 'lib/temporalio/client/workflow_execution.rb', line 86

def workflow_type
  @raw_info.type.name
end