A disabled workflow is never started by a trigger, another workflow or a person. Delete is refused while a trigger, another workflow or a run in progress names it. A parked or ended run restarts from a step.
19 lines
417 B
Go
19 lines
417 B
Go
package events
|
|
|
|
import "context"
|
|
|
|
// WorkflowTriggers names the triggers that start workflow.
|
|
func (m *Module) WorkflowTriggers(ctx context.Context, workflow string) ([]string, error) {
|
|
triggers, err := m.store.AllTriggers(ctx, m.orgID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var names []string
|
|
for _, t := range triggers {
|
|
if t.Workflow == workflow {
|
|
names = append(names, t.Name)
|
|
}
|
|
}
|
|
return names, nil
|
|
}
|