Skip to content
ThirdLayer

Docs > Automations

Creating automations

Author automation files under an agent in Factory, configure triggers and pre-run conditions, preview changes, and verify live scheduling after Apply.

Because automations are Factory files owned by an agent, creating one is a repeatable sequence: define the actor in AGENT.md, define the trigger and per-run task in automations/<name>.md, preview, push, and verify live state.

flowchart LR
  Trigger["Trigger fires<br/>(cron / datetime / event / manual)"] --> Admit["Admission & eligibility<br/>(enabled, Scope, requires, billing)"]
  Admit --> Cond{"Optional condition<br/>or event classifier"}
  Cond -->|Does not match| Skip["Skipped<br/>(recorded with reason)"]
  Cond -->|Matches| Run["Agent run executes<br/>(dex / claude / codex)"]
  Run --> Outcome["Outcome applied<br/>(Pending Actions, Auto Mode,<br/>or read-only report)"]

Make sure the parent agent declares its standing instructions, requires, and write policy (requireWriteApproval: true by default; optional autoMode).

2. Write the automation file (automations/<name>.md)

Section titled “2. Write the automation file (automations/<name>.md)”

Create the automation file under agents/<slug>/automations/ (personal) or workspace/agents/<id>/automations/ (shared):

users/sam--.../agents/pipeline-digest/automations/weekday-morning.md
---
schemaVersion: 4
enabled: true
trigger:
type: cron
schedule: "0 8 * * 1-5"
timezone: America/Los_Angeles
condition: Only run if there are new customer emails or Slack messages since the previous weekday run.
---
Review open customer threads from the past 24 hours and check the `Open Q4 commitments`
View (`dex views query`). Summarize new commitments, blockers, and overdue items,
and draft a short Slack recap for my review.

Rules enforced at validation time:

  • Use schemaVersion: 4.
  • Put the task in the Markdown body, never in an instructions frontmatter field.
  • Set enabled explicitly (true or false). An automation with enabled: true requires a non-empty Markdown body.
  • Never duplicate agent fields. Do not write title, harness, model, requireWriteApproval, or autoMode in the automation file—they belong exclusively to AGENT.md.
  • Omit legacy autoExecute. Write approval is controlled by requireWriteApproval and autoMode on AGENT.md.
Terminal window
dex factory add factories/*/users/*/agents/pipeline-digest
dex factory commit -m "Add weekday morning pipeline digest automation"
dex factory preview
dex factory push

Commit success and Apply success are separate steps. Do not assume an automation is scheduled until Apply succeeds; verify its live state in /nexus/automations or via dex agents get <id>.

  • Personal automations — Trigger a manual run (Run now) and inspect the transcript and any Pending Action cards in /nexus/inbox.
  • Shared automations — Do not click Admin Run now just to test an unproven edit (that dispatches to every live member or runs the live coordinator). Preview with dex factory preview, validate on a dry run or your own member run first, and keep requireWriteApproval: true until outputs are consistently accurate.

To pause an automation without deleting it, set enabled: false in automations/<name>.md, commit, preview, and push. On a shared agent, individual teammates can pause only themselves with dex agents off <id> without affecting the rest of the team.