1010use Temporal \Workflow \ResetPointInfo as ResetPointInfoDto ;
1111
1212/**
13- * DTO that contains detailed information about Workflow Execution.
13+ * DTO that contains basic information about Workflow Execution.
1414 *
1515 * @see \Temporal\Api\Workflow\V1\WorkflowExecutionInfo
1616 * @psalm-immutable
1717 */
1818#[Immutable]
1919final class WorkflowExecutionInfo
2020{
21- /**
22- * @param array<ResetPointInfoDto> $autoResetPoints
23- */
2421 public function __construct (
2522 public readonly WorkflowExecution $ execution ,
2623 public readonly WorkflowType $ type ,
@@ -33,10 +30,70 @@ public function __construct(
3330 public readonly ?\DateTimeInterface $ executionTime ,
3431 public readonly EncodedCollection $ memo ,
3532 public readonly EncodedCollection $ searchAttributes ,
33+
34+ /**
35+ * @var array<ResetPointInfoDto>
36+ */
3637 public readonly array $ autoResetPoints ,
38+
39+ /**
40+ * @var non-empty-string
41+ */
3742 public readonly string $ taskQueue ,
43+
44+ /**
45+ * @var int<1, max>
46+ */
3847 public readonly int $ stateTransitionCount ,
48+
49+ /**
50+ * @var int<1, max>
51+ */
3952 public readonly int $ historySizeBytes ,
53+
54+ /**
55+ * If set, the most recent worker version stamp that appeared in a workflow task completion
56+ * @deprecated
57+ */
4058 public readonly ?WorkerVersionStamp $ mostRecentWorkerVersionStamp ,
59+
60+ /**
61+ * Workflow execution duration is defined as difference between close time and execution time.
62+ * This field is only populated if the workflow is closed.
63+ */
64+ public readonly ?\DateInterval $ executionDuration ,
65+
66+ /**
67+ * Contains information about the root workflow execution.
68+ *
69+ * The root workflow execution is defined as follows:
70+ * 1. A workflow without parent workflow is its own root workflow.
71+ * 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
72+ *
73+ * Note: workflows continued as new or reseted may or may not have parents, check examples below.
74+ *
75+ * Examples:
76+ * Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
77+ * - The root workflow of all three workflows is W1.
78+ * Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
79+ * - The root workflow of all three workflows is W1.
80+ * Scenario 3: Workflow W1 continued as new W2.
81+ * - The root workflow of W1 is W1 and the root workflow of W2 is W2.
82+ * Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
83+ * - The root workflow of all three workflows is W1.
84+ * Scenario 5: Workflow W1 is reseted, creating W2.
85+ * - The root workflow of W1 is W1 and the root workflow of W2 is W2.
86+ */
87+ public readonly ?WorkflowExecution $ rootExecution ,
88+
89+ /**
90+ * The first run ID in the execution chain.
91+ * Executions created via the following operations are considered to be in the same chain
92+ * - ContinueAsNew
93+ * - Workflow Retry
94+ * - Workflow Reset
95+ * - Cron Schedule
96+ */
97+ public readonly string $ firstRunId ,
4198 ) {}
4299}
0 commit comments