Goal
Manage automations from code or a terminal.Prerequisites
- An API token or the signed-in CLI. Add team_id for a team’s automations.
Workflow
1
List with stackshift automations list or GET /api/v1/automations.
2
Run with stackshift automations run AUTOMATION or POST /api/v1/automations/{id}/runs.
3
Approve with stackshift automations approve RUN —data ’{“decision”:“approved”}’.
CLI
stackshift automations
API
- GET, POST /api/v1/automations; GET, PUT, DELETE /api/v1/automations/{id}. PUT takes name, description, definition and expected_revision.
- POST /{id}/enable, /{id}/disable, /{id}/runs (test: true for a test run), /{id}/rerun-failed and /{id}/webhook (returns url and secret). PUT /{id}/access with actions. PUT and DELETE /{id}/secrets/{name}.
- GET /runs (filter by automation_id and status), GET /runs/{runId}, POST /runs/{runId}/cancel, /runs/{runId}/rerun and /runs/{runId}/approval.
- GET /actions lists every action with its tier and whether it is available. GET /templates?category=media lists the Media templates.
SDKs
The JavaScript SDK has stackshift.automations and the Go SDK has client.Automations, with one method per route: list, create, get, save, delete, enable, disable, setAccess, run (StartRun in Go), rerunFailed, putSecret, deleteSecret, rotateWebhook, actions, templates, previewTrigger, listRuns, getRun, cancelRun, rerun and decide. A save that breaks a rule fails with code automation_invalid, and the error details list each issue with its node_id.Definition
Node types: trigger.event, trigger.cron, trigger.webhook, trigger.manual, platform.action, integration.http, control.condition, control.delay and stackie.run. A value of { “$input”: “<node>.<path>” } reads an earlier node’s output.Tell your billing API about failed deploys
Expected result
Your scripts drive the same automations and runs shown in the dashboard.
Related guides
Automations overview
An automation is a trigger plus steps that run by themselves: on an event, on a schedule, from a webhook URL, or when you press Run.
Triggers
Start a run on any event in the catalog, on a cron schedule in your time zone, from a signed webhook URL, or by hand.