@solidxai/core-ui 0.1.13-beta.6 → 0.1.14-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/components/common/SolidPopupContainer.d.ts.map +1 -1
  2. package/dist/components/common/SolidPopupContainer.js +68 -5
  3. package/dist/components/common/SolidPopupContainer.js.map +1 -1
  4. package/dist/components/common/SolidPopupContainer.tsx +50 -4
  5. package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
  6. package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
  7. package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
  8. package/dist/components/core/card/SolidCardViewConfigure.tsx +3 -1
  9. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts +2 -0
  10. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts.map +1 -0
  11. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js +4 -0
  12. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js.map +1 -0
  13. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.ts +3 -0
  14. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts +8 -0
  15. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts.map +1 -0
  16. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js +9 -0
  17. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js.map +1 -0
  18. package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.ts +17 -0
  19. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  20. package/dist/components/core/form/SolidFormView.js +52 -22
  21. package/dist/components/core/form/SolidFormView.js.map +1 -1
  22. package/dist/components/core/form/SolidFormView.tsx +49 -9
  23. package/dist/components/core/kanban/SolidKanbanViewConfigure.d.ts.map +1 -1
  24. package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
  25. package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
  26. package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +3 -1
  27. package/dist/components/core/list/SolidCustomListViewColumn.d.ts +2 -1
  28. package/dist/components/core/list/SolidCustomListViewColumn.d.ts.map +1 -1
  29. package/dist/components/core/list/SolidCustomListViewColumn.js +3 -2
  30. package/dist/components/core/list/SolidCustomListViewColumn.js.map +1 -1
  31. package/dist/components/core/list/SolidCustomListViewColumn.tsx +4 -1
  32. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  33. package/dist/components/core/list/SolidListView.js +75 -71
  34. package/dist/components/core/list/SolidListView.js.map +1 -1
  35. package/dist/components/core/list/SolidListView.tsx +25 -10
  36. package/dist/components/core/list/SolidListViewColumn.d.ts +3 -1
  37. package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
  38. package/dist/components/core/list/SolidListViewColumn.js +81 -42
  39. package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
  40. package/dist/components/core/list/SolidListViewColumn.tsx +93 -44
  41. package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
  42. package/dist/components/core/list/SolidListViewConfigure.js +2 -2
  43. package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
  44. package/dist/components/core/list/SolidListViewConfigure.tsx +4 -2
  45. package/dist/components/core/list/widgets/PillWidget.d.ts +3 -0
  46. package/dist/components/core/list/widgets/PillWidget.d.ts.map +1 -0
  47. package/dist/components/core/list/widgets/PillWidget.js +95 -0
  48. package/dist/components/core/list/widgets/PillWidget.js.map +1 -0
  49. package/dist/components/core/list/widgets/PillWidget.tsx +127 -0
  50. package/dist/components/shad-cn-ui/SolidDialog.js +1 -1
  51. package/dist/components/shad-cn-ui/SolidDialog.js.map +1 -1
  52. package/dist/components/shad-cn-ui/SolidDialog.tsx +1 -1
  53. package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts +3 -1
  54. package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts.map +1 -1
  55. package/dist/components/shad-cn-ui/SolidDropdownMenu.js +2 -2
  56. package/dist/components/shad-cn-ui/SolidDropdownMenu.js.map +1 -1
  57. package/dist/components/shad-cn-ui/SolidDropdownMenu.tsx +11 -5
  58. package/dist/components/shad-cn-ui/SolidIcon.d.ts +2 -1
  59. package/dist/components/shad-cn-ui/SolidIcon.d.ts.map +1 -1
  60. package/dist/components/shad-cn-ui/SolidIcon.js +2 -1
  61. package/dist/components/shad-cn-ui/SolidIcon.js.map +1 -1
  62. package/dist/components/shad-cn-ui/SolidIcon.tsx +2 -0
  63. package/dist/components/workflow/WorkflowFlowCanvas.css +454 -0
  64. package/dist/components/workflow/WorkflowFlowCanvas.d.ts +40 -0
  65. package/dist/components/workflow/WorkflowFlowCanvas.d.ts.map +1 -0
  66. package/dist/components/workflow/WorkflowFlowCanvas.js +861 -0
  67. package/dist/components/workflow/WorkflowFlowCanvas.js.map +1 -0
  68. package/dist/components/workflow/WorkflowFlowCanvas.tsx +1522 -0
  69. package/dist/components/workflow/WorkflowNodeDocsPanel.css +247 -0
  70. package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts +22 -0
  71. package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts.map +1 -0
  72. package/dist/components/workflow/WorkflowNodeDocsPanel.js +97 -0
  73. package/dist/components/workflow/WorkflowNodeDocsPanel.js.map +1 -0
  74. package/dist/components/workflow/WorkflowNodeDocsPanel.tsx +363 -0
  75. package/dist/components/workflow/WorkflowNodeSchemaEditor.css +802 -0
  76. package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts +72 -0
  77. package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts.map +1 -0
  78. package/dist/components/workflow/WorkflowNodeSchemaEditor.js +1107 -0
  79. package/dist/components/workflow/WorkflowNodeSchemaEditor.js.map +1 -0
  80. package/dist/components/workflow/WorkflowNodeSchemaEditor.tsx +2347 -0
  81. package/dist/helpers/registry.d.ts.map +1 -1
  82. package/dist/helpers/registry.js +7 -0
  83. package/dist/helpers/registry.js.map +1 -1
  84. package/dist/helpers/registry.ts +8 -0
  85. package/dist/index.d.ts +6 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +5 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/index.ts +37 -0
  90. package/dist/redux/api/workflowDefinitionEditorApi.d.ts +17 -0
  91. package/dist/redux/api/workflowDefinitionEditorApi.d.ts.map +1 -0
  92. package/dist/redux/api/workflowDefinitionEditorApi.js +38 -0
  93. package/dist/redux/api/workflowDefinitionEditorApi.js.map +1 -0
  94. package/dist/redux/api/workflowDefinitionEditorApi.ts +40 -0
  95. package/dist/redux/api/workflowNodeApi.d.ts +6 -0
  96. package/dist/redux/api/workflowNodeApi.d.ts.map +1 -0
  97. package/dist/redux/api/workflowNodeApi.js +14 -0
  98. package/dist/redux/api/workflowNodeApi.js.map +1 -0
  99. package/dist/redux/api/workflowNodeApi.ts +18 -0
  100. package/dist/redux/features/popupSlice.d.ts +17 -2
  101. package/dist/redux/features/popupSlice.d.ts.map +1 -1
  102. package/dist/redux/features/popupSlice.js.map +1 -1
  103. package/dist/redux/features/popupSlice.ts +19 -3
  104. package/dist/redux/store/defaultStoreConfig.d.ts +13 -0
  105. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  106. package/dist/redux/store/defaultStoreConfig.js +4 -0
  107. package/dist/redux/store/defaultStoreConfig.js.map +1 -1
  108. package/dist/redux/store/defaultStoreConfig.ts +4 -0
  109. package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
  110. package/dist/redux/store/solidEntityApiPool.js +1 -0
  111. package/dist/redux/store/solidEntityApiPool.js.map +1 -1
  112. package/dist/redux/store/solidEntityApiPool.ts +1 -0
  113. package/dist/resources/solid-custom.css +16 -0
  114. package/dist/resources/solid-tailwind-generated.css +1 -1
  115. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.css +3194 -0
  116. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts +3 -0
  117. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts.map +1 -0
  118. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js +3371 -0
  119. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js.map +1 -0
  120. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.tsx +6215 -0
  121. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.css +217 -0
  122. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts +3 -0
  123. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts.map +1 -0
  124. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js +268 -0
  125. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js.map +1 -0
  126. package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.tsx +510 -0
  127. package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts +3 -0
  128. package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts.map +1 -0
  129. package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js +618 -0
  130. package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js.map +1 -0
  131. package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.tsx +1322 -0
  132. package/dist/routes/solidRoutes.d.ts.map +1 -1
  133. package/dist/routes/solidRoutes.js +6 -0
  134. package/dist/routes/solidRoutes.js.map +1 -1
  135. package/dist/routes/solidRoutes.tsx +6 -0
  136. package/dist/types/extension-registry.d.ts +4 -0
  137. package/dist/types/extension-registry.d.ts.map +1 -1
  138. package/dist/types/extension-registry.js +5 -1
  139. package/dist/types/extension-registry.js.map +1 -1
  140. package/dist/types/extension-registry.ts +5 -1
  141. package/dist/types/solid-core.d.ts +32 -0
  142. package/dist/types/workflow-node.d.ts +142 -0
  143. package/dist/types/workflow-node.d.ts.map +1 -0
  144. package/dist/types/workflow-node.js +2 -0
  145. package/dist/types/workflow-node.js.map +1 -0
  146. package/dist/types/workflow-node.ts +179 -0
  147. package/package.json +3 -1
