This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
node_execution.go
52 lines (48 loc) · 2.33 KB
/
node_execution.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package models
import (
"time"
)
// IMPORTANT: If you update the model below, be sure to double check model definitions in
// pkg/repositories/config/migration_models.go
type NodeExecutionKey struct {
ExecutionKey
NodeID string `gorm:"primary_key;index"`
}
// By convention, gorm foreign key references are of the form {ModelName}ID
type NodeExecution struct {
BaseModel
NodeExecutionKey
// Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting.
Phase string
InputURI string
Closure []byte
StartedAt *time.Time
// Corresponds to the CreatedAt field in the NodeExecution closure
// Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt
NodeExecutionCreatedAt *time.Time
// Corresponds to the UpdatedAt field in the NodeExecution closure
// Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt
NodeExecutionUpdatedAt *time.Time
Duration time.Duration
NodeExecutionEvents []NodeExecutionEvent
// Metadata about the node execution.
NodeExecutionMetadata []byte
// Parent that spawned this node execution - value is empty for executions at level 0
ParentID *uint `sql:"default:null" gorm:"index"`
// List of child node executions - for cases like Dynamic task, sub workflow, etc
ChildNodeExecutions []NodeExecution `gorm:"foreignkey:ParentID"`
// The task execution (if any) which launched this node execution.
// TO BE DEPRECATED - as we have now introduced ParentID
ParentTaskExecutionID uint `sql:"default:null" gorm:"index"`
// The workflow execution (if any) which this node execution launched
// NOTE: LaunchedExecution[foreignkey:ParentNodeExecutionID] refers to Workflow execution launched and is different from ParentID
LaunchedExecution Execution `gorm:"foreignkey:ParentNodeExecutionID"`
// Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind
ErrorKind *string `gorm:"index"`
// Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins
ErrorCode *string
// If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution
CacheStatus *string
// In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here.
DynamicWorkflowRemoteClosureReference string
}