flexkit automations
Manages automations: AI agents that follow your instructions on a schedule, on a webhook, when records change, after a job, or on demand. Use it to script automation changes, keep definitions in git, and start runs from CI. To read what a run did, use flexkit runs; to decide the changes a run proposes, use flexkit approvals.
Synopsis
flexkit automations <subcommand> [arguments] [options]Without a subcommand, flexkit automations runs ls. Every subcommand acts on the linked project; pass --project <id> to choose another one (see global options).
Permissions
You only see personal automations you created and space automations of spaces you belong to. An automation that uses a personal plugin connection can only be saved from a signed-in session (flexkit login), not with a project API token.
automations ls
List automations, most recently run first.
flexkit automations ls [--enabled | --disabled] [--search <text>] [--visibility <list>] [--limit <n>] [--offset <n>] [--json]Examples
# List automations in the linked project
flexkit automations ls
# Find enabled automations whose name contains "invoice"
flexkit automations ls --enabled --search invoice
# List your personal and space automations
flexkit automations ls --visibility personal,space
# Print the names of disabled automations
flexkit automations ls --disabled --json | jq -r '.automations[].name'automations inspect
Show one automation: status, model, visibility, data-change policy, triggers (with the webhook URL), attached custom tools and skills, and the instructions.
flexkit automations inspect <automationId> [--json]Examples
# Show an automation
flexkit automations inspect 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f
# Print its webhook URL
flexkit automations inspect 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --json \
| jq -r '.automation.triggers[] | select(.type == "webhook") | .url'automations create
Create an automation from flags, from a JSON definition, or both (flags override the file). New automations are disabled unless you pass --enable, so you can test them with automations run first. Defaults: model auto, visibility project, data changes require approval.
flexkit automations create --name <name> --instructions <text|file> [--schedule <cron>]... [--timezone <tz>] [--model <id>] [--visibility <v>] [--space <id>] [--mutation-policy <policy>] [--enable] [--file <json>] [--json]--instructions (alias --prompt) takes inline text, a file path, @file, or - for stdin. --schedule adds a schedule trigger and can be repeated; use --file for webhook, entity, job and poll triggers (see the definition format).
Examples
# A weekday report at 8:00 Madrid time, enabled right away
flexkit automations create --name "Daily stock report" \
--instructions "Summarize products with stock below 10 and post the list." \
--schedule "0 8 * * 1-5" --timezone Europe/Madrid --enable
# Instructions kept in a Markdown file
flexkit automations create --name "Weekly churn review" --instructions @prompts/churn.md
# From a JSON definition
flexkit automations create --file automations/stock-report.json
# Copy an automation into another project
flexkit automations pull 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f - \
| flexkit automations create --file - --project prod-project-idautomations update
Change an automation. Only what you pass changes: the CLI loads the current definition and applies the fields of --file and the flags on top. Lists are replaced as a whole, so to change triggers or plugin tools put the complete triggers or toolConfigs list in --file.
flexkit automations update <automationId> [--name <name>] [--instructions <text|file>] [--model <id>] [--visibility <v>] [--space <id>] [--mutation-policy <policy>] [--enable | --disable] [--file <json>] [--json]Examples
# Rename
flexkit automations update 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --name "Stock report (EU)"
# Replace the instructions from a file
flexkit automations update 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --instructions @prompts/stock-report.md
# Let the agent apply data changes without asking
flexkit automations update 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --mutation-policy auto_approve
# Replace the triggers with one daily schedule
echo '{"triggers":[{"type":"schedule","cron":"0 7 * * *","timezone":"UTC"}]}' \
| flexkit automations update 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --file -automations enable / automations disable
Turn an automation’s triggers on or off. A disabled automation can still be run by hand.
flexkit automations enable <automationId> [--json]
flexkit automations disable <automationId> [--json]Examples
# Enable after a successful test run
flexkit automations enable 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f
# Pause an automation
flexkit automations disable 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3fautomations rm
Delete an automation and its triggers. Past runs stay in the run history. The CLI asks for confirmation; pass --yes in scripts.
flexkit automations rm <automationId> [--yes] [--json]Examples
# Delete after a prompt
flexkit automations rm 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f
# Delete without a prompt
flexkit automations rm 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --yesautomations run
Start a manual run now. The automation does not need to be enabled. By default the command prints the run id and returns. With --follow it streams the run’s events (as runs logs --follow does); with --wait it waits silently and prints the run summary. Both keep waiting while the run waits for an approval, and exit with code 1 when the run fails or is cancelled.
flexkit automations run <automationId> [--follow | --wait] [--json]Examples
# Start a run
flexkit automations run 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f
# Start a run and watch it
flexkit automations run 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --follow
# In CI: fail the job when the run fails, keep the summary
flexkit automations run 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --wait --json | jq -r '.run.summary'automations tools
Show what an automation can use: the project’s custom tools and which of them are attached, its plugin settings, Slack and Teams delivery channels, and attached skills.
flexkit automations tools <automationId> [--json]Examples
# Show the tools of an automation
flexkit automations tools 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f
# Print the attached custom tools
flexkit automations tools 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --json | jq -r '.customToolNames[]'automations models
List the models automations can use. Pass the ID column to --model; auto lets Flexkit choose per run. To use another reasoning effort, pass <model>:<effort> with one of the listed efforts.
flexkit automations models [--json]Examples
# List models
flexkit automations models
# Use a specific model with high effort
flexkit automations update 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f --model anthropic/claude-opus-5.5:highautomations credits
Show the AI credit balance of the project’s team. Automation runs draw from it.
flexkit automations credits [--json]Examples
# Show the balance and the top-up link
flexkit automations credits
# Check for a low balance in a script
flexkit automations credits --json | jq '.creditBalance.isLowBalance'automations pull
Save an automation’s definition as JSON, for version control or for copying it to another project. Without a file, or with -, it is printed on stdout.
flexkit automations pull <automationId> [file]The file includes webhook tokens and secrets. Keep such files out of public repositories.
Examples
# Save to a file in your repository
flexkit automations pull 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f automations/stock-report.json
# Print it
flexkit automations pull 3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3fautomations push
Apply a definition saved with pull. When the file has an id, that automation is updated; otherwise (or with --create) a new automation is created and its id printed.
flexkit automations push <file> [--create] [--json]Examples
# Apply a changed definition
flexkit automations push automations/stock-report.json
# Create a copy in another project
flexkit automations push automations/stock-report.json --create --project prod-project-idDefinition format
--file, pull and push use the same JSON object as the automations API. Fields you leave out keep their current value on update, or their default on create.
{
"id": "3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f",
"name": "Daily stock report",
"instructions": "Summarize products with stock below 10 and post the list.",
"enabled": true,
"modelId": "auto",
"visibility": "project",
"spaceId": null,
"mutationPolicy": "require_approval",
"notifyRule": "when_flagged",
"notifyCreator": true,
"customToolNames": ["forecastDemand"],
"skillIds": [],
"toolConfigs": [],
"triggers": [
{ "type": "schedule", "cron": "0 8 * * 1-5", "timezone": "Europe/Madrid" },
{ "type": "entity", "entities": ["Product"], "events": ["update"] },
{ "type": "webhook", "token": "stock-report-hook-01", "secret": null },
{ "type": "job", "job": "schema_deploy", "outcome": "failed", "automationId": null },
{ "type": "poll", "query": "{ orders(where: { status: { eq: \"pending\" } }) { _id } }", "intervalMinutes": 15, "condition": null, "variables": null }
]
}visibility:project,space(withspaceId) orpersonal.mutationPolicy:require_approvalorauto_approve.notifyRule:always,when_flagged,failuresornever.- Triggers are described in Automation triggers. A webhook token is 8–128 letters, digits,
_or-; only one webhook trigger is allowed.
Options
You can also use all global options.
Common workflows
Keep automations in git
# Save every automation of the project
flexkit automations ls --json --limit 100 | jq -r '.automations[].id' | while read -r id; do
flexkit automations pull "$id" "automations/$id.json"
done
# After editing a file, apply it
flexkit automations push automations/3f1c9a2e-8d4b-4c1a-9f0e-2b7d5e6a1c3f.jsonTest before enabling
# Create disabled, run once and read the result, then enable
id=$(flexkit automations create --name "Tag new orders" --instructions @prompts/tag-orders.md --json | jq -r '.automation.id')
flexkit automations run "$id" --follow
flexkit automations enable "$id"