+
diff --git a/src/lib/models/__snapshots__/workflow-execution.test.ts.snap b/src/lib/models/__snapshots__/workflow-execution.test.ts.snap
index 5a6883206..6397028c8 100644
--- a/src/lib/models/__snapshots__/workflow-execution.test.ts.snap
+++ b/src/lib/models/__snapshots__/workflow-execution.test.ts.snap
@@ -6,6 +6,7 @@ exports[`toWorkflowExecution > should match the snapshot for Canceled workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:20:50.181506253Z",
"executionTime": "2022-07-01T20:20:50.157120545Z",
"historyEvents": "13",
@@ -41,6 +42,7 @@ exports[`toWorkflowExecution > should match the snapshot for Canceled workflows
"startTime": "2022-07-01T20:20:50.157120545Z",
"stateTransitionCount": "6",
"status": "Canceled",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.cancelled.workflow.id/346e7a24-c660-4f91-a777-ffe3274d8144",
}
@@ -52,6 +54,7 @@ exports[`toWorkflowExecution > should match the snapshot for Completed workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:28:52.916373379Z",
"executionTime": "2022-07-01T20:28:48.796369169Z",
"historyEvents": "18",
@@ -87,6 +90,7 @@ exports[`toWorkflowExecution > should match the snapshot for Completed workflows
"startTime": "2022-07-01T20:28:48.796369169Z",
"stateTransitionCount": "11",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/202dcff6-7f35-4c65-995c-bcadce524fb1",
}
@@ -98,6 +102,7 @@ exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:22:50.027441003Z",
"executionTime": "2022-07-01T20:22:50.015107253Z",
"historyEvents": "7",
@@ -126,6 +131,7 @@ exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`
"startTime": "2022-07-01T20:22:49.015107253Z",
"stateTransitionCount": "4",
"status": "Failed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.failed.workflow.id/7e00b341-c579-4bb5-9e28-810d34ef4329",
}
@@ -137,6 +143,7 @@ exports[`toWorkflowExecution > should match the snapshot for Running workflows 1
"callbacks": [],
"canBeTerminated": true,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": null,
"executionTime": "2022-07-01T20:23:49.104303753Z",
"historyEvents": "13",
@@ -198,6 +205,7 @@ exports[`toWorkflowExecution > should match the snapshot for Running workflows 1
"startTime": "2022-07-01T20:23:49.104303753Z",
"stateTransitionCount": "21",
"status": "Running",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.running.workflow.id/2a7ba421-f74b-4b8b-b9d8-e6e30e4caac7",
}
@@ -209,6 +217,7 @@ exports[`toWorkflowExecution > should match the snapshot for Terminated workflow
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.002030504Z",
"executionTime": "2022-07-01T20:14:48.911627544Z",
"historyEvents": "30",
@@ -275,6 +284,7 @@ exports[`toWorkflowExecution > should match the snapshot for Terminated workflow
"startTime": "2022-07-01T20:14:48.911627544Z",
"stateTransitionCount": "21",
"status": "Terminated",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/16c5fbe5-f82d-43c1-acbc-18c65c449ace",
}
@@ -286,6 +296,7 @@ exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T14:16:18.804308503Z",
"executionTime": "2022-07-01T13:56:18.803016378Z",
"historyEvents": "18",
@@ -327,6 +338,7 @@ exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows
"startTime": "2022-07-01T13:56:18.803016378Z",
"stateTransitionCount": "16",
"status": "TimedOut",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.timed-out.workflow.id/workflow.advanced-visibility/445a17cb-6cb4-4508-bc59-187d08c6c6e2",
}
@@ -339,6 +351,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:20:50.181506253Z",
"executionTime": "2022-07-01T20:20:50.157120545Z",
"historyEvents": "13",
@@ -371,6 +384,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:20:50.157120545Z",
"stateTransitionCount": "6",
"status": "Canceled",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.cancelled.workflow.id/346e7a24-c660-4f91-a777-ffe3274d8144",
},
@@ -379,6 +393,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:28:52.916373379Z",
"executionTime": "2022-07-01T20:28:48.796369169Z",
"historyEvents": "18",
@@ -411,6 +426,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:28:48.796369169Z",
"stateTransitionCount": "11",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/202dcff6-7f35-4c65-995c-bcadce524fb1",
},
@@ -419,6 +435,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:22:50.027441003Z",
"executionTime": "2022-07-01T20:22:50.015107253Z",
"historyEvents": "7",
@@ -447,6 +464,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:22:49.015107253Z",
"stateTransitionCount": "4",
"status": "Failed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.failed.workflow.id/7e00b341-c579-4bb5-9e28-810d34ef4329",
},
@@ -455,6 +473,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": true,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": null,
"executionTime": "2022-07-01T20:23:49.104303753Z",
"historyEvents": "19",
@@ -487,6 +506,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:23:49.104303753Z",
"stateTransitionCount": "27",
"status": "Running",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.running.workflow.id/2a7ba421-f74b-4b8b-b9d8-e6e30e4caac7",
},
@@ -495,6 +515,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.073853795Z",
"executionTime": "2022-07-01T20:14:51.002662504Z",
"historyEvents": "42",
@@ -527,6 +548,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:14:51.002662504Z",
"stateTransitionCount": "13",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/dfd4039d-4bc0-4864-9a24-85d136814977",
},
@@ -535,6 +557,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.002030504Z",
"executionTime": "2022-07-01T20:14:48.911627544Z",
"historyEvents": "30",
@@ -567,6 +590,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:14:48.911627544Z",
"stateTransitionCount": "21",
"status": "Terminated",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.terminated.workflow.id/16c5fbe5-f82d-43c1-acbc-18c65c449ace",
},
@@ -575,6 +599,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T14:16:18.804308503Z",
"executionTime": "2022-07-01T13:56:18.803016378Z",
"historyEvents": "18",
@@ -607,6 +632,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T13:56:18.803016378Z",
"stateTransitionCount": "16",
"status": "TimedOut",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.timed-out.workflow.id/445a17cb-6cb4-4508-bc59-187d08c6c6e2",
},
diff --git a/src/lib/models/__snapshots__/workflow-execution.write-disabled.test.ts.snap b/src/lib/models/__snapshots__/workflow-execution.write-disabled.test.ts.snap
index 0ce90f6b5..a718e1540 100644
--- a/src/lib/models/__snapshots__/workflow-execution.write-disabled.test.ts.snap
+++ b/src/lib/models/__snapshots__/workflow-execution.write-disabled.test.ts.snap
@@ -6,6 +6,7 @@ exports[`toWorkflowExecution > should match the snapshot for Canceled workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:20:50.181506253Z",
"executionTime": "2022-07-01T20:20:50.157120545Z",
"historyEvents": "13",
@@ -41,6 +42,7 @@ exports[`toWorkflowExecution > should match the snapshot for Canceled workflows
"startTime": "2022-07-01T20:20:50.157120545Z",
"stateTransitionCount": "6",
"status": "Canceled",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.cancelled.workflow.id/346e7a24-c660-4f91-a777-ffe3274d8144",
}
@@ -52,6 +54,7 @@ exports[`toWorkflowExecution > should match the snapshot for Completed workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:28:52.916373379Z",
"executionTime": "2022-07-01T20:28:48.796369169Z",
"historyEvents": "18",
@@ -87,6 +90,7 @@ exports[`toWorkflowExecution > should match the snapshot for Completed workflows
"startTime": "2022-07-01T20:28:48.796369169Z",
"stateTransitionCount": "11",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/202dcff6-7f35-4c65-995c-bcadce524fb1",
}
@@ -98,6 +102,7 @@ exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:22:50.027441003Z",
"executionTime": "2022-07-01T20:22:50.015107253Z",
"historyEvents": "7",
@@ -126,6 +131,7 @@ exports[`toWorkflowExecution > should match the snapshot for Failed workflows 1`
"startTime": "2022-07-01T20:22:49.015107253Z",
"stateTransitionCount": "4",
"status": "Failed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.failed.workflow.id/7e00b341-c579-4bb5-9e28-810d34ef4329",
}
@@ -137,6 +143,7 @@ exports[`toWorkflowExecution > should match the snapshot for Running workflows 1
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": null,
"executionTime": "2022-07-01T20:23:49.104303753Z",
"historyEvents": "13",
@@ -198,6 +205,7 @@ exports[`toWorkflowExecution > should match the snapshot for Running workflows 1
"startTime": "2022-07-01T20:23:49.104303753Z",
"stateTransitionCount": "21",
"status": "Running",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.running.workflow.id/2a7ba421-f74b-4b8b-b9d8-e6e30e4caac7",
}
@@ -209,6 +217,7 @@ exports[`toWorkflowExecution > should match the snapshot for Terminated workflow
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.002030504Z",
"executionTime": "2022-07-01T20:14:48.911627544Z",
"historyEvents": "30",
@@ -275,6 +284,7 @@ exports[`toWorkflowExecution > should match the snapshot for Terminated workflow
"startTime": "2022-07-01T20:14:48.911627544Z",
"stateTransitionCount": "21",
"status": "Terminated",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/16c5fbe5-f82d-43c1-acbc-18c65c449ace",
}
@@ -286,6 +296,7 @@ exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": "20s",
+ "details": undefined,
"endTime": "2022-07-01T14:16:18.804308503Z",
"executionTime": "2022-07-01T13:56:18.803016378Z",
"historyEvents": "18",
@@ -327,6 +338,7 @@ exports[`toWorkflowExecution > should match the snapshot for TimedOut workflows
"startTime": "2022-07-01T13:56:18.803016378Z",
"stateTransitionCount": "16",
"status": "TimedOut",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.timed-out.workflow.id/workflow.advanced-visibility/445a17cb-6cb4-4508-bc59-187d08c6c6e2",
}
@@ -339,6 +351,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:20:50.181506253Z",
"executionTime": "2022-07-01T20:20:50.157120545Z",
"historyEvents": "13",
@@ -371,6 +384,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:20:50.157120545Z",
"stateTransitionCount": "6",
"status": "Canceled",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.cancelled.workflow.id/346e7a24-c660-4f91-a777-ffe3274d8144",
},
@@ -379,6 +393,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:28:52.916373379Z",
"executionTime": "2022-07-01T20:28:48.796369169Z",
"historyEvents": "18",
@@ -411,6 +426,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:28:48.796369169Z",
"stateTransitionCount": "11",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/202dcff6-7f35-4c65-995c-bcadce524fb1",
},
@@ -419,6 +435,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:22:50.027441003Z",
"executionTime": "2022-07-01T20:22:50.015107253Z",
"historyEvents": "7",
@@ -447,6 +464,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:22:49.015107253Z",
"stateTransitionCount": "4",
"status": "Failed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.failed.workflow.id/7e00b341-c579-4bb5-9e28-810d34ef4329",
},
@@ -455,6 +473,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": null,
"executionTime": "2022-07-01T20:23:49.104303753Z",
"historyEvents": "19",
@@ -487,6 +506,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:23:49.104303753Z",
"stateTransitionCount": "27",
"status": "Running",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.running.workflow.id/2a7ba421-f74b-4b8b-b9d8-e6e30e4caac7",
},
@@ -495,6 +515,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.073853795Z",
"executionTime": "2022-07-01T20:14:51.002662504Z",
"historyEvents": "42",
@@ -527,6 +548,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:14:51.002662504Z",
"stateTransitionCount": "13",
"status": "Completed",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.completed.workflow.id/dfd4039d-4bc0-4864-9a24-85d136814977",
},
@@ -535,6 +557,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T20:14:51.002030504Z",
"executionTime": "2022-07-01T20:14:48.911627544Z",
"historyEvents": "30",
@@ -567,6 +590,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T20:14:48.911627544Z",
"stateTransitionCount": "21",
"status": "Terminated",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.terminated.workflow.id/16c5fbe5-f82d-43c1-acbc-18c65c449ace",
},
@@ -575,6 +599,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"callbacks": [],
"canBeTerminated": false,
"defaultWorkflowTaskTimeout": undefined,
+ "details": undefined,
"endTime": "2022-07-01T14:16:18.804308503Z",
"executionTime": "2022-07-01T13:56:18.803016378Z",
"historyEvents": "18",
@@ -607,6 +632,7 @@ exports[`toWorkflowExecutions > should match the snapshot 1`] = `
"startTime": "2022-07-01T13:56:18.803016378Z",
"stateTransitionCount": "16",
"status": "TimedOut",
+ "summary": undefined,
"taskQueue": "canary-task-queue",
"url": "/workflows/temporal.fixture.timed-out.workflow.id/445a17cb-6cb4-4508-bc59-187d08c6c6e2",
},
diff --git a/src/lib/models/workflow-execution.ts b/src/lib/models/workflow-execution.ts
index 020dab70f..ecbe1846c 100644
--- a/src/lib/models/workflow-execution.ts
+++ b/src/lib/models/workflow-execution.ts
@@ -117,6 +117,13 @@ export const toWorkflowExecution = (
const pendingWorkflowTask = response?.pendingWorkflowTask;
const callbacks = toCallbacks(response?.callbacks);
+ let summary;
+ let details;
+ if (response?.executionConfig?.userMetadata) {
+ summary = response?.executionConfig?.userMetadata?.summary;
+ details = response?.executionConfig?.userMetadata?.details;
+ }
+
return {
name,
id,
@@ -138,6 +145,8 @@ export const toWorkflowExecution = (
pendingNexusOperations,
pendingWorkflowTask,
callbacks,
+ summary,
+ details,
parentNamespaceId,
parent,
stateTransitionCount,
diff --git a/src/lib/pages/start-workflow.svelte b/src/lib/pages/start-workflow.svelte
index 0b8034f79..02f0daf12 100644
--- a/src/lib/pages/start-workflow.svelte
+++ b/src/lib/pages/start-workflow.svelte
@@ -12,8 +12,13 @@
import AddSearchAttributes from '$lib/components/workflow/add-search-attributes.svelte';
import Alert from '$lib/holocene/alert.svelte';
import Button from '$lib/holocene/button.svelte';
+ import Card from '$lib/holocene/card.svelte';
+ import Icon from '$lib/holocene/icon/icon.svelte';
import Input from '$lib/holocene/input/input.svelte';
+ import Label from '$lib/holocene/label.svelte';
import Link from '$lib/holocene/link.svelte';
+ import Editor from '$lib/holocene/monaco/editor.svelte';
+ import Tooltip from '$lib/holocene/tooltip.svelte';
import { translate } from '$lib/i18n/translate';
import { getPollers } from '$lib/services/pollers-service';
import {
@@ -41,6 +46,8 @@
let taskQueue = '';
let workflowType = '';
let input = '';
+ let summary = '';
+ let details = '';
let encoding: Writable
= writable('json/plain');
let inputRetrieved = 0;
@@ -76,6 +83,8 @@
taskQueue,
workflowType,
input,
+ summary,
+ details,
encoding: $encoding,
searchAttributes,
});
@@ -124,6 +133,9 @@
});
input = initialValues.input;
inputRetrieved = Date.now();
+ summary = initialValues.summary;
+ details = initialValues.details;
+
if (initialValues?.searchAttributes) {
const customSAKeys = Object.keys($customSearchAttributes);
Object.entries(initialValues.searchAttributes).forEach(([key, value]) => {
@@ -134,6 +146,13 @@
];
}
});
+ }
+
+ if (
+ initialValues?.searchAttributes?.length ||
+ initialValues?.summary ||
+ initialValues?.details
+ ) {
viewAdvancedOptions = true;
}
};
@@ -244,6 +263,32 @@
{/key}
{#if viewAdvancedOptions}
+
+
+
{translate('workflows.user-metadata')}
+
+ {translate('workflows.markdown-supported')}
+
+
+
+
+
+ (summary = event.detail.value)}
+ class="min-h-48"
+ />
+
+ (details = event.detail.value)}
+ />
+
{/if}
diff --git a/src/lib/pages/workflow-metadata.svelte b/src/lib/pages/workflow-metadata.svelte
index 7b692e371..047038ab3 100644
--- a/src/lib/pages/workflow-metadata.svelte
+++ b/src/lib/pages/workflow-metadata.svelte
@@ -13,7 +13,6 @@
{translate('events.attribute-group.search-attributes')}
-
{translate('common.memo')}
-
{
+ return query?.name !== '__stack_trace';
},
- $page.data?.settings,
- $authUser?.accessToken,
- ).then((queryTypes) => {
- queryType = queryType || queryTypes[0]?.name;
- query(queryType);
- return queryTypes;
- });
+ );
+
+ $: queryType = queryType || queryTypes?.[0]?.name;
let queryResult: Promise;
let encodePayloadResult: Promise;
@@ -89,12 +82,18 @@
- {#await queryTypes}
+ {#if metadataError}
+
+ {:else if !queryTypes.length}
{translate('workflows.no-workers-failure-message')}
- {:then types}
+ {:else}
@@ -155,11 +154,5 @@
{/await}
- {:catch _error}
-
- {/await}
+ {/if}
diff --git a/src/lib/services/query-service.ts b/src/lib/services/query-service.ts
index 1be933fd2..3fe569f28 100644
--- a/src/lib/services/query-service.ts
+++ b/src/lib/services/query-service.ts
@@ -1,6 +1,7 @@
import type { Payloads } from '$lib/types';
import type { WorkflowQueryRouteParameters } from '$lib/types/api';
import type { Eventual, Settings } from '$lib/types/global';
+import type { WorkflowMetadata } from '$lib/types/workflows';
import { convertPayloadToJsonWithCodec } from '$lib/utilities/decode-payload';
import { getQueryTypesFromError } from '$lib/utilities/get-query-types-from-error';
import { has } from '$lib/utilities/has';
@@ -53,12 +54,7 @@ const formatParameters = async (
async function fetchQuery(
{ workflow, namespace, queryType, queryArgs }: QueryRequestParameters,
- request = fetch,
- onError?: (error: {
- status: number;
- statusText: string;
- body: unknown;
- }) => void,
+ signal?: AbortSignal,
): Promise {
workflow = await workflow;
const parameters = await formatParameters(namespace, workflow, queryType);
@@ -77,32 +73,39 @@ async function fetchQuery(
queryArgs,
},
}),
+ signal,
},
- request,
- onError,
+ request: fetch,
notifyOnError: false,
});
}
-export async function getQueryTypes(
+export async function getWorkflowMetadata(
options: WorkflowParameters,
settings: Settings,
accessToken: string,
-): Promise<{ name: string; description?: string }[]> {
+ signal?: AbortSignal,
+): Promise {
try {
- const result = await getQuery(
+ const metadata = await getQuery(
{ ...options, queryType: '__temporal_workflow_metadata' },
settings,
accessToken,
+ signal,
);
- return result?.definition?.queryDefinitions?.filter((query) => {
- return query?.name !== '__stack_trace';
- });
+ return metadata;
} catch (e) {
if (e.message?.includes('__temporal_workflow_metadata')) {
- return getQueryTypesFromError(e.message);
+ const queryDefinitions = getQueryTypesFromError(e.message);
+ return {
+ definition: {
+ queryDefinitions,
+ },
+ };
} else {
- throw e;
+ return {
+ error: e,
+ };
}
}
}
@@ -111,9 +114,9 @@ export async function getQuery(
options: QueryRequestParameters,
settings: Settings,
accessToken: string,
- request = fetch,
+ signal?: AbortSignal,
): Promise {
- return fetchQuery(options, request).then(async (execution) => {
+ return fetchQuery(options, signal).then(async (execution) => {
const { queryResult } = execution ?? { queryResult: { payloads: [] } };
let data: ParsedQuery = queryResult.payloads;
diff --git a/src/lib/services/workflow-service.ts b/src/lib/services/workflow-service.ts
index af748b4dd..d961216a7 100644
--- a/src/lib/services/workflow-service.ts
+++ b/src/lib/services/workflow-service.ts
@@ -4,6 +4,7 @@ import { v4 } from 'uuid';
import { page } from '$app/stores';
+import type { PayloadInputEncoding } from '$lib/components/payload-input-with-encoding.svelte';
import { Action } from '$lib/models/workflow-actions';
import {
toWorkflowExecution,
@@ -37,6 +38,7 @@ import type {
} from '$lib/types/workflows';
import {
cloneAllPotentialPayloadsWithCodec,
+ decodeSingleReadablePayloadWithCodec,
type PotentiallyDecodable,
} from '$lib/utilities/decode-payload';
import {
@@ -82,7 +84,7 @@ type SignalWorkflowOptions = {
workflow: WorkflowExecution;
name: string;
input: string;
- encoding: string;
+ encoding: PayloadInputEncoding;
};
type StartWorkflowOptions = {
@@ -91,7 +93,9 @@ type StartWorkflowOptions = {
taskQueue: string;
workflowType: string;
input: string;
- encoding: string;
+ encoding: PayloadInputEncoding;
+ summary: string;
+ details: string;
searchAttributes: SearchAttributeInput[];
};
@@ -498,6 +502,8 @@ export async function startWorkflow({
taskQueue,
workflowType,
input,
+ summary,
+ details,
encoding,
searchAttributes,
}: StartWorkflowOptions): Promise<{ runId: string }> {
@@ -506,15 +512,33 @@ export async function startWorkflow({
workflowId,
});
let payloads;
+ let summaryPayload;
+ let detailsPayload;
if (input) {
try {
payloads = await encodePayloads(input, encoding);
} catch (_) {
- console.error('Could not decode input for starting workflow');
+ throw new Error('Could not encode input for starting workflow');
}
}
+ try {
+ if (summary) {
+ summaryPayload = (
+ await encodePayloads(stringifyWithBigInt(summary), 'json/plain')
+ )[0];
+ }
+
+ if (details) {
+ detailsPayload = (
+ await encodePayloads(stringifyWithBigInt(details), 'json/plain')
+ )[0];
+ }
+ } catch (e) {
+ console.error('Could not encode summary or details for starting workflow');
+ }
+
const body = stringifyWithBigInt({
workflowId,
taskQueue: {
@@ -524,6 +548,10 @@ export async function startWorkflow({
name: workflowType,
},
input: payloads ? { payloads } : null,
+ userMetadata: {
+ summary: summaryPayload,
+ details: detailsPayload,
+ },
searchAttributes:
searchAttributes.length === 0
? null
@@ -554,6 +582,8 @@ export const fetchInitialValuesForStartWorkflow = async ({
}): Promise<{
input: string;
searchAttributes: Record | undefined;
+ summary: string;
+ details: string;
}> => {
const handleError: ErrorCallback = (err) => {
console.error(err);
@@ -561,6 +591,8 @@ export const fetchInitialValuesForStartWorkflow = async ({
const emptyValues = {
input: '',
searchAttributes: undefined,
+ summary: '',
+ details: '',
};
try {
let query = '';
@@ -582,13 +614,14 @@ export const fetchInitialValuesForStartWorkflow = async ({
);
if (!workflows?.executions?.[0]) return emptyValues;
- const workflow = toWorkflowExecutions(workflows)[0];
-
- const firstEvent = await fetchInitialEvent({
+ const listWorkflow = toWorkflowExecutions(workflows)[0];
+ const params = {
namespace,
- workflowId: workflow.id,
- runId: workflow.runId,
- });
+ workflowId: listWorkflow.id,
+ runId: listWorkflow.runId,
+ };
+ const { workflow } = await fetchWorkflow(params);
+ const firstEvent = await fetchInitialEvent(params);
const startEvent = firstEvent as WorkflowExecutionStartedEvent;
const convertedAttributes = (await cloneAllPotentialPayloadsWithCodec(
@@ -598,10 +631,32 @@ export const fetchInitialValuesForStartWorkflow = async ({
get(authUser).accessToken,
)) as PotentiallyDecodable;
+ let summary = '';
+ if (workflow.summary) {
+ const decodedSummary = await decodeSingleReadablePayloadWithCodec(
+ workflow.summary,
+ );
+ if (typeof decodedSummary === 'string') {
+ summary = decodedSummary;
+ }
+ }
+
+ let details = '';
+ if (workflow.details) {
+ const decodedDetails = await decodeSingleReadablePayloadWithCodec(
+ workflow.details,
+ );
+ if (typeof decodedDetails === 'string') {
+ details = decodedDetails;
+ }
+ }
+
const input = stringifyWithBigInt(convertedAttributes?.payloads[0]);
return {
input,
searchAttributes: workflow?.searchAttributes?.indexedFields,
+ summary,
+ details,
};
} catch (e) {
return emptyValues;
diff --git a/src/lib/stores/workflow-run.ts b/src/lib/stores/workflow-run.ts
index a265fac82..3ffdd7628 100644
--- a/src/lib/stores/workflow-run.ts
+++ b/src/lib/stores/workflow-run.ts
@@ -2,18 +2,32 @@ import { writable } from 'svelte/store';
import type { GetPollersResponse } from '$lib/services/pollers-service';
import { persistStore } from '$lib/stores/persist-store';
-import type { WorkflowExecution } from '$lib/types/workflows';
+import type { WorkflowExecution, WorkflowMetadata } from '$lib/types/workflows';
export const refresh = writable(0);
export type WorkflowRunWithWorkers = {
workflow: WorkflowExecution | null;
workers: GetPollersResponse;
+ metadata: WorkflowMetadata;
+ userMetadata: {
+ summary: string;
+ details: string;
+ };
};
export const initialWorkflowRun: WorkflowRunWithWorkers = {
workflow: null,
workers: { pollers: [], taskQueueStatus: null },
+ metadata: {
+ definition: {
+ queryDefinitions: [],
+ },
+ },
+ userMetadata: {
+ summary: '',
+ details: '',
+ },
};
export const workflowRun = writable(initialWorkflowRun);
diff --git a/src/lib/types/schedule.ts b/src/lib/types/schedule.ts
index ca9632b31..ebad002b2 100644
--- a/src/lib/types/schedule.ts
+++ b/src/lib/types/schedule.ts
@@ -1,3 +1,4 @@
+import type { PayloadInputEncoding } from '$lib/components/payload-input-with-encoding.svelte';
import type { SearchAttributeInput } from '$lib/stores/search-attributes';
import type {
CalendarSpec,
@@ -38,7 +39,7 @@ export type ScheduleActionParameters = {
workflowId: string;
taskQueue: string;
input: string;
- encoding: string;
+ encoding: PayloadInputEncoding;
searchAttributes: SearchAttributeInput[];
};
diff --git a/src/lib/types/workflows.ts b/src/lib/types/workflows.ts
index 392d447b0..33ac99d78 100644
--- a/src/lib/types/workflows.ts
+++ b/src/lib/types/workflows.ts
@@ -53,12 +53,37 @@ export type WorkflowExecutionConfig = Replace<
{ defaultWorkflowTaskTimeout: Duration }
>;
+export type WorkflowInteractionDefinition = {
+ name?: string;
+ description?: string;
+};
+
+export type WorkflowMetadata = {
+ currentDetails?: string;
+ error?: Error;
+ definition?: {
+ type?: string;
+ queryDefinitions?: WorkflowInteractionDefinition[];
+ signalDefinitions?: WorkflowInteractionDefinition[];
+ updateDefinitions?: WorkflowInteractionDefinition[];
+ };
+};
+
+export type UserMetadata = {
+ summary?: Payload;
+ details?: Payload;
+};
+
+export type WorkflowExecutionConfigWithMetadata = WorkflowExecutionConfig & {
+ userMetadata?: UserMetadata;
+};
+
export type WorkflowExecutionAPIResponse = Optional<{
workflowExecutionInfo: WorkflowExecutionInfo;
pendingActivities: PendingActivityInfo[];
pendingChildren: PendingChildren[];
pendingNexusOperations: PendingNexusOperation[];
- executionConfig: WorkflowExecutionConfig;
+ executionConfig: WorkflowExecutionConfigWithMetadata;
callbacks: Callbacks;
pendingWorkflowTask: PendingWorkflowTaskInfo;
}>;
@@ -153,6 +178,8 @@ export type WorkflowExecution = {
defaultWorkflowTaskTimeout: Duration;
canBeTerminated: boolean;
callbacks: Callbacks;
+ summary?: Payload;
+ details?: Payload;
};
export type WorkflowTaskFailedCause =
diff --git a/src/lib/utilities/decode-payload.ts b/src/lib/utilities/decode-payload.ts
index 11238469e..7b871ff29 100644
--- a/src/lib/utilities/decode-payload.ts
+++ b/src/lib/utilities/decode-payload.ts
@@ -177,13 +177,13 @@ const keyIs = (key: string, ...validKeys: string[]) => {
};
export const decodeSingleReadablePayloadWithCodec = async (
- payload: RawPayload,
+ payload: RawPayload | Payload,
settings: Settings = get(page).data.settings,
-): Promise => {
+): Promise => {
try {
const decode = decodeReadablePayloads(settings);
const data = await decode([payload]);
- const result = data[0] as string;
+ const result = data[0];
return result || '';
} catch {
return '';
diff --git a/src/lib/utilities/encode-payload.ts b/src/lib/utilities/encode-payload.ts
index a4bb0910e..f0871447d 100644
--- a/src/lib/utilities/encode-payload.ts
+++ b/src/lib/utilities/encode-payload.ts
@@ -1,5 +1,6 @@
import { get } from 'svelte/store';
+import type { PayloadInputEncoding } from '$lib/components/payload-input-with-encoding.svelte';
import { encodePayloadsWithCodec } from '$lib/services/data-encoder';
import { dataEncoder } from '$lib/stores/data-encoder';
import type { Payloads } from '$lib/types';
@@ -20,7 +21,10 @@ export const getSinglePayload = (decodedValue: string): string => {
return '';
};
-export const setBase64Payload = (payload: string, encoding = 'json/plain') => {
+export const setBase64Payload = (
+ payload: string,
+ encoding: PayloadInputEncoding = 'json/plain',
+) => {
return {
metadata: {
encoding: btoa(encoding),
@@ -31,7 +35,7 @@ export const setBase64Payload = (payload: string, encoding = 'json/plain') => {
export const encodePayloads = async (
input: string,
- encoding: string,
+ encoding: PayloadInputEncoding,
encodeWithCodec: boolean = true,
): Promise => {
let payloads = null;
diff --git a/src/markdown.reset.css b/src/markdown.reset.css
index 04a71b0a2..d6a6f0bbd 100644
--- a/src/markdown.reset.css
+++ b/src/markdown.reset.css
@@ -4,7 +4,6 @@ body {
padding: 0;
border: 0;
font-size: 100%;
- font: inherit;
vertical-align: baseline;
}
@@ -40,11 +39,6 @@ h6 {
font-size: 0.67em;
}
-ol,
-ul {
- list-style: none;
-}
-
blockquote,
q {
quotes: none;
@@ -62,12 +56,17 @@ table {
border-spacing: 0;
}
-ul {
+ul,
+ol {
white-space: normal;
}
li {
- list-style: inside;
+ list-style-position: inside;
+}
+
+li * {
+ display: inline;
}
a {
diff --git a/src/routes/(app)/nexus/[id]/+layout.ts b/src/routes/(app)/nexus/[id]/+layout.ts
index 6523eaee8..b33c2c060 100644
--- a/src/routes/(app)/nexus/[id]/+layout.ts
+++ b/src/routes/(app)/nexus/[id]/+layout.ts
@@ -15,7 +15,10 @@ export const load = async ({ params, fetch, parent }) => {
endpoint.spec.description,
data.settings,
);
- description = decodedDescription;
+
+ if (typeof decodedDescription === 'string') {
+ description = decodedDescription;
+ }
}
} catch (e) {
console.error('Error decoding Nexus Endpoint description:', e);
diff --git a/src/routes/(app)/render/+server.ts b/src/routes/(app)/render/+server.ts
index c3e025094..27c1c2a25 100644
--- a/src/routes/(app)/render/+server.ts
+++ b/src/routes/(app)/render/+server.ts
@@ -25,7 +25,7 @@ const generateNonce = (): string => crypto.randomBytes(16).toString('hex');
* @returns
*/
const generateContentSecurityPolicy = ({ nonce }: RenderOptions) => {
- return `base-uri 'self'; default-src 'none'; style-src 'nonce-${nonce}'; script-src 'nonce-${nonce}'; frame-ancestors 'self'; form-action 'none'; sandbox allow-same-origin allow-popups;`;
+ return `base-uri 'self'; default-src 'none'; style-src 'nonce-${nonce}'; script-src 'nonce-${nonce}'; frame-ancestors 'self'; form-action 'none'; sandbox allow-same-origin allow-popups allow-popups-to-escape-sandbox;`;
};
/**