Skip to main content
Glama

Writ Cloud

Create an automation

writ_create_automation

Creates an automation: on an event, it runs a workflow, sends a notification, and/or wakes an AI agent. It chains workflows (A completes → B runs), alerts on completion, or has an agent act on the event (ai_prompt). workflow_* events take a source workflow in on_workflow; at least one of run_workflow / notify / ai_prompt is required. notify is a template over the event, so it carries the data, not just that it ran: after a workflow, {{result.extracted_data.0.title}} / {{result.extracted_data..0.url}} (the run's own rows); after a crawl, {{rows.0.}} … {{row_count}} (the records it collected, schema fields included) plus {{seed_host}} {{pages_done}}; after a monitor change, {{extracted.price}}. A missing path renders empty, so a digest of N rows is N numbered lines. Digest pattern: writ_set_schedule on the workflow, then this with when=workflow_completed; a crawl has no schedule of its own: when='scheduled' + a crawl block, then this with when=crawl_completed. On a clock: when='scheduled' + schedule fires the actions at that time (a notify after run_workflow waits for that run, so {{result.extracted_data...}} is filled). run_functions + inputs call chosen functions of a multi-function workflow (what they need runs too). Anything else (conditions, scrape, extract, branches) is a raw blocks tree. On a webhook: when='webhook_received' mints a signed inbound URL; the answer's webhook holds the url, its signing_secret (shown only then), the two headers every call signs, curl and Python examples and an example_body. Each top-level JSON field of a call becomes the run input of the same name; inputs, notify and ai_prompt templates read any field as {{payload.}}. A call is acknowledged at once; with ?wait=true it is held until the workflow runs the automation starts finish and answers their data. webhook_trigger_id reuses an existing URL (writ_list_webhooks).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the automation (required).
whenNoEvent: workflow_completed | workflow_started | crawl_completed | crawl_failed | ai_session_completed | ai_session_started | change_detected (with `target_id`) | webhook_received (mints a signed URL; `webhook_trigger_id` reuses one) | scheduled (a clock, with `schedule`).
titleNoNotification title (with `notify`).
blocksNoRaw flow tree instead of the action arguments (max 50): each {id, type: event|condition|action, blockType, config, parentId}. The first block is the root event (its blockType is the event: one of `when`; scheduled config {mode, interval_ms | time, days, tz}); every other block names an earlier block as parentId. Actions: workflow {workflow_id, function_name | function_names, input_mapping}; notification {template, title, channels, recipients}; ai_session {goal, entry_url}; scrape {urls:[<=5, templates ok], format: markdown|html|both, on_error} -> {{scraped.content}} {{scraped.pages}}; extract {source:'{{scraped.content}}', fields:[{key, from: html_css|json|regex|embedded_json|body, selector, attribute, all, path, pattern, group, number, required}]} -> {{extracted.<key>}}; crawl {seed_url, intent, include_paths, exclude_paths, page_budget, max_depth, extract_mode: markdown|schema, extract_schema, render_mode: auto|http|browser, persona_id} starts a fresh crawl (its rows arrive with crawl_completed, not in this chain); condition {field, operator, value}. Awaiting a run: an event block workflow_completed {linked_to_block:<workflow block id>}. Every string setting takes {{placeholders}}.
inputsNoWith run_workflow: its inputs {input_name: value}, each a literal or a {{template}} over the event (e.g. {{extracted.price}}, or {{payload.order.id}} from a webhook body); saved values fill the rest. Stored as plain JSON.
notifyNoSend a notification with this message — a template over the event's data (see the tool description: {{result.extracted_data.0.title}} after a workflow, {{rows.0.title}} / {{row_count}} after a crawl, {{extracted.price}} on a change).
enabledNo
channelsNoNotification channels for `notify`, e.g. ["pushover","email"] (required for delivery).
priorityNo
scheduleNoWith when='scheduled': {kind:'interval', interval_minutes:N} or {kind:'daily', time:'HH:MM', tz:'<IANA zone>'} or {kind:'weekly', time, days:[1..7] (1=Mon .. 7=Sun), tz}.
ai_promptNoWake an AI agent with this task when the event fires. The agent gets the event context (page URL, diff, extracted values) and works the task in a cloud browser. Supports {{placeholders}}.
target_idNoWith when='change_detected' (required there): the monitor whose changes fire this, i.e. the monitor_id writ_create_monitor returned.
recipientsNoNotification recipients, e.g. ["email:3"]. Omitted = every enabled recipient on the channel; the answer names who the alert actually reaches, and warns when nobody is configured.
descriptionNo
on_workflowNoSource workflow name whose event fires this (required for workflow_* events).
ai_entry_urlNoPage the woken agent starts on. Defaults to the event's page (the monitored URL on change_detected); required in practice for workflow_*/webhook events.
run_functionNoOne function name (alias of run_functions).
run_workflowNoWorkflow to run when the event fires (by name).
ai_session_idNoWith when='ai_session_completed' / 'ai_session_started': only this AI session.
run_functionsNoWith run_workflow: call these functions of a multi-function workflow instead of the whole workflow — one run of the selection plus what it needs (sign-in, a token, the search whose ids another reads). Unset = the whole workflow.
on_workflow_idNo
run_workflow_idNo
cooldown_minutesNoMinimum minutes between AI wakes for `ai_prompt` (default 10; 0 disables).
target_selector_idNoWith target_id: only changes of this one selector of that monitor.
webhook_trigger_idNoWith when='webhook_received': fire on this existing inbound webhook (its id from writ_list_webhooks) instead of minting a new URL. Its senders keep signing with its secret; one that has no secret yet gets one, shown once in the answer.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.