Workflow Runtime
Runtime
export enum LogSeverity {
'log' = 'log',
'info' = 'info',
'warn' = 'warn',
'error' = 'error',
}
export interface LogObject {
timestamp: string;
taskName: string;
log: string;
severity: LogSeverity;
}
export const RuntimeStatus = {
pending: 'pending',
completed: 'completed',
failed: 'failed',
} as const;
export type RuntimeStatusType = keyof typeof RuntimeStatus;
export interface Runtime {
_id: string;
/**
* Workflow Result of every Task Processed
* @example {"Start Task": {}, "Function Task": {"hello":"world"}}
*/
workflowResults: Record<string, any>;
/**
* Definition Task List
* @see {@link https://workflow-engine-docs.pages.dev/docs/schemas/task}
*/
tasks: Task[];
/**
* Global Params
*/
global?: Record<string, any>;
/**
* Runtime Status
*/
workflowStatus: RuntimeStatusType;
/**
* Logs generated by Workflow Tasks
*/
logs: Array<LogObject>;
/**
* Workflow Definition Id
* @see {@link https://workflow-engine-docs.pages.dev/docs/schemas/definition}
*/
workflowDefinitionId!: string;
/**
* Runtime Trigger Id (Auth0 Id)
*/
userId: string;
createdAt: string;
updatedAt: string;
}