Skip to content
agent-cms

Components / cms-automations

Automations

When this happens, if these hold, do that: the list, the form, a dry test against one document and the run history.

With the shadcn CLI

npx shadcn add https://agent-cms-docs.vercel.app/r/cms-automations.json

With the agent-cms CLI

npx @mainsoft/agent-cms add cms-automations

No live demo: automations change documents and call other services, and the demo is shared by every visitor. Add the screen to your app, or run the example app (examples/next). Open the editor demo

Usage#

tsx
// app/admin/automations/page.tsx
"use client";
import { CmsAutomations } from "@/components/cms/cms-automations";

export default function Page() {
  return <CmsAutomations />;
}

The sidebar shows "Automations" to admins. The list on the left, the form on the right: when, the collection, conditions, actions, and the on/off switch (a new one starts off). "Runs" lists the last runs as Done, Skipped or Failed; they happen on a cron call, so press "Refresh" to see new ones. "Try it" checks one document against the conditions and changes nothing.

"Call an app function" lists the names you gave in createCms({ automations: { actions } }).

See Automations, roles and the dashboard.

note

From 0.13.0.