Automate workflows by triggering actions on app and agent events
Just ask your agent. Say things like “create an automation that notifies me when a session is flagged” or “set up a daily morning briefing at 9am”. The agent will create and validate the configuration for you.
Automations let you trigger actions automatically when events happen in Craft Agent. You can run shell commands, send prompts to start new sessions, or schedule recurring workflows — all configured in a single JSON file.
Want Craft Agent to do something for you on a schedule? Use a prompt action with a cron expression:
Copy
Ask AI
{ "version": 2, "automations": { "SchedulerTick": [ { "cron": "0 9 * * 1-5", "timezone": "America/New_York", "labels": ["Scheduled"], "actions": [ { "type": "prompt", "prompt": "Check @github for any new issues assigned to me and summarise them" } ] } ] }}
This creates a new session every weekday at 9 AM, activates the GitHub source, and asks the agent to check your issues. The session is automatically labelled “Scheduled” for easy filtering.
When an event fires (e.g., a label is added, a tool runs, or a cron schedule matches), Craft Agent checks your configuration for matching entries and executes them.There are two types of actions:
Command actions — execute shell commands with event data available as environment variables
Prompt actions — send a prompt to Craft Agent, creating a new session (App events only)
Each event type maps to an array of matchers, and each matcher contains an array of actions to execute when the matcher’s pattern matches the event value.
Automations are listed in the sidebar under Automations. From here you can:
Enable / Disable — Toggle individual automations on or off without removing them
Duplicate — Create a copy of an existing automation with a “Copy” suffix
Delete — Remove an automation permanently
Test — Manually trigger an automation to verify it works before waiting for the real event. The test runner resolves @mentions, enables sources, and uses the configured llmConnection/model — the same code path as the scheduler.
Execution history — Each automation records success and failure to a timeline, viewable in the detail page. History is stored in automations-history.jsonl and rotated to the last 1000 entries.
Batch operations are supported — select multiple automations and enable, disable, or delete them together. The list is sorted by most recent execution for quick access to active automations.
You can also manage automations by editing automations.json directly. Changes take effect immediately — no restart required.Enabling and disabling: Set "enabled": false on any matcher to temporarily disable it without removing the configuration. Omit the field or set it to true to re-enable.
Deleting: Remove the matcher entry from automations.json. If an event type has no remaining matchers, you can remove the entire event key.
Ask your agent to manage automations for you: “disable all my scheduled automations” or “remove the urgent notification automation”. The agent will read and update automations.json directly.
Triggered by Craft Agent itself. Support both command and prompt actions.
Event
Trigger
Match Value
LabelAdd
Label added to session
Label ID (e.g., urgent)
LabelRemove
Label removed from session
Label ID
LabelConfigChange
Label configuration changed
Always matches
PermissionModeChange
Permission mode changed
New mode name
FlagChange
Session flagged/unflagged
true or false
SessionStatusChange
Session status changed
New status (e.g., done)
SchedulerTick
Runs every minute
Uses cron matching
Renamed:TodoStateChange was renamed to SessionStatusChange. The old name still works as a deprecated alias but will show a validation warning. Update your automations to use SessionStatusChange.
Status changes: To react to status/workflow state changes (e.g., when a session moves to “done” or “in-progress”), use the SessionStatusChange event. The match value is the new status name, so you can use a matcher like "^done$" to trigger only on specific transitions.
Send a prompt to Craft Agent, creating a new session. Only works with App events.
Copy
Ask AI
{ "type": "prompt", "prompt": "Run the @weather skill and summarize today's forecast"}
Property
Type
Default
Description
type
"prompt"
Required
Action type
prompt
string
Required
Prompt text to send
llmConnection
string
Workspace default
LLM connection slug (configured in AI Settings)
model
string
Workspace default
Model ID for the created session
Features:
Use @mentions to reference sources or skills (e.g., @github, @linear)
Environment variables are expanded (e.g., $CRAFT_LABEL, ${CRAFT_SESSION_NAME})
Mentioned sources are automatically activated for the new session
LLM Connection & Model: You can specify which AI provider and model to use for the session created by a prompt action. If omitted, the workspace default connection and model are used.
The llmConnection value is the slug of an LLM connection configured in AI Settings. The model value is a model ID supported by the provider. If either is invalid or not found, it gracefully falls back to the workspace default.