Automations
Space MCP tools in the Automations scope (automations). Reach these with a wks_live_ key over space-mcp or space-api.
Tools in the automations scope, callable over space-mcp (tools/call) or space-api (REST) with a wks_live_* key that grants automations.
create_automation
Scope: automations:write
Create a new automation (starts DISABLED with a 'manual' trigger). Returns { automation_id }. Then call set_automation_trigger to choose what fires it, set_automation_actions to add the steps, and finally update_automation with enabled:true to turn it on. Reuse an existing automation (list_automations) before creating a duplicate.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
description | string |
delete_automation
Scope: automations:write
Permanently delete an automation and all of its action steps and run history (cascades). Cannot be undone.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes |
get_automation
Scope: automations:read
Get one automation's full state: its trigger (type + config), its ordered action steps (with branching), the merge-tag fields available from the trigger, and handy space resource ids (forms, phone numbers, cloud agents, email addresses) for wiring config. Use before editing an existing automation.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes |
get_automation_run
Scope: automations:read
Full detail for one automation run: per-action results (action_type, label, status, error message, structured failure details, output, duration) plus the trigger data the run saw. Everything needed to diagnose a failing step and fix its config with set_automation_actions.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | yes |
list_automation_action_catalog
Scope: automations:read
List every valid automation trigger type and action type, each with its required/optional config fields and the merge-tag fields a trigger exposes. CALL THIS FIRST before building or editing an automation so you use only valid trigger_type / action_type values and supply the right config keys.
list_automation_runs
Scope: automations:read
Run history: list past automation runs (newest first) with status, duration, action/failure counts, and the first error message per run. Filter by automation_id and/or status (running|waiting|completed|partial|failed). Use this to check whether an automation has been working in the wild, then drill into a run with get_automation_run.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | Only runs of this automation. | |
status | running | waiting | completed | partial | failed | ||
limit | number | Max runs (default 20, max 100). |
list_automations
Scope: automations:read
List space automations.
run_automation
Scope: automations:run
Run a space automation NOW and get the full result back synchronously: run_id, status (completed/partial/failed/waiting), and per-action results with any errors — so you can test an automation, see exactly which step failed and why, fix its config, and run it again. Works on disabled automations too (build disabled → test → enable is the safe workflow). Pass payload to simulate the trigger's merge fields (e.g. {email, name, phone} for a contact trigger). Requires automations.run scope. NOTE: actions really execute — emails/SMS actually send; use a test recipient in the payload.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes | |
payload | object | Merge fields available to the run (simulates trigger data). |
set_automation_actions
Scope: automations:write
Replace an automation's action steps with the supplied ordered list (full replace, not append). Each action: { temp_id (unique, e.g. 'a1'), action_type (valid type from list_automation_action_catalog), config (object with that action's required fields), enabled? }. Branching: a 'condition' action can have children — give the child parent_temp_id (the condition's temp_id, which must appear earlier) and branch_label ('true' or 'false'). Merge tags like {{field_key}} reference trigger fields or earlier action outputs.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes | |
actions | object[] | yes | Ordered steps. Each: { temp_id, action_type, config, enabled?, parent_temp_id?, branch_label? }. |
set_automation_trigger
Scope: automations:write
Set what fires an automation. trigger_type must be a valid type from list_automation_action_catalog (e.g. form_submission, contact_created, scheduled, webhook, manual). Pass trigger_config with the type's required fields (e.g. { form_id } for form_submission). Scheduled triggers require a 5-field cron_expression like '0 9 * * *'. Webhook triggers auto-generate a slug. Replaces the existing trigger.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes | |
trigger_type | string | yes | A valid trigger type (see list_automation_action_catalog). |
trigger_config | object | Type-specific config, e.g. { form_id } or { agent_id }. | |
cron_expression | string | 5-field cron, required when trigger_type is 'scheduled'. |
update_automation
Scope: automations:write
Update an automation's name, description, and/or enabled state. Pass enabled:true to turn an automation ON (or false to pause it). At least one of name/description/enabled is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
automation_id | string | yes | |
name | string | ||
description | string | ||
enabled | boolean |