This is an automated email from the ASF dual-hosted git repository.

DImuthuUpe pushed a commit to branch workflow-pause-on-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/workflow-pause-on-auth by this 
push:
     new 6792baaf1a Showing workflows on dashboard
6792baaf1a is described below

commit 6792baaf1a7a5b5c6fa195804bb4f61cb62c5235
Author: DImuthuUpe <[email protected]>
AuthorDate: Sat Nov 7 00:53:13 2026 -0500

    Showing workflows on dashboard
---
 dashboard/src/app/processes/view/page.tsx | 54 ++++++++++++++++++++++++++++---
 dashboard/src/components/ui.tsx           |  1 +
 dashboard/src/lib/types.ts                | 15 +++++++++
 3 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/dashboard/src/app/processes/view/page.tsx 
b/dashboard/src/app/processes/view/page.tsx
index 0402187f3d..da9c075ca2 100644
--- a/dashboard/src/app/processes/view/page.tsx
+++ b/dashboard/src/app/processes/view/page.tsx
@@ -7,7 +7,17 @@ import { Alert, Card, formatTime, Id, PageHead, StatusBadge, 
Table } from "@/com
 import { api, errorText, tryGet } from "@/lib/api";
 import { useDeploymentNames } from "@/lib/catalog";
 import { useResource } from "@/lib/hooks";
-import { isFileType, type DataProduct, type Process, type ProcessStatus, type 
Task, type TaskStatus, type TaskType } from "@/lib/types";
+import {
+  isFileType,
+  type DataProduct,
+  type Process,
+  type ProcessStatus,
+  type ProcessWorkflow,
+  type ProcessWorkflowType,
+  type Task,
+  type TaskStatus,
+  type TaskType,
+} from "@/lib/types";
 
 const TERMINAL = new Set(["COMPLETED", "FAILED"]);
 const POLL_MS = 5000;
@@ -19,6 +29,12 @@ const TASK_KINDS: readonly { path: string; label: string; 
type: TaskType }[] = [
   { path: "interactive-command-tasks", label: "Interactive commands", type: 
"INTERACTIVE_COMMAND" },
 ];
 
+const WORKFLOW_LABELS: Record<ProcessWorkflowType, string> = {
+  BATCH_JOB_SUBMISSION: "Job submission",
+  JOB_MONITORING: "Job monitoring",
+  BATCH_JOB_COMPLETION: "Job completion",
+};
+
 // Fields every task carries; the rest are kind-specific and shown as they 
come.
 const COMMON_TASK_FIELDS = new Set(["taskId", "processId", "onFailure", 
"retryCount", "taskOrder"]);
 
@@ -41,13 +57,19 @@ function ProcessView() {
         api.get<ProcessStatus[]>(`/api/v1/processes/${id}/statuses`),
       ]);
       // Tasks are owner-scoped: a viewer who is neither owner nor admin sees 
none.
-      const [tasks, taskStatuses] = await Promise.all([
+      // So are workflows.
+      const [tasks, taskStatuses, workflows] = await Promise.all([
         Promise.all(TASK_KINDS.map((k) => 
tryGet<Task[]>(`/api/v1/processes/${id}/${k.path}`))),
         tryGet<TaskStatus[]>(`/api/v1/processes/${id}/task-statuses`),
+        tryGet<ProcessWorkflow[]>(`/api/v1/processes/${id}/workflows`),
       ]);
-      const done = TERMINAL.has(statuses[statuses.length - 1]?.status ?? "");
+      // A process is marked COMPLETED from inside its completion workflow, 
just before
+      // that workflow records its own outcome, so keep polling until it has.
+      const done =
+        TERMINAL.has(statuses[statuses.length - 1]?.status ?? "") &&
+        !(workflows ?? []).some((w) => w.status === "RUNNING");
       if (done) setLive(false);
-      return { process, statuses, tasks, taskStatuses: taskStatuses ?? [] };
+      return { process, statuses, tasks, taskStatuses: taskStatuses ?? [], 
workflows };
     },
     [id],
     live ? POLL_MS : undefined,
@@ -174,6 +196,30 @@ function ProcessView() {
             )}
           </Card>
 
+          {d.workflows && d.workflows.length > 0 && (
+            <Card title="Workflows" flush>
+              <Table
+                rows={d.workflows}
+                rowKey={(w) => w.processWorkflowId}
+                empty=""
+                columns={[
+                  {
+                    header: "Workflow",
+                    cell: (w) => (
+                      <span className="row">
+                        <strong>{w.workflowType ? 
WORKFLOW_LABELS[w.workflowType] : "—"}</strong>
+                        {w.processWorkflowId === d.process.lastWorkflowId && 
<span className="small muted">latest</span>}
+                      </span>
+                    ),
+                  },
+                  { header: "Status", cell: (w) => <StatusBadge 
status={w.status} /> },
+                  { header: "Started", cell: (w) => <span 
className="small">{formatTime(w.timestamp)}</span> },
+                  { header: "Workflow ID", cell: (w) => <Id 
value={w.workflowId} /> },
+                ]}
+              />
+            </Card>
+          )}
+
           {d.taskStatuses.length > 0 && (
             <Card title="Task history">
               <ul className="timeline">
diff --git a/dashboard/src/components/ui.tsx b/dashboard/src/components/ui.tsx
index b0ae32d590..99ace483d4 100644
--- a/dashboard/src/components/ui.tsx
+++ b/dashboard/src/components/ui.tsx
@@ -219,6 +219,7 @@ export function Tabs<K extends string>({
 
 const STATUS_TONE: Record<string, string> = {
   COMPLETED: "ok",
+  SUCCEEDED: "ok",
   PROVISIONED: "ok",
   END: "ok",
   RUNNING: "info",
diff --git a/dashboard/src/lib/types.ts b/dashboard/src/lib/types.ts
index 500c318d84..66038eeeb1 100644
--- a/dashboard/src/lib/types.ts
+++ b/dashboard/src/lib/types.ts
@@ -262,6 +262,21 @@ export interface ProcessStatus {
   timestamp: number | null;
 }
 
+export type ProcessWorkflowType = "BATCH_JOB_SUBMISSION" | "JOB_MONITORING" | 
"BATCH_JOB_COMPLETION";
+
+export type ProcessWorkflowStatusType = "RUNNING" | "SUCCEEDED" | "FAILED";
+
+// One workflow run of a process, updated in place as it moves from RUNNING to 
its
+// outcome. workflowId is the workflow engine's instance id.
+export interface ProcessWorkflow {
+  processWorkflowId: string;
+  processId: string | null;
+  workflowId: string;
+  workflowType: ProcessWorkflowType | null;
+  status: ProcessWorkflowStatusType | null;
+  timestamp: number | null;
+}
+
 export type TaskType = "DATA_STAGING" | "JOB_SUBMISSION" | "JOB_MONITORING" | 
"INTERACTIVE_COMMAND";
 
 export type TaskStatusType = "CREATED" | "EXECUTING" | "PAUSED" | "COMPLETED" 
| "FAILED" | "CANCELED";

Reply via email to