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. To only be TOLD when something happens (no steps to run), use listen_to_events instead; to send events to another system, create_event_webhook.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
description | string |
create_event_feed
Scope: automations:write
Keep this space's events of the types you name so another system can PULL them (space-api GET /events, or get_events) instead of receiving a webhook.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_types | string[] | yes | Event types from list_event_types, or ["*"]. |
filters | object | Per event type, the automation trigger's config that narrows it. | |
name | string | A short name for this listener. |
create_event_webhook
Scope: automations:write
Send this space's events to another system: every event of the types you name is POSTed to an https url, signed (Wakato-Signature header, HMAC-SHA256), retried when it fails. The signing secret is in the answer ONCE — hand it to whoever runs the receiving end. filters narrow per type with the automation trigger's own config. For yourself, use listen_to_events instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | yes | The receiving https url. |
event_types | string[] | yes | Event types from list_event_types, or ["*"]. |
filters | object | Per event type, the automation trigger's config that narrows it. | |
name | string | A short name for this listener. |
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 |
delete_event_webhook
Scope: automations:write
Delete a webhook or a feed for good.
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
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, agents with a Reach, 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 |
get_events
Scope: automations:read
Read what happened in this space, oldest first, after a cursor: events the space keeps (14 days) because some listener, webhook or feed wants their type. Pass the answer's next_cursor as after next time. types narrows; listener_id reads one feed (its types and filters).
| Parameter | Type | Required | Description |
|---|---|---|---|
after | string | A cursor (evt_…) from the last answer's next_cursor. | |
types | string[] | Event types from list_event_types, or ["*"]. | |
listener_id | string | The listener's id (list_my_listeners, list_event_webhooks). | |
limit | number | How many (default 50, max 200). |
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.
list_event_types
Scope: automations:read
Every event you can be told about in this space (a new order, a booking, a form reply, a contact created, an agent finishing a task…) with its label and group. Pass type to get one in full with the fields its data carries, or group (e.g. Commerce, Forms, Contacts) to narrow.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | One event type, e.g. commerce_order_paid — answered with its data fields. | |
group | string | Only this group, e.g. Commerce. |
list_event_webhook_deliveries
Scope: automations:read
A webhook's delivery log, newest first: which event, delivered or failed, the receiver's HTTP status and error, attempts, when it retries next.
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
limit | number | How many (default 50, max 200). |
list_event_webhooks
Scope: automations:read
The space's outgoing webhooks and feeds: url, events, on/off (and why it was switched off), deliveries in the last 24 hours. Agents' own listeners are not here.
| Parameter | Type | Required | Description |
|---|---|---|---|
kind | webhook | feed | Only webhooks, or only feeds. |
list_my_listeners
Scope: automations:read
What you are listening to in this space: each listener's events, filters, delivery, whether it is on, and how many events reached you in the last 24 hours.
listen_to_events
Scope: automations:write
Hear about events in this space (a new order, a booking, a form…) — they arrive in your chat. Name the event types (list_event_types), or ["*"] for everything. delivery 'now' = one line per event as it happens; 'batch' = one line every batch_minutes gathering what happened. filters narrow per type with the automation trigger's own config (e.g. { "commerce_order_paid": { "product_id": "…" } }). Only for yourself; to send events to another system, use create_event_webhook.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_types | string[] | yes | Event types from list_event_types, or ["*"]. |
filters | object | Per event type, the automation trigger's config that narrows it. | |
delivery | now | batch | 'now' (default) or 'batch'. | |
batch_minutes | number | For 'batch': how often, in minutes (1–1440, default 15). | |
name | string | A short name for this listener. |
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'. |
stop_listening
Scope: automations:write
Stop one of your listeners for good (list_my_listeners shows them). To pause instead, update_my_listener with enabled:false.
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
test_event_webhook
Scope: automations:write
Send a webhook a signed test event now and answer whether the receiver took it (its HTTP status or the error). Nothing is stored or retried.
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
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 |
update_event_webhook
Scope: automations:write
Change a webhook or a feed: its events, filters, name, url (webhook), or switch it off/on (enabled — switching on clears a failure stop).
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
url | string | The receiving https url. | |
event_types | string[] | Event types from list_event_types, or ["*"]. | |
filters | object | Per event type, the automation trigger's config that narrows it. | |
name | string | A short name for this listener. | |
enabled | boolean | false switches it off, true back on. |
update_my_listener
Scope: automations:write
Change one of your listeners: its events, filters, delivery ('now' | 'batch'), batch_minutes, name, or switch it off/on (enabled).
| Parameter | Type | Required | Description |
|---|---|---|---|
listener_id | string | yes | The listener's id (list_my_listeners, list_event_webhooks). |
event_types | string[] | Event types from list_event_types, or ["*"]. | |
filters | object | Per event type, the automation trigger's config that narrows it. | |
delivery | now | batch | 'now' (default) or 'batch'. | |
batch_minutes | number | For 'batch': how often, in minutes (1–1440, default 15). | |
name | string | A short name for this listener. | |
enabled | boolean | false switches it off, true back on. |