code: func (e *engineImpl) execEnqueueTriggersTask(c context.Context, tqTask proto.Message) error {
  	msg := tqTask.(*internal.EnqueueTriggersTask)
  
  	c = logging.SetField(c, "JobID", msg.JobId)
  
  	logTriggers := func() {
  		for _, t := range msg.Triggers {
  			logging.Infof(c, "  %s (emitted by %q, inv %d)", t.Id, t.JobId, t.InvocationId)
  		}
  	}
  
  	// Don't even bother if the job is paused or disabled. Note that if the job
  	// became inactive after this check, the triage will get rid of pending
  	// triggers itself. Thus the check here is just an optimization.
  	job, err := e.getJob(c, msg.JobId)
  	if err != nil {
  		logging.WithError(err).Errorf(c, "Failed to grab Job entity")
  		return err // transient error getting the job
  	}
  	if job == nil || !job.Enabled || job.Paused {
  		logging.Warningf(c, "Discarding the following triggers since the job is inactive")
  		logTriggers()
  		return nil
  	}
  
  	logging.Infof(c, "Adding the following triggers to the pending triggers set")
  	logTriggers()
  	if err := pendingTriggersSet(c, msg.JobId).Add(c, msg.Triggers); err != nil {
  		logging.WithError(err).Errorf(c, "Failed to update pending triggers set")
  		return err
  	}
  
  	return e.kickTriageNow(c, msg.JobId)
  }
docs: // execEnqueueTriggersTask adds a bunch of triggers to job's pending triggers
  // set and kicks the triage process to process them.
  //
  // Note: it is invoked through TQ, and also directly from EmitTriggers RPC
  // handler.