Skip to content

Commit

Permalink
fix: schedule trigger not starting for distributed workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Dec 19, 2024
1 parent cd87dd9 commit 15ad3b3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -9707,6 +9707,22 @@ func GenerateWorkflowFromParent(ctx context.Context, workflow Workflow, parentOr
}
}
}
} else if newWf.Triggers[triggerIndex].TriggerType == "SCHEDULE" {
oldID := newWf.Triggers[triggerIndex].ID
newWf.Triggers[triggerIndex].ID = uuid.NewV4().String()

newWf.Triggers[triggerIndex].ReplacementForTrigger = oldID


for branchIndex, branch := range newWf.Branches {
if branch.SourceID == oldID {
newWf.Branches[branchIndex].SourceID = newWf.Triggers[triggerIndex].ID
}

if branch.DestinationID == oldID {
newWf.Branches[branchIndex].DestinationID = newWf.Triggers[triggerIndex].ID
}
}
}
}

Expand Down

0 comments on commit 15ad3b3

Please sign in to comment.