Skip to main content
Early Access. Commands and behavior can change between releases.
A Factory starts work when an event matches one of its triggers. A trigger is one entry in the triggers: list of factory.yaml: a name, an on that matches an event, and a run that says what to start. run is either a stage, which starts a staged Factory run, or a command, which starts a Factory command run: one agent runs that command once, in one session. With no triggers key, the defaults start a run on each pickup label and on an assignment to the Factory, and handle failed CI on Factory branches. Triggers only start work: after that, a run moves from stage to stage on its own and waits for you at its gates.

Triggers and routines

Every event, the defaults, how stages chain, and how to test a trigger.

Routines

A routine is a source: schedule trigger. Each time it fires, on schedule or because you fired it, the Factory records one command run: one agent runs the command once, in one session. The run skips the staged pipeline and its approval gates, but it is a Factory run like any other, with its own run record.
Push the file to create or change a routine. To run it now, outside its schedule:
A schedule trigger’s run.notify names where the result is posted; Slack is the supported target. See the trigger reference.

Slack

With Slack connected to your workspace and the Mutagent app invited to a channel:
  • Start work. A Factory Slack trigger (source: slack, event: mention) runs its command when someone mentions the app in that channel, on the repository the trigger names.
  • Get updates. A routine’s result can be posted to Slack with run.notify, and a question the Factory posts to Slack is answered in that question’s thread.

Slack triggers

Configure a Factory-managed Slack trigger.

Connect Slack

Add the Mutagent Slack app to your workspace.

In the web app

Routines lists your Factory’s routines, what is running now and their recent runs. Triggers shows the event triggers from factory.yaml, their health and their recent runs.

Factory triggers and gateway triggers

The mutagent gateway commands create a different kind of trigger and routine: each one starts a single session in a cloud sandbox with an instruction you write. It creates no Factory run and passes no gate. A Factory routine or other command trigger creates a Factory command run, and a stage trigger starts a staged run, except failed CI on a branch one of this Factory’s runs owns: that sends the run’s sub-item back to build instead of starting a new run. Use a stage trigger for work that should go through plan, build, review and land. Two enabled triggers can’t claim the same Slack channel, so pick one kind per channel.