@@ -78,21 +78,19 @@ func (rb *redisBackend) CancelWorkflowInstance(ctx context.Context, instance *co
78
78
}
79
79
80
80
type instanceState struct {
81
- InstanceID string `json:"instance_id,omitempty"`
82
- ExecutionID string `json:"execution_id,omitempty"`
83
- State backend.WorkflowState `json:"state,omitempty"`
84
- CreatedAt time.Time `json:"created_at,omitempty"`
85
- CompletedAt * time.Time `json:"completed_at,omitempty"`
81
+ Instance * core.WorkflowInstance `json:"instance,omitempty"`
82
+ State backend.WorkflowState `json:"state,omitempty"`
83
+ CreatedAt time.Time `json:"created_at,omitempty"`
84
+ CompletedAt * time.Time `json:"completed_at,omitempty"`
86
85
}
87
86
88
87
func createInstance (ctx context.Context , rdb redis.UniversalClient , instance * core.WorkflowInstance , ignoreDuplicate bool ) error {
89
88
key := instanceKey (instance .InstanceID )
90
89
91
90
b , err := json .Marshal (& instanceState {
92
- InstanceID : instance .InstanceID ,
93
- ExecutionID : instance .ExecutionID ,
94
- State : backend .WorkflowStateActive ,
95
- CreatedAt : time .Now (),
91
+ Instance : instance ,
92
+ State : backend .WorkflowStateActive ,
93
+ CreatedAt : time .Now (),
96
94
})
97
95
if err != nil {
98
96
return errors .Wrap (err , "could not marshal instance state" )
0 commit comments