feat: workflow run status & time

This commit is contained in:
Fu Diwei
2025-01-04 22:07:01 +08:00
parent b686579acc
commit 3b9a7fe805
29 changed files with 505 additions and 181 deletions

View File

@@ -13,6 +13,9 @@ export interface WorkflowModel extends BaseModel {
content?: WorkflowNode;
draft?: WorkflowNode;
hasDraft?: boolean;
lastRunId?: string;
lastRunStatus?: string;
lastRunTime?: string;
}
export const WORKFLOW_TRIGGERS = Object.freeze({

View File

@@ -1,8 +1,11 @@
export interface WorkflowRunModel extends BaseModel {
workflowId: string;
status: string;
trigger: string;
startedAt: ISO8601String;
endedAt: ISO8601String;
logs: WorkflowRunLog[];
error: string;
succeeded: boolean;
}
export type WorkflowRunLog = {
@@ -18,3 +21,12 @@ export type WorkflowRunLogOutput = {
content: string;
error: string;
};
export const WORKFLOW_RUN_STATUSES = Object.freeze({
PENDING: "pending",
RUNNING: "running",
SUCCEEDED: "succeeded",
FAILED: "failed",
} as const);
export type WorkflorRunStatusType = (typeof WORKFLOW_RUN_STATUSES)[keyof typeof WORKFLOW_RUN_STATUSES];