diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go index ee90fe581e..d71f0b7e20 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow.go @@ -88,6 +88,25 @@ func (s *subworkflowHandler) handleSubWorkflow(ctx context.Context, nCtx interfa return handler.DoTransition(handler.TransitionTypeEphemeral, handler.PhaseInfoRunning(nil)), nil } + if state.HasTimedOut() { + workflowNodeState := handler.WorkflowNodeState{ + Phase: v1alpha1.WorkflowNodePhaseFailing, + Error: &core.ExecutionError{ + Kind: core.ExecutionError_USER, + Code: "Timeout", + Message: "Timeout in node", + }, + } + + err = nCtx.NodeStateWriter().PutWorkflowNodeState(workflowNodeState) + if err != nil { + logger.Warnf(ctx, "failed to store failing subworkflow state with err: [%v]", err) + return handler.UnknownTransition, err + } + + return handler.DoTransition(handler.TransitionTypeEphemeral, handler.PhaseInfoRunning(nil)), nil + } + if state.IsComplete() { // If the WF interface has outputs, validate that the outputs file was written. var oInfo *handler.OutputInfo diff --git a/flytepropeller/pkg/controller/nodes/transformers.go b/flytepropeller/pkg/controller/nodes/transformers.go index e341a0d2a1..eb96a38d9c 100644 --- a/flytepropeller/pkg/controller/nodes/transformers.go +++ b/flytepropeller/pkg/controller/nodes/transformers.go @@ -69,6 +69,8 @@ func ToNodeExecEventPhase(p handler.EPhase) core.NodeExecution_Phase { return core.NodeExecution_FAILED case handler.EPhaseRecovered: return core.NodeExecution_RECOVERED + case handler.EPhaseTimedout: + return core.NodeExecution_TIMED_OUT default: return core.NodeExecution_UNDEFINED }