@@ -0,0 +1,1322 @@
1
+ import { ArrowLeft, Braces, ChevronFirst, ChevronLast, ChevronLeft, ChevronRight, Layers3, Search, X } from "lucide-react";
2
+ import React from "react";
3
+ import { useNavigate, useParams } from "react-router-dom";
4
+ import qs from "qs";
5
+ import YAML from "yaml";
6
+ import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
7
+ import {
8
+ SolidButton,
9
+ SolidCodeEditor,
10
+ SolidInput,
11
+ SolidSelect,
12
+ SolidSpinner,
13
+ SolidTag,
14
+ } from "../../../../components/shad-cn-ui";
15
+ import "./WorkflowDefinitionEditorPage.css";
16
+
17
+ const WORKFLOW_LOG_LEVEL_OPTIONS = [
18
+ { label: "All levels", value: "all" },
19
+ { label: "Debug", value: "debug" },
20
+ { label: "Info", value: "info" },
21
+ { label: "Warn", value: "warn" },
22
+ { label: "Error", value: "error" },
23
+ ];
24
+
25
+ const WORKFLOW_EXECUTION_SUMMARY_FIELDS = [
26
+ "id",
27
+ "executionIdentifier",
28
+ "workflowKey",
29
+ "workflowDisplayName",
30
+ "status",
31
+ "triggerType",
32
+ "startedAt",
33
+ "finishedAt",
34
+ "durationMs",
35
+ "definitionVersion",
36
+ "definitionChecksum",
37
+ "errorSummary",
38
+ "requestedByUserId",
39
+ "createdAt",
40
+ ];
41
+
42
+ const WORKFLOW_EXECUTION_INPUT_FIELDS = ["id", "inputPayload"];
43
+ const WORKFLOW_EXECUTION_ERROR_FIELDS = ["id", "errorDetails"];
44
+ const WORKFLOW_EXECUTION_DEFINITION_FIELDS = ["id", "definitionSnapshot"];
45
+ const WORKFLOW_PAGE_SIZE_OPTIONS = [25, 50, 100, 200];
46
+
47
+ type WorkflowExecutionRecord = {
48
+ id: number;
49
+ executionIdentifier?: string | null;
50
+ workflowKey?: string | null;
51
+ workflowDisplayName?: string | null;
52
+ status?: string | null;
53
+ triggerType?: string | null;
54
+ startedAt?: string | null;
55
+ finishedAt?: string | null;
56
+ durationMs?: number | string | null;
57
+ inputPayload?: unknown;
58
+ outputPayload?: unknown;
59
+ definitionVersion?: string | null;
60
+ definitionChecksum?: string | null;
61
+ definitionSnapshot?: unknown;
62
+ errorSummary?: string | null;
63
+ errorDetails?: unknown;
64
+ requestedByUserId?: number | string | null;
65
+ createdAt?: string | null;
66
+ };
67
+
68
+ type WorkflowExecutionLogRecord = {
69
+ id: number;
70
+ logKey?: string | null;
71
+ level?: string | null;
72
+ message?: string | null;
73
+ eventType?: string | null;
74
+ source?: string | null;
75
+ nodeId?: string | null;
76
+ nodeType?: string | null;
77
+ sequenceNumber?: number | null;
78
+ occurredAt?: string | null;
79
+ context?: unknown;
80
+ metadata?: unknown;
81
+ createdAt?: string | null;
82
+ };
83
+
84
+ type WorkflowStepExecutionRecord = {
85
+ id: number;
86
+ stepExecutionKey?: string | null;
87
+ nodeId?: string | null;
88
+ nodeName?: string | null;
89
+ nodeKind?: string | null;
90
+ nodeType?: string | null;
91
+ status?: string | null;
92
+ attemptNumber?: number | null;
93
+ parentNodeId?: string | null;
94
+ parentStepExecutionKey?: string | null;
95
+ sequenceNumber?: number | null;
96
+ startedAt?: string | null;
97
+ finishedAt?: string | null;
98
+ durationMs?: number | string | null;
99
+ outputPayload?: unknown;
100
+ errorSummary?: string | null;
101
+ createdAt?: string | null;
102
+ };
103
+
104
+ type WorkflowPaginationMeta = {
105
+ totalRecords?: number;
106
+ currentPage?: number;
107
+ nextPage?: number | null;
108
+ prevPage?: number | null;
109
+ totalPages?: number;
110
+ perPage?: number;
111
+ };
112
+
113
+ type WorkflowExecutionOutputEntry = {
114
+ key: string;
115
+ label: string;
116
+ nodeId?: string;
117
+ nodeType?: string;
118
+ value: unknown;
119
+ };
120
+
121
+ type WorkflowPaginationState = {
122
+ offset: number;
123
+ limit: number;
124
+ };
125
+
126
+ function formatReadonlyJson(value: unknown, emptyValue = "{}") {
127
+ if (value === undefined || value === null || value === "") return emptyValue;
128
+ if (typeof value === "string") {
129
+ try {
130
+ return JSON.stringify(JSON.parse(value), null, 2);
131
+ } catch {
132
+ return value;
133
+ }
134
+ }
135
+ return JSON.stringify(value, null, 2);
136
+ }
137
+
138
+ function formatReadonlyYaml(value: unknown) {
139
+ if (value === undefined || value === null || value === "") return "";
140
+ if (typeof value === "string") return value;
141
+ return YAML.stringify(value);
142
+ }
143
+
144
+ function normalizeJsonDisplayValue(value: unknown) {
145
+ if (value === undefined || value === null || value === "") return null;
146
+ if (typeof value === "string") {
147
+ try {
148
+ return JSON.parse(value);
149
+ } catch {
150
+ return value;
151
+ }
152
+ }
153
+ return value;
154
+ }
155
+
156
+ function isPlainObjectValue(value: unknown): value is Record<string, unknown> {
157
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
158
+ }
159
+
160
+ function isUrlLike(value: string) {
161
+ return /^https?:\/\//i.test(value);
162
+ }
163
+
164
+ function formatOutputVisualValue(value: unknown) {
165
+ if (value === null || value === undefined) return "null";
166
+ if (typeof value === "boolean") return value ? "true" : "false";
167
+ if (typeof value === "string" || typeof value === "number") return String(value);
168
+ return JSON.stringify(value);
169
+ }
170
+
171
+ function summarizeOutputValue(value: unknown) {
172
+ const normalizedValue = normalizeJsonDisplayValue(value);
173
+ if (normalizedValue === null || normalizedValue === undefined) return "No output";
174
+ if (Array.isArray(normalizedValue)) return `${normalizedValue.length} item${normalizedValue.length === 1 ? "" : "s"}`;
175
+ if (isPlainObjectValue(normalizedValue)) {
176
+ const count = Object.keys(normalizedValue).length;
177
+ return `${count} field${count === 1 ? "" : "s"}`;
178
+ }
179
+ return String(formatOutputVisualValue(normalizedValue));
180
+ }
181
+
182
+ function formatExecutionDate(value?: string | null) {
183
+ if (!value) return "Not available";
184
+ const parsed = new Date(value);
185
+ if (Number.isNaN(parsed.getTime())) return "Not available";
186
+ return parsed.toLocaleString(undefined, {
187
+ year: "numeric",
188
+ month: "short",
189
+ day: "numeric",
190
+ hour: "numeric",
191
+ minute: "2-digit",
192
+ });
193
+ }
194
+
195
+ function formatExecutionLogTime(value?: string | null) {
196
+ if (!value) return "-";
197
+ const parsed = new Date(value);
198
+ if (Number.isNaN(parsed.getTime())) return "-";
199
+ return parsed.toLocaleTimeString(undefined, {
200
+ hour: "2-digit",
201
+ minute: "2-digit",
202
+ second: "2-digit",
203
+ });
204
+ }
205
+
206
+ function parseExecutionTimestamp(value?: string | null) {
207
+ if (!value) return null;
208
+ const parsed = new Date(value).getTime();
209
+ return Number.isFinite(parsed) ? parsed : null;
210
+ }
211
+
212
+ function getNumericDurationMs(value?: number | string | null) {
213
+ const numericValue =
214
+ typeof value === "string" ? Number(value) : typeof value === "number" ? value : null;
215
+ return typeof numericValue === "number" && Number.isFinite(numericValue) ? numericValue : null;
216
+ }
217
+
218
+ function formatDurationMs(value?: number | string | null) {
219
+ const numericValue = getNumericDurationMs(value);
220
+ if (numericValue == null || Number.isNaN(numericValue) || numericValue <= 0) return "Not available";
221
+ if (numericValue < 1000) return `${numericValue} ms`;
222
+ const seconds = numericValue / 1000;
223
+ if (seconds < 60) return `${seconds.toFixed(seconds >= 10 ? 0 : 1)} s`;
224
+ const minutes = Math.floor(seconds / 60);
225
+ const remainingSeconds = Math.round(seconds % 60);
226
+ return `${minutes}m ${remainingSeconds}s`;
227
+ }
228
+
229
+ function workflowLogLevelTone(level?: string | null) {
230
+ const value = (level ?? "").toLowerCase();
231
+ if (value === "error" || value === "fatal") return "danger";
232
+ if (value === "warn" || value === "warning") return "warn";
233
+ if (value === "info" || value === "success") return "success";
234
+ return undefined;
235
+ }
236
+
237
+ function buildWorkflowExecutionFieldsQueryString(fields: string[]) {
238
+ return qs.stringify({ fields }, { encodeValuesOnly: true });
239
+ }
240
+
241
+ function buildWorkflowExecutionLogQueryString(options: {
242
+ workflowExecutionId: number;
243
+ level?: string;
244
+ search?: string;
245
+ offset: number;
246
+ limit: number;
247
+ }) {
248
+ const queryData: Record<string, any> = {
249
+ limit: options.limit,
250
+ offset: options.offset,
251
+ fields: [
252
+ "id",
253
+ "logKey",
254
+ "level",
255
+ "message",
256
+ "eventType",
257
+ "source",
258
+ "nodeId",
259
+ "nodeType",
260
+ "sequenceNumber",
261
+ "occurredAt",
262
+ "context",
263
+ "metadata",
264
+ "createdAt",
265
+ ],
266
+ sort: ["sequenceNumber:asc", "occurredAt:asc", "id:asc"],
267
+ filters: {
268
+ workflowExecution: {
269
+ id: {
270
+ $eq: options.workflowExecutionId,
271
+ },
272
+ },
273
+ },
274
+ };
275
+
276
+ if (options.level && options.level !== "all") {
277
+ queryData.filters.level = {
278
+ $eqi: options.level,
279
+ };
280
+ }
281
+
282
+ const trimmedSearch = options.search?.trim();
283
+ if (trimmedSearch) {
284
+ queryData.filters.$or = [
285
+ { message: { $containsi: trimmedSearch } },
286
+ { nodeId: { $containsi: trimmedSearch } },
287
+ { nodeType: { $containsi: trimmedSearch } },
288
+ { source: { $containsi: trimmedSearch } },
289
+ { eventType: { $containsi: trimmedSearch } },
290
+ ];
291
+ }
292
+
293
+ return qs.stringify(queryData, { encodeValuesOnly: true });
294
+ }
295
+
296
+ function buildWorkflowStepExecutionQueryString(options: {
297
+ workflowExecutionId: number;
298
+ offset: number;
299
+ limit: number;
300
+ includeOutputPayload?: boolean;
301
+ }) {
302
+ const queryData: Record<string, any> = {
303
+ limit: options.limit,
304
+ offset: options.offset,
305
+ fields: [
306
+ "id",
307
+ "stepExecutionKey",
308
+ "nodeId",
309
+ "nodeName",
310
+ "nodeKind",
311
+ "nodeType",
312
+ "status",
313
+ "attemptNumber",
314
+ "parentNodeId",
315
+ "parentStepExecutionKey",
316
+ "sequenceNumber",
317
+ "startedAt",
318
+ "finishedAt",
319
+ "durationMs",
320
+ "errorSummary",
321
+ "createdAt",
322
+ ...(options.includeOutputPayload ? ["outputPayload"] : []),
323
+ ],
324
+ sort: ["startedAt:asc", "sequenceNumber:asc", "id:asc"],
325
+ filters: {
326
+ workflowExecution: {
327
+ id: {
328
+ $eq: options.workflowExecutionId,
329
+ },
330
+ },
331
+ ...(options.includeOutputPayload
332
+ ? {
333
+ outputPayload: {
334
+ $notNull: true,
335
+ },
336
+ }
337
+ : {}),
338
+ },
339
+ };
340
+
341
+ return qs.stringify(queryData, { encodeValuesOnly: true });
342
+ }
343
+
344
+ function buildExecutionOutputEntriesFromSteps(
345
+ steps: WorkflowStepExecutionRecord[],
346
+ ): WorkflowExecutionOutputEntry[] {
347
+ return steps
348
+ .filter((step) => normalizeJsonDisplayValue(step.outputPayload) !== null)
349
+ .map((step) => ({
350
+ key: String(step.id),
351
+ label: step.nodeName || step.nodeId || step.stepExecutionKey || `Step ${step.id}`,
352
+ nodeId: step.nodeId ?? undefined,
353
+ nodeType: step.nodeType ?? step.nodeKind ?? undefined,
354
+ value: step.outputPayload,
355
+ }));
356
+ }
357
+
358
+ function renderOutputPrimitive(value: unknown) {
359
+ if (typeof value === "string" && isUrlLike(value)) {
360
+ return (
361
+ <a href={value} target="_blank" rel="noreferrer">
362
+ {value}
363
+ </a>
364
+ );
365
+ }
366
+ return formatOutputVisualValue(value);
367
+ }
368
+
369
+ function renderOutputVisual(value: unknown, options: { hideSummary?: boolean } = {}): React.ReactNode {
370
+ const normalizedValue = normalizeJsonDisplayValue(value);
371
+
372
+ if (normalizedValue === null || normalizedValue === undefined) {
373
+ return (
374
+ <div className="workflow-editor-output-empty">
375
+ <h4>No output produced</h4>
376
+ <p>This execution completed without returning an output payload.</p>
377
+ </div>
378
+ );
379
+ }
380
+
381
+ if (!isPlainObjectValue(normalizedValue) && !Array.isArray(normalizedValue)) {
382
+ return (
383
+ <div className="workflow-editor-output-primitive">
384
+ <span>Result</span>
385
+ <strong>{renderOutputPrimitive(normalizedValue)}</strong>
386
+ </div>
387
+ );
388
+ }
389
+
390
+ if (Array.isArray(normalizedValue)) {
391
+ if (!normalizedValue.length) {
392
+ return (
393
+ <div className="workflow-editor-output-empty">
394
+ <h4>Empty array</h4>
395
+ <p>The execution returned an empty collection.</p>
396
+ </div>
397
+ );
398
+ }
399
+
400
+ const objectRows = normalizedValue.filter(isPlainObjectValue);
401
+ const tableKeys = Array.from(
402
+ new Set(
403
+ objectRows
404
+ .flatMap((item) => Object.keys(item))
405
+ .filter((key) =>
406
+ objectRows.some((item) => {
407
+ const cell = item[key];
408
+ return !isPlainObjectValue(cell) && !Array.isArray(cell);
409
+ }),
410
+ ),
411
+ ),
412
+ ).slice(0, 6);
413
+
414
+ if (objectRows.length === normalizedValue.length && tableKeys.length) {
415
+ return (
416
+ <div className="workflow-editor-output-visual">
417
+ {options.hideSummary ? null : (
418
+ <div className="workflow-editor-output-visual__summary">
419
+ <strong>{normalizedValue.length}</strong>
420
+ <span>items returned</span>
421
+ </div>
422
+ )}
423
+ <div className="workflow-editor-output-table-wrap">
424
+ <table className="workflow-editor-output-table">
425
+ <thead>
426
+ <tr>
427
+ {tableKeys.map((key) => (
428
+ <th key={key}>{key}</th>
429
+ ))}
430
+ </tr>
431
+ </thead>
432
+ <tbody>
433
+ {objectRows.slice(0, 25).map((item, index) => (
434
+ <tr key={index}>
435
+ {tableKeys.map((key) => (
436
+ <td key={key}>{renderOutputPrimitive(item[key])}</td>
437
+ ))}
438
+ </tr>
439
+ ))}
440
+ </tbody>
441
+ </table>
442
+ </div>
443
+ </div>
444
+ );
445
+ }
446
+
447
+ return (
448
+ <div className="workflow-editor-output-list">
449
+ {normalizedValue.slice(0, 25).map((item, index) => (
450
+ <div key={index} className="workflow-editor-output-list-item">
451
+ <span>Item {index + 1}</span>
452
+ <strong>{renderOutputPrimitive(item)}</strong>
453
+ </div>
454
+ ))}
455
+ </div>
456
+ );
457
+ }
458
+
459
+ const entries = isPlainObjectValue(normalizedValue) ? Object.entries(normalizedValue) : [];
460
+ return (
461
+ <div className="workflow-editor-output-object">
462
+ {options.hideSummary ? null : (
463
+ <div className="workflow-editor-output-visual__summary">
464
+ <strong>{entries.length}</strong>
465
+ <span>top-level fields</span>
466
+ </div>
467
+ )}
468
+ <div className="workflow-editor-output-object-grid">
469
+ {entries.map(([key, item]) => {
470
+ const isNested = isPlainObjectValue(item) || Array.isArray(item);
471
+ return (
472
+ <div key={key} className={`workflow-editor-output-field ${isNested ? "is-nested" : ""}`}>
473
+ <span>{key}</span>
474
+ {isNested ? <pre>{formatReadonlyJson(item)}</pre> : <strong>{renderOutputPrimitive(item)}</strong>}
475
+ </div>
476
+ );
477
+ })}
478
+ </div>
479
+ </div>
480
+ );
481
+ }
482
+
483
+ function WorkflowExecutionPagination({
484
+ meta,
485
+ pagination,
486
+ disabled,
487
+ onChange,
488
+ }: {
489
+ meta?: WorkflowPaginationMeta;
490
+ pagination: WorkflowPaginationState;
491
+ disabled?: boolean;
492
+ onChange: (pagination: WorkflowPaginationState) => void;
493
+ }) {
494
+ const totalRecords = meta?.totalRecords ?? 0;
495
+ const totalPages = meta?.totalPages ?? Math.max(1, Math.ceil(totalRecords / pagination.limit));
496
+ const currentPage = meta?.currentPage ?? Math.floor(pagination.offset / pagination.limit) + 1;
497
+ const firstRecord = totalRecords === 0 ? 0 : pagination.offset + 1;
498
+ const lastRecord = Math.min(pagination.offset + pagination.limit, totalRecords);
499
+ const canGoPrevious = currentPage > 1;
500
+ const canGoNext = currentPage < totalPages;
501
+
502
+ const goToPage = (page: number) => {
503
+ const safePage = Math.min(Math.max(page, 1), totalPages);
504
+ onChange({
505
+ offset: (safePage - 1) * pagination.limit,
506
+ limit: pagination.limit,
507
+ });
508
+ };
509
+
510
+ return (
511
+ <div className="workflow-editor-execution-pagination">
512
+ <div className="workflow-editor-execution-pagination__meta">
513
+ <span>Rows</span>
514
+ <SolidSelect
515
+ value={pagination.limit}
516
+ options={WORKFLOW_PAGE_SIZE_OPTIONS.map((option) => ({ label: String(option), value: option }))}
517
+ native={false}
518
+ menuPlacement="top"
519
+ disabled={disabled}
520
+ onChange={(event) => onChange({ offset: 0, limit: Number(event.value) })}
521
+ />
522
+ <span>{firstRecord} - {lastRecord} of {totalRecords}</span>
523
+ </div>
524
+ <div className="workflow-editor-execution-pagination__actions">
525
+ <SolidButton
526
+ size="small"
527
+ variant="ghost"
528
+ leftIcon={<ChevronFirst size={14} />}
529
+ aria-label="First page"
530
+ disabled={disabled || !canGoPrevious}
531
+ onClick={() => goToPage(1)}
532
+ />
533
+ <SolidButton
534
+ size="small"
535
+ variant="ghost"
536
+ leftIcon={<ChevronLeft size={14} />}
537
+ aria-label="Previous page"
538
+ disabled={disabled || !canGoPrevious}
539
+ onClick={() => goToPage(currentPage - 1)}
540
+ />
541
+ <span>Page {currentPage} of {totalPages}</span>
542
+ <SolidButton
543
+ size="small"
544
+ variant="ghost"
545
+ leftIcon={<ChevronRight size={14} />}
546
+ aria-label="Next page"
547
+ disabled={disabled || !canGoNext}
548
+ onClick={() => goToPage(currentPage + 1)}
549
+ />
550
+ <SolidButton
551
+ size="small"
552
+ variant="ghost"
553
+ leftIcon={<ChevronLast size={14} />}
554
+ aria-label="Last page"
555
+ disabled={disabled || !canGoNext}
556
+ onClick={() => goToPage(totalPages)}
557
+ />
558
+ </div>
559
+ </div>
560
+ );
561
+ }
562
+
563
+ export function WorkflowExecutionDetailPage() {
564
+ const params = useParams();
565
+ const navigate = useNavigate();
566
+ const executionId = params.id ?? "";
567
+
568
+ const workflowExecutionApi = React.useMemo(
569
+ () => createSolidEntityApi("workflowExecution"),
570
+ [],
571
+ );
572
+ const workflowExecutionLogApi = React.useMemo(
573
+ () => createSolidEntityApi("workflowExecutionLog"),
574
+ [],
575
+ );
576
+ const workflowStepExecutionApi = React.useMemo(
577
+ () => createSolidEntityApi("workflowStepExecution"),
578
+ [],
579
+ );
580
+ const { useGetSolidEntityByIdQuery, useLazyGetSolidEntityByIdQuery } = workflowExecutionApi;
581
+ const { useLazyGetSolidEntitiesQuery: useLazyGetWorkflowExecutionLogsQuery } =
582
+ workflowExecutionLogApi;
583
+ const { useLazyGetSolidEntitiesQuery: useLazyGetWorkflowStepExecutionsQuery } =
584
+ workflowStepExecutionApi;
585
+
586
+ const {
587
+ data: workflowExecutionResponse,
588
+ isLoading: isWorkflowExecutionLoading,
589
+ isError: isWorkflowExecutionError,
590
+ } = useGetSolidEntityByIdQuery(
591
+ {
592
+ id: executionId,
593
+ qs: buildWorkflowExecutionFieldsQueryString(WORKFLOW_EXECUTION_SUMMARY_FIELDS),
594
+ },
595
+ { skip: !executionId },
596
+ );
597
+ const [triggerGetWorkflowExecutionDetail, workflowExecutionDetailQuery] =
598
+ useLazyGetSolidEntityByIdQuery();
599
+ const [triggerGetWorkflowExecutionLogs, workflowExecutionLogsQuery] =
600
+ useLazyGetWorkflowExecutionLogsQuery();
601
+ const [triggerGetWorkflowStepExecutions, workflowStepExecutionsQuery] =
602
+ useLazyGetWorkflowStepExecutionsQuery();
603
+ const [triggerGetWorkflowOutputStepExecutions, workflowOutputStepExecutionsQuery] =
604
+ useLazyGetWorkflowStepExecutionsQuery();
605
+
606
+ const executionSummary = workflowExecutionResponse?.data as WorkflowExecutionRecord | undefined;
607
+ const executionDetail = workflowExecutionDetailQuery.data?.data as WorkflowExecutionRecord | undefined;
608
+ const execution = executionSummary
609
+ ? {
610
+ ...executionSummary,
611
+ ...executionDetail,
612
+ }
613
+ : undefined;
614
+ const [activeTab, setActiveTab] = React.useState("summary");
615
+ const [outputMode, setOutputMode] = React.useState<"visual" | "json">("visual");
616
+ const [expandedOutputKey, setExpandedOutputKey] = React.useState<string | null>(null);
617
+ const [logLevelFilter, setLogLevelFilter] = React.useState("all");
618
+ const [logSearch, setLogSearch] = React.useState("");
619
+ const [debouncedLogSearch, setDebouncedLogSearch] = React.useState("");
620
+ const [expandedLogId, setExpandedLogId] = React.useState<number | null>(null);
621
+ const [expandedTimelineStepId, setExpandedTimelineStepId] = React.useState<number | null>(null);
622
+ const [timelinePagination, setTimelinePagination] = React.useState<WorkflowPaginationState>({
623
+ offset: 0,
624
+ limit: 50,
625
+ });
626
+ const [logPagination, setLogPagination] = React.useState<WorkflowPaginationState>({
627
+ offset: 0,
628
+ limit: 100,
629
+ });
630
+ const [outputPagination, setOutputPagination] = React.useState<WorkflowPaginationState>({
631
+ offset: 0,
632
+ limit: 50,
633
+ });
634
+
635
+ React.useEffect(() => {
636
+ const timer = window.setTimeout(() => {
637
+ setDebouncedLogSearch(logSearch);
638
+ }, 300);
639
+
640
+ return () => window.clearTimeout(timer);
641
+ }, [logSearch]);
642
+
643
+ React.useEffect(() => {
644
+ setLogPagination((current) => ({ ...current, offset: 0 }));
645
+ }, [logLevelFilter, debouncedLogSearch]);
646
+
647
+ React.useEffect(() => {
648
+ if (!execution?.id || activeTab !== "timeline") return;
649
+ void triggerGetWorkflowStepExecutions(
650
+ buildWorkflowStepExecutionQueryString({
651
+ workflowExecutionId: execution.id,
652
+ offset: timelinePagination.offset,
653
+ limit: timelinePagination.limit,
654
+ }),
655
+ );
656
+ }, [activeTab, execution?.id, timelinePagination, triggerGetWorkflowStepExecutions]);
657
+
658
+ React.useEffect(() => {
659
+ if (!execution?.id || activeTab !== "logs") return;
660
+ void triggerGetWorkflowExecutionLogs(
661
+ buildWorkflowExecutionLogQueryString({
662
+ workflowExecutionId: execution.id,
663
+ level: logLevelFilter,
664
+ search: debouncedLogSearch,
665
+ offset: logPagination.offset,
666
+ limit: logPagination.limit,
667
+ }),
668
+ );
669
+ }, [activeTab, debouncedLogSearch, execution?.id, logLevelFilter, logPagination, triggerGetWorkflowExecutionLogs]);
670
+
671
+ React.useEffect(() => {
672
+ if (!execution?.id || activeTab !== "output") return;
673
+ void triggerGetWorkflowOutputStepExecutions(
674
+ buildWorkflowStepExecutionQueryString({
675
+ workflowExecutionId: execution.id,
676
+ offset: outputPagination.offset,
677
+ limit: outputPagination.limit,
678
+ includeOutputPayload: true,
679
+ }),
680
+ );
681
+ }, [activeTab, execution?.id, outputPagination, triggerGetWorkflowOutputStepExecutions]);
682
+
683
+ React.useEffect(() => {
684
+ if (!executionId) return;
685
+
686
+ if (activeTab === "input") {
687
+ void triggerGetWorkflowExecutionDetail({
688
+ id: executionId,
689
+ qs: buildWorkflowExecutionFieldsQueryString(WORKFLOW_EXECUTION_INPUT_FIELDS),
690
+ });
691
+ }
692
+
693
+ if (activeTab === "error") {
694
+ void triggerGetWorkflowExecutionDetail({
695
+ id: executionId,
696
+ qs: buildWorkflowExecutionFieldsQueryString(WORKFLOW_EXECUTION_ERROR_FIELDS),
697
+ });
698
+ }
699
+
700
+ if (activeTab === "definition") {
701
+ void triggerGetWorkflowExecutionDetail({
702
+ id: executionId,
703
+ qs: buildWorkflowExecutionFieldsQueryString(WORKFLOW_EXECUTION_DEFINITION_FIELDS),
704
+ });
705
+ }
706
+ }, [activeTab, executionId, triggerGetWorkflowExecutionDetail]);
707
+
708
+ const executionLogRecords = React.useMemo(
709
+ () => ((workflowExecutionLogsQuery.data?.records ?? []) as WorkflowExecutionLogRecord[]),
710
+ [workflowExecutionLogsQuery.data?.records],
711
+ );
712
+ const executionLogMeta = workflowExecutionLogsQuery.data?.meta as WorkflowPaginationMeta | undefined;
713
+ const executionStepRecords = React.useMemo(
714
+ () => ((workflowStepExecutionsQuery.data?.records ?? []) as WorkflowStepExecutionRecord[]),
715
+ [workflowStepExecutionsQuery.data?.records],
716
+ );
717
+ const executionStepMeta = workflowStepExecutionsQuery.data?.meta as WorkflowPaginationMeta | undefined;
718
+ const outputStepRecords = React.useMemo(
719
+ () => ((workflowOutputStepExecutionsQuery.data?.records ?? []) as WorkflowStepExecutionRecord[]),
720
+ [workflowOutputStepExecutionsQuery.data?.records],
721
+ );
722
+ const outputStepMeta = workflowOutputStepExecutionsQuery.data?.meta as WorkflowPaginationMeta | undefined;
723
+
724
+ const executionTimeline = React.useMemo(() => {
725
+ if (!execution) {
726
+ return {
727
+ rows: [],
728
+ totalDurationMs: 0,
729
+ startLabel: "-",
730
+ endLabel: "-",
731
+ slowestStep: null as WorkflowStepExecutionRecord | null,
732
+ statusCounts: {} as Record<string, number>,
733
+ };
734
+ }
735
+
736
+ const executionStart =
737
+ parseExecutionTimestamp(execution.startedAt) ??
738
+ parseExecutionTimestamp(execution.createdAt) ??
739
+ Date.now();
740
+ const executionFinish =
741
+ parseExecutionTimestamp(execution.finishedAt) ??
742
+ (getNumericDurationMs(execution.durationMs) != null
743
+ ? executionStart + (getNumericDurationMs(execution.durationMs) ?? 0)
744
+ : executionStart);
745
+ const sortedSteps = [...executionStepRecords].sort((first, second) => {
746
+ const firstSequence = first.sequenceNumber ?? first.id;
747
+ const secondSequence = second.sequenceNumber ?? second.id;
748
+ const firstStart = parseExecutionTimestamp(first.startedAt) ?? executionStart;
749
+ const secondStart = parseExecutionTimestamp(second.startedAt) ?? executionStart;
750
+ return firstStart - secondStart || firstSequence - secondSequence;
751
+ });
752
+ const normalizedSteps = sortedSteps.map((step) => {
753
+ const durationMs = getNumericDurationMs(step.durationMs) ?? 0;
754
+ const startedAt =
755
+ parseExecutionTimestamp(step.startedAt) ??
756
+ parseExecutionTimestamp(step.createdAt) ??
757
+ executionStart;
758
+ const finishedAt =
759
+ parseExecutionTimestamp(step.finishedAt) ??
760
+ (durationMs > 0 ? startedAt + durationMs : startedAt);
761
+ return {
762
+ step,
763
+ startedAt,
764
+ finishedAt: Math.max(finishedAt, startedAt),
765
+ durationMs: Math.max(durationMs, Math.max(finishedAt - startedAt, 0)),
766
+ };
767
+ });
768
+ const startMs = Math.min(executionStart, ...normalizedSteps.map((item) => item.startedAt));
769
+ const endMs = Math.max(
770
+ executionFinish,
771
+ ...normalizedSteps.map((item) => item.finishedAt),
772
+ startMs + 1,
773
+ );
774
+ const spanMs = Math.max(endMs - startMs, 1);
775
+ const statusCounts: Record<string, number> = {};
776
+ let slowestStep: WorkflowStepExecutionRecord | null = null;
777
+ let slowestDuration = -1;
778
+ const rows = normalizedSteps.map((item, index) => {
779
+ const status = (item.step.status ?? "unknown").toLowerCase();
780
+ statusCounts[status] = (statusCounts[status] ?? 0) + 1;
781
+ if (item.durationMs > slowestDuration) {
782
+ slowestDuration = item.durationMs;
783
+ slowestStep = item.step;
784
+ }
785
+ const width = Math.max((item.durationMs / spanMs) * 100, item.durationMs > 0 ? 1.2 : 0.55);
786
+ return {
787
+ ...item,
788
+ index,
789
+ label: item.step.nodeName || item.step.nodeId || item.step.stepExecutionKey || `Step ${index + 1}`,
790
+ startOffsetPercent: Math.min(Math.max(((item.startedAt - startMs) / spanMs) * 100, 0), 100),
791
+ widthPercent: Math.min(width, 100),
792
+ depth: item.step.parentStepExecutionKey || item.step.parentNodeId ? 1 : 0,
793
+ status,
794
+ };
795
+ });
796
+ return {
797
+ rows,
798
+ totalDurationMs: spanMs,
799
+ startLabel: formatExecutionLogTime(new Date(startMs).toISOString()),
800
+ endLabel: formatExecutionLogTime(new Date(endMs).toISOString()),
801
+ slowestStep,
802
+ statusCounts,
803
+ };
804
+ }, [execution, executionStepRecords]);
805
+
806
+ const outputEntries = React.useMemo(
807
+ () => buildExecutionOutputEntriesFromSteps(outputStepRecords),
808
+ [outputStepRecords],
809
+ );
810
+
811
+ const logLevelCounts = executionLogRecords.reduce<Record<string, number>>((counts, log) => {
812
+ const key = (log.level ?? "unknown").toLowerCase();
813
+ counts[key] = (counts[key] ?? 0) + 1;
814
+ return counts;
815
+ }, {});
816
+
817
+ if (isWorkflowExecutionLoading) {
818
+ return (
819
+ <div className="workflow-editor-page workflow-editor-page--loading">
820
+ <SolidSpinner />
821
+ </div>
822
+ );
823
+ }
824
+
825
+ if (isWorkflowExecutionError || !execution) {
826
+ return (
827
+ <div className="workflow-editor-page workflow-execution-detail-page">
828
+ <div className="workflow-editor-empty-state">Workflow execution not found.</div>
829
+ </div>
830
+ );
831
+ }
832
+
833
+ const tabs = [
834
+ { value: "summary", label: "Summary" },
835
+ { value: "timeline", label: "Timeline" },
836
+ { value: "logs", label: "Logs" },
837
+ { value: "input", label: "Input" },
838
+ { value: "output", label: "Output" },
839
+ { value: "error", label: "Error" },
840
+ { value: "definition", label: "Definition" },
841
+ ];
842
+
843
+ return (
844
+ <div className="workflow-editor-page workflow-execution-detail-page">
845
+ <div className="workflow-editor-header">
846
+ <div className="workflow-editor-header-main">
847
+ <SolidButton
848
+ size="small"
849
+ variant="ghost"
850
+ leftIcon={<ArrowLeft size={16} />}
851
+ onClick={() => navigate(-1)}
852
+ >
853
+ Back
854
+ </SolidButton>
855
+ </div>
856
+ </div>
857
+
858
+ <section className="workflow-editor-execution-modal workflow-execution-detail-page__surface">
859
+ <div className="workflow-editor-execution-modal__header">
860
+ <div>
861
+ <div className="workflow-editor-execution-modal__eyebrow">Execution Detail</div>
862
+ <h3>{execution.executionIdentifier ?? `Execution ${execution.id}`}</h3>
863
+ <div className="workflow-editor-execution-modal__meta">
864
+ <SolidTag>{execution.status ?? "Unknown"}</SolidTag>
865
+ <span>{formatDurationMs(execution.durationMs)}</span>
866
+ <span>{formatExecutionDate(execution.startedAt || execution.createdAt)}</span>
867
+ </div>
868
+ </div>
869
+ </div>
870
+
871
+ <div className="workflow-editor-execution-modal-tabs">
872
+ <div className="workflow-editor-execution-modal-tabs__list" role="tablist" aria-label="Execution detail sections">
873
+ {tabs.map((tab) => {
874
+ const isActive = activeTab === tab.value;
875
+ return (
876
+ <button
877
+ key={tab.value}
878
+ type="button"
879
+ role="tab"
880
+ aria-selected={isActive}
881
+ aria-controls={`workflow-execution-detail-tab-${tab.value}`}
882
+ id={`workflow-execution-detail-tab-trigger-${tab.value}`}
883
+ className={`workflow-editor-execution-modal-tabs__trigger ${isActive ? "is-active" : ""}`}
884
+ onClick={() => setActiveTab(tab.value)}
885
+ >
886
+ {tab.label}
887
+ </button>
888
+ );
889
+ })}
890
+ </div>
891
+
892
+ <div
893
+ role="tabpanel"
894
+ id={`workflow-execution-detail-tab-${activeTab}`}
895
+ aria-labelledby={`workflow-execution-detail-tab-trigger-${activeTab}`}
896
+ className="workflow-editor-execution-modal-tabs__panel"
897
+ >
898
+ {activeTab === "summary" ? (
899
+ <div className="workflow-editor-execution-detail-summary">
900
+ {[
901
+ ["Status", execution.status ?? "Unknown"],
902
+ ["Execution Identifier", execution.executionIdentifier ?? "-"],
903
+ ["Workflow", execution.workflowDisplayName ?? "-"],
904
+ ["Workflow Key", execution.workflowKey ?? "-"],
905
+ ["Trigger Type", execution.triggerType ?? "manual"],
906
+ ["Started", formatExecutionDate(execution.startedAt || execution.createdAt)],
907
+ ["Finished", formatExecutionDate(execution.finishedAt)],
908
+ ["Duration", formatDurationMs(execution.durationMs)],
909
+ ["Definition Version", execution.definitionVersion ?? "-"],
910
+ ["Definition Checksum", execution.definitionChecksum ?? "-"],
911
+ ["Requested By", execution.requestedByUserId ?? "-"],
912
+ ].map(([label, value]) => (
913
+ <div key={label} className="workflow-editor-execution-detail-kv">
914
+ <div className="workflow-editor-execution-detail-kv__label">{label}</div>
915
+ <div className="workflow-editor-execution-detail-kv__value">{value}</div>
916
+ </div>
917
+ ))}
918
+ </div>
919
+ ) : null}
920
+
921
+ {activeTab === "timeline" ? (
922
+ <div className="workflow-editor-execution-timeline">
923
+ <div className="workflow-editor-execution-timeline__hero">
924
+ <div>
925
+ <h4>Execution Timeline</h4>
926
+ <p>Step-level timing across this execution.</p>
927
+ </div>
928
+ <div className="workflow-editor-execution-timeline__stats">
929
+ <div>
930
+ <span>Total span</span>
931
+ <strong>{formatDurationMs(executionTimeline.totalDurationMs)}</strong>
932
+ </div>
933
+ <div>
934
+ <span>Steps</span>
935
+ <strong>{executionStepMeta?.totalRecords ?? executionTimeline.rows.length}</strong>
936
+ </div>
937
+ <div>
938
+ <span>Slowest</span>
939
+ <strong>{executionTimeline.slowestStep?.nodeName ?? executionTimeline.slowestStep?.nodeId ?? "-"}</strong>
940
+ </div>
941
+ </div>
942
+ </div>
943
+
944
+ {workflowStepExecutionsQuery.isFetching && !executionTimeline.rows.length ? (
945
+ <div className="workflow-editor-execution-timeline__loading">
946
+ <SolidSpinner />
947
+ <span>Loading step timeline...</span>
948
+ </div>
949
+ ) : executionTimeline.rows.length ? (
950
+ <>
951
+ <div className="workflow-editor-execution-timeline__legend">
952
+ {Object.entries(executionTimeline.statusCounts).map(([status, count]) => (
953
+ <SolidTag key={status} tone={workflowLogLevelTone(status) as any}>
954
+ {status}: {count}
955
+ </SolidTag>
956
+ ))}
957
+ </div>
958
+ <div className="workflow-editor-execution-gantt">
959
+ <div className="workflow-editor-execution-gantt__ruler">
960
+ <span>{executionTimeline.startLabel}</span>
961
+ <span>{formatDurationMs(executionTimeline.totalDurationMs)}</span>
962
+ <span>{executionTimeline.endLabel}</span>
963
+ </div>
964
+ <div className="workflow-editor-execution-gantt__rows">
965
+ {executionTimeline.rows.map((row) => {
966
+ const isExpanded = expandedTimelineStepId === row.step.id;
967
+ return (
968
+ <div key={row.step.id} className={`workflow-editor-execution-gantt-row workflow-editor-execution-gantt-row--${row.status} ${isExpanded ? "is-expanded" : ""}`}>
969
+ <button
970
+ type="button"
971
+ className="workflow-editor-execution-gantt-row__main"
972
+ aria-expanded={isExpanded}
973
+ onClick={() => setExpandedTimelineStepId((current) => current === row.step.id ? null : row.step.id)}
974
+ >
975
+ <span className="workflow-editor-execution-gantt-row__toggle"><ChevronRight size={14} /></span>
976
+ <span className="workflow-editor-execution-gantt-row__identity" style={{ "--workflow-step-depth": row.depth } as React.CSSProperties}>
977
+ <strong>{row.label}</strong>
978
+ <span>{row.step.nodeType ?? row.step.nodeKind ?? "step"}</span>
979
+ </span>
980
+ <span className="workflow-editor-execution-gantt-row__track">
981
+ <span className="workflow-editor-execution-gantt-row__bar" style={{ left: `${row.startOffsetPercent}%`, width: `${row.widthPercent}%` }} />
982
+ </span>
983
+ <SolidTag tone={workflowLogLevelTone(row.status) as any}>{row.step.status ?? "unknown"}</SolidTag>
984
+ <span className="workflow-editor-execution-gantt-row__duration">{formatDurationMs(row.durationMs)}</span>
985
+ </button>
986
+ {isExpanded ? (
987
+ <div className="workflow-editor-execution-gantt-row__details">
988
+ <div className="workflow-editor-execution-step-inspector">
989
+ <div className="workflow-editor-execution-step-inspector__header">
990
+ <div>
991
+ <span>Step Detail</span>
992
+ <h4>{row.label}</h4>
993
+ </div>
994
+ <button type="button" aria-label="Collapse step detail" onClick={() => setExpandedTimelineStepId(null)}>
995
+ <X size={14} />
996
+ </button>
997
+ </div>
998
+ <div className="workflow-editor-execution-step-inspector__meta">
999
+ {[
1000
+ ["Status", row.step.status ?? "unknown"],
1001
+ ["Node Id", row.step.nodeId ?? "-"],
1002
+ ["Node Type", row.step.nodeType ?? "-"],
1003
+ ["Attempt", row.step.attemptNumber ?? 1],
1004
+ ["Started", formatExecutionDate(row.step.startedAt)],
1005
+ ["Finished", formatExecutionDate(row.step.finishedAt)],
1006
+ ["Duration", formatDurationMs(row.durationMs)],
1007
+ ["Step Key", row.step.stepExecutionKey ?? "-"],
1008
+ ].map(([label, value]) => (
1009
+ <div key={label}>
1010
+ <span>{label}</span>
1011
+ <strong>{value}</strong>
1012
+ </div>
1013
+ ))}
1014
+ </div>
1015
+ {row.step.errorSummary ? (
1016
+ <div className="workflow-editor-execution-step-inspector__error">{row.step.errorSummary}</div>
1017
+ ) : null}
1018
+ </div>
1019
+ </div>
1020
+ ) : null}
1021
+ </div>
1022
+ );
1023
+ })}
1024
+ </div>
1025
+ </div>
1026
+ <WorkflowExecutionPagination
1027
+ meta={executionStepMeta}
1028
+ pagination={timelinePagination}
1029
+ disabled={workflowStepExecutionsQuery.isFetching}
1030
+ onChange={(nextPagination) => {
1031
+ setExpandedTimelineStepId(null);
1032
+ setTimelinePagination(nextPagination);
1033
+ }}
1034
+ />
1035
+ </>
1036
+ ) : (
1037
+ <div className="workflow-editor-execution-timeline__empty">
1038
+ <h4>No step timing captured</h4>
1039
+ <p>This execution does not have persisted step execution records yet.</p>
1040
+ </div>
1041
+ )}
1042
+ </div>
1043
+ ) : null}
1044
+
1045
+ {activeTab === "logs" ? (
1046
+ <div className="workflow-editor-execution-logs">
1047
+ <div className="workflow-editor-execution-logs__hero">
1048
+ <div>
1049
+ <h4>Execution Log Stream</h4>
1050
+ <p>Runtime messages emitted while this execution was processed.</p>
1051
+ </div>
1052
+ <div className="workflow-editor-execution-logs__stats">
1053
+ <span>
1054
+ {workflowExecutionLogsQuery.isFetching
1055
+ ? "Loading"
1056
+ : `${executionLogRecords.length} of ${executionLogMeta?.totalRecords ?? executionLogRecords.length} logs`}
1057
+ </span>
1058
+ {Object.entries(logLevelCounts).map(([level, count]) => (
1059
+ <SolidTag key={level} tone={workflowLogLevelTone(level) as any}>{level}: {count}</SolidTag>
1060
+ ))}
1061
+ </div>
1062
+ </div>
1063
+ <div className="workflow-editor-execution-logs__filters">
1064
+ <div className="workflow-editor-execution-logs__search">
1065
+ <Search size={14} />
1066
+ <SolidInput
1067
+ value={logSearch}
1068
+ placeholder="Search message, node, source"
1069
+ onChange={(event) => {
1070
+ setLogSearch(event.target.value);
1071
+ setExpandedLogId(null);
1072
+ }}
1073
+ />
1074
+ </div>
1075
+ <SolidSelect
1076
+ value={logLevelFilter}
1077
+ options={WORKFLOW_LOG_LEVEL_OPTIONS}
1078
+ onChange={(event) => {
1079
+ setLogLevelFilter(event.value ?? "all");
1080
+ setExpandedLogId(null);
1081
+ }}
1082
+ />
1083
+ </div>
1084
+ {workflowExecutionLogsQuery.isFetching && executionLogRecords.length ? (
1085
+ <div className="workflow-editor-execution-logs__refreshing">
1086
+ <SolidSpinner />
1087
+ <span>Refreshing logs...</span>
1088
+ </div>
1089
+ ) : null}
1090
+ {workflowExecutionLogsQuery.isFetching && !executionLogRecords.length ? (
1091
+ <div className="workflow-editor-execution-logs__loading">
1092
+ <SolidSpinner />
1093
+ <span>Loading execution logs...</span>
1094
+ </div>
1095
+ ) : executionLogRecords.length ? (
1096
+ <div className="workflow-editor-execution-log-list">
1097
+ {executionLogRecords.map((log) => {
1098
+ const isSelected = expandedLogId === log.id;
1099
+ return (
1100
+ <div key={log.id} className={`workflow-editor-execution-log-row workflow-editor-execution-log-row--${(log.level ?? "info").toLowerCase()} ${isSelected ? "is-selected" : ""}`}>
1101
+ <button
1102
+ type="button"
1103
+ className="workflow-editor-execution-log-row__main"
1104
+ aria-expanded={isSelected}
1105
+ onClick={() => setExpandedLogId((current) => current === log.id ? null : log.id)}
1106
+ >
1107
+ <span className="workflow-editor-execution-log-row__toggle"><ChevronRight size={14} /></span>
1108
+ <span className="workflow-editor-execution-log-row__sequence">{log.sequenceNumber ?? log.id}</span>
1109
+ <span className="workflow-editor-execution-log-row__time">{formatExecutionLogTime(log.occurredAt || log.createdAt)}</span>
1110
+ <SolidTag tone={workflowLogLevelTone(log.level) as any}>{log.level ?? "info"}</SolidTag>
1111
+ <span className="workflow-editor-execution-log-row__node">{log.nodeId ?? log.source ?? "runtime"}</span>
1112
+ <span className="workflow-editor-execution-log-row__message">{log.message ?? "No message"}</span>
1113
+ {log.eventType ? <span className="workflow-editor-execution-log-row__event">{log.eventType}</span> : null}
1114
+ </button>
1115
+ {isSelected ? (
1116
+ <div className="workflow-editor-execution-log-row__details">
1117
+ <div className="workflow-editor-execution-log-inspector">
1118
+ <div className="workflow-editor-execution-log-inspector__header">
1119
+ <div>
1120
+ <span>Log Detail</span>
1121
+ <h4>{log.message ?? "No message"}</h4>
1122
+ </div>
1123
+ <button type="button" aria-label="Collapse log detail" onClick={() => setExpandedLogId(null)}>
1124
+ <X size={14} />
1125
+ </button>
1126
+ </div>
1127
+ <div className="workflow-editor-execution-log-inspector__meta">
1128
+ {[
1129
+ ["Level", log.level ?? "info"],
1130
+ ["Sequence", log.sequenceNumber ?? log.id],
1131
+ ["Occurred", formatExecutionDate(log.occurredAt || log.createdAt)],
1132
+ ["Node", log.nodeId ?? "-"],
1133
+ ["Node Type", log.nodeType ?? "-"],
1134
+ ["Source", log.source ?? "-"],
1135
+ ["Event Type", log.eventType ?? "-"],
1136
+ ["Log Key", log.logKey ?? "-"],
1137
+ ].map(([label, value]) => (
1138
+ <div key={label}>
1139
+ <span>{label}</span>
1140
+ <strong>{value}</strong>
1141
+ </div>
1142
+ ))}
1143
+ </div>
1144
+ {log.context || log.metadata ? (
1145
+ <div className="workflow-editor-execution-log-inspector__payloads">
1146
+ <div>
1147
+ <h5>Context</h5>
1148
+ <SolidCodeEditor language="json" height="180px" fontSize={12} readOnly value={formatReadonlyJson(log.context)} />
1149
+ </div>
1150
+ <div>
1151
+ <h5>Metadata</h5>
1152
+ <SolidCodeEditor language="json" height="180px" fontSize={12} readOnly value={formatReadonlyJson(log.metadata)} />
1153
+ </div>
1154
+ </div>
1155
+ ) : (
1156
+ <div className="workflow-editor-execution-log-inspector__empty">
1157
+ No structured context or metadata was captured for this log.
1158
+ </div>
1159
+ )}
1160
+ </div>
1161
+ </div>
1162
+ ) : null}
1163
+ </div>
1164
+ );
1165
+ })}
1166
+ </div>
1167
+ ) : (
1168
+ <div className="workflow-editor-execution-logs__empty">
1169
+ <h4>No logs found</h4>
1170
+ <p>This execution has no log entries matching the current filters.</p>
1171
+ </div>
1172
+ )}
1173
+ <WorkflowExecutionPagination
1174
+ meta={executionLogMeta}
1175
+ pagination={logPagination}
1176
+ disabled={workflowExecutionLogsQuery.isFetching}
1177
+ onChange={(nextPagination) => {
1178
+ setExpandedLogId(null);
1179
+ setLogPagination(nextPagination);
1180
+ }}
1181
+ />
1182
+ </div>
1183
+ ) : null}
1184
+
1185
+ {activeTab === "input" ? (
1186
+ workflowExecutionDetailQuery.isFetching && execution.inputPayload === undefined ? (
1187
+ <div className="workflow-editor-execution-logs__loading">
1188
+ <SolidSpinner />
1189
+ <span>Loading execution input...</span>
1190
+ </div>
1191
+ ) : (
1192
+ <SolidCodeEditor language="json" height="calc(100vh - 260px)" fontSize={12} readOnly value={formatReadonlyJson(execution.inputPayload)} />
1193
+ )
1194
+ ) : null}
1195
+
1196
+ {activeTab === "output" ? (
1197
+ <div className="workflow-editor-output-viewer">
1198
+ <div className="workflow-editor-output-viewer__toolbar">
1199
+ <div>
1200
+ <h4>Execution Output</h4>
1201
+ <p>Inspect node outputs visually or switch to the raw JSON payload.</p>
1202
+ </div>
1203
+ <div className="workflow-editor-view-toggle" aria-label="Output view">
1204
+ <button type="button" className={`workflow-editor-view-toggle__button ${outputMode === "visual" ? "is-active" : ""}`} aria-label="Show visual output" title="Visual output" onClick={() => setOutputMode("visual")}>
1205
+ <Layers3 size={14} />
1206
+ </button>
1207
+ <button type="button" className={`workflow-editor-view-toggle__button ${outputMode === "json" ? "is-active" : ""}`} aria-label="Show JSON output" title="JSON output" onClick={() => setOutputMode("json")}>
1208
+ <Braces size={14} />
1209
+ </button>
1210
+ </div>
1211
+ </div>
1212
+ {workflowOutputStepExecutionsQuery.isFetching && !outputStepRecords.length ? (
1213
+ <div className="workflow-editor-execution-logs__loading">
1214
+ <SolidSpinner />
1215
+ <span>Loading step outputs...</span>
1216
+ </div>
1217
+ ) : outputMode === "json" ? (
1218
+ <div className="workflow-editor-output-json-editor">
1219
+ <SolidCodeEditor
1220
+ language="json"
1221
+ height="calc(100vh - 320px)"
1222
+ fontSize={12}
1223
+ readOnly
1224
+ value={formatReadonlyJson(
1225
+ outputStepRecords.map((step) => ({
1226
+ id: step.id,
1227
+ stepExecutionKey: step.stepExecutionKey,
1228
+ nodeId: step.nodeId,
1229
+ nodeName: step.nodeName,
1230
+ nodeType: step.nodeType,
1231
+ sequenceNumber: step.sequenceNumber,
1232
+ outputPayload: step.outputPayload,
1233
+ })),
1234
+ "[]",
1235
+ )}
1236
+ />
1237
+ </div>
1238
+ ) : outputEntries.length ? (
1239
+ <div className="workflow-editor-output-node-list">
1240
+ {outputEntries.map((entry, index) => {
1241
+ const isExpanded = expandedOutputKey === entry.key;
1242
+ return (
1243
+ <div key={entry.key} className={`workflow-editor-output-node-row ${isExpanded ? "is-expanded" : ""}`}>
1244
+ <button type="button" className="workflow-editor-output-node-row__header" aria-expanded={isExpanded} onClick={() => setExpandedOutputKey((current) => current === entry.key ? null : entry.key)}>
1245
+ <span className="workflow-editor-output-node-row__toggle"><ChevronRight size={15} /></span>
1246
+ <span className="workflow-editor-output-node-row__sequence">{index + 1}</span>
1247
+ <span className="workflow-editor-output-node-row__identity"><strong>{entry.label}</strong></span>
1248
+ <span className="workflow-editor-output-node-row__node-key">{entry.nodeId ?? entry.key}</span>
1249
+ {entry.nodeType ? <SolidTag>{entry.nodeType}</SolidTag> : null}
1250
+ <span className="workflow-editor-output-node-row__summary">{summarizeOutputValue(entry.value)}</span>
1251
+ </button>
1252
+ {isExpanded ? (
1253
+ <div className="workflow-editor-output-node-row__body">
1254
+ <div className="workflow-editor-output-node-detail">
1255
+ <div className="workflow-editor-output-node-detail__header">
1256
+ <div>
1257
+ <span>Output Detail</span>
1258
+ <h4>{entry.label}</h4>
1259
+ </div>
1260
+ <button type="button" aria-label="Collapse output detail" onClick={() => setExpandedOutputKey(null)}>
1261
+ <X size={14} />
1262
+ </button>
1263
+ </div>
1264
+ {renderOutputVisual(entry.value, { hideSummary: true })}
1265
+ </div>
1266
+ </div>
1267
+ ) : null}
1268
+ </div>
1269
+ );
1270
+ })}
1271
+ </div>
1272
+ ) : (
1273
+ <div className="workflow-editor-output-empty">
1274
+ <h4>No step outputs found</h4>
1275
+ <p>This page does not contain step output payloads.</p>
1276
+ </div>
1277
+ )}
1278
+ <WorkflowExecutionPagination
1279
+ meta={outputStepMeta}
1280
+ pagination={outputPagination}
1281
+ disabled={workflowOutputStepExecutionsQuery.isFetching}
1282
+ onChange={(nextPagination) => {
1283
+ setExpandedOutputKey(null);
1284
+ setOutputPagination(nextPagination);
1285
+ }}
1286
+ />
1287
+ </div>
1288
+ ) : null}
1289
+
1290
+ {activeTab === "error" ? (
1291
+ <div className="workflow-editor-execution-detail-error">
1292
+ <div className="workflow-editor-execution-detail-kv">
1293
+ <div className="workflow-editor-execution-detail-kv__label">Error Summary</div>
1294
+ <div className="workflow-editor-execution-detail-kv__value">{execution.errorSummary ?? "-"}</div>
1295
+ </div>
1296
+ {workflowExecutionDetailQuery.isFetching && execution.errorDetails === undefined ? (
1297
+ <div className="workflow-editor-execution-logs__loading">
1298
+ <SolidSpinner />
1299
+ <span>Loading error detail...</span>
1300
+ </div>
1301
+ ) : (
1302
+ <SolidCodeEditor language="json" height="calc(100vh - 320px)" fontSize={12} readOnly value={formatReadonlyJson(execution.errorDetails)} />
1303
+ )}
1304
+ </div>
1305
+ ) : null}
1306
+
1307
+ {activeTab === "definition" ? (
1308
+ workflowExecutionDetailQuery.isFetching && execution.definitionSnapshot === undefined ? (
1309
+ <div className="workflow-editor-execution-logs__loading">
1310
+ <SolidSpinner />
1311
+ <span>Loading definition snapshot...</span>
1312
+ </div>
1313
+ ) : (
1314
+ <SolidCodeEditor language="yaml" height="calc(100vh - 260px)" fontSize={12} readOnly value={formatReadonlyYaml(execution.definitionSnapshot)} />
1315
+ )
1316
+ ) : null}
1317
+ </div>
1318
+ </div>
1319
+ </section>
1320
+ </div>
1321
+ );
1322
+ }