UNPKG

@bernierllc/temporal-workflow-ui

Version:

Thin domain-specific wrapper around @bernierllc/generic-workflow-ui for Temporal workflows

83 lines (82 loc) 2.67 kB
/** * Temporal Workflow Execution Status Types */ export type TemporalWorkflowExecutionStatus = 'running' | 'completed' | 'failed' | 'canceled' | 'terminated' | 'timed_out'; /** * Stage Execution Status */ export type TemporalStageExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped'; /** * Execution Error * Details about a workflow or stage error */ export interface TemporalExecutionError { /** Error message */ message: string; /** Error type/class name */ type: string; /** Optional stack trace */ stackTrace?: string; } /** * Stage Execution Info * Details about the execution of a specific stage */ export interface TemporalStageExecutionInfo { /** Current status of the stage */ status: TemporalStageExecutionStatus; /** When the stage started executing */ startTime?: Date; /** When the stage finished executing */ endTime?: Date; /** Number of execution attempts */ attempts?: number; /** Error details if failed */ error?: string; } /** * Temporal Workflow Execution * Complete execution state of a Temporal workflow */ export interface TemporalWorkflowExecution { /** Unique workflow execution ID */ workflowId: string; /** Unique run ID for this execution */ runId: string; /** Workflow type name */ workflowType: string; /** Current stage being executed (if any) */ currentStageId?: string; /** Overall execution status */ status: TemporalWorkflowExecutionStatus; /** When execution started */ startTime: Date; /** When execution ended (if completed) */ endTime?: Date; /** Error details if failed */ error?: TemporalExecutionError; /** Status of individual stages */ stageStatuses: Record<string, TemporalStageExecutionInfo>; } /** * Workflow Event Types */ export type TemporalWorkflowEventType = 'workflow_started' | 'workflow_completed' | 'workflow_failed' | 'workflow_canceled' | 'workflow_terminated' | 'activity_started' | 'activity_completed' | 'activity_failed' | 'activity_retried' | 'signal_received' | 'signal_sent' | 'timer_fired' | 'child_workflow_started' | 'child_workflow_completed'; /** * Workflow Event * A single event in the workflow execution history */ export interface TemporalWorkflowEvent { /** Unique event ID */ id: string; /** When the event occurred */ timestamp: Date; /** Type of event */ type: TemporalWorkflowEventType; /** Stage ID associated with event (if applicable) */ stageId?: string; /** Event message/description */ message: string; /** Additional event details */ details?: any; }