Workflows

Core Platform
workflow_definitions_readWorkflows

Reads a facility's workflow automations: the workflows, one workflow's full graph, the node types a graph can use, and curated templates. Read node_types before building or editing a graph so every type and parameter is valid at the facility.

Actions:

  • list: List workflows. Each workflow with whether it is live, its published version, run count, last run and its nodes (id, name, type). Brand and organisation workflows are not listed.
  • get: Get workflow. The full draft graph (nodes, connections, notes, settings) and meta: active, publishedVersionId and, once published, publishedWorkflow, the graph that is live now. Only workflows of this facility. Needs workflowId.
  • node_types: Node types. Palette entries with type, label, category, outputs (branches) and inputSchema, the parameters to fill in. available is false, with the reason, when the facility lacks a module the node needs. MCP tools appear as mcp.. nodes.
  • templates: Templates. Starting points for common automations, with risk and riskNote (what goes wrong if published carelessly), node types, required modules, availability at this facility and a preview graph. Turn one into a graph with workflow_definitions_write instantiate_template.

Parameters

NameTypeDescription
action*"list" | "get" | "node_types" | "templates"What to do; each action is described in the tool description.
limitintegerItems per page (default 25, at most 100) (list, node_types, templates)
cursorstringnextCursor from the previous page (list, node_types, templates)
facilityIdstringFacility ID. Optional when the connected facility is the one you mean.
workflowIdstringWorkflow id from workflow_definitions_read list (get)
querystringWords to find in the type, label, description or search terms (node_types)
categorystringOnly this category: trigger, action, logic or ai (node_types)
typesarrayExact types to describe, e.g. those in a workflow you're editing. Includes retired types the palette no longer shows; ignores query and category. (node_types)
workflow_definitions_writeWorkflows

Creates, edits, publishes, stops and deletes a facility's workflow automations. Authoring loop: read node_types with workflow_definitions_read, build the graph (or start from instantiate_template), create it as a draft, try it with workflow_runs_write test (simulated), then publish. Edits to a draft never change what is live until it is published.

Actions:

  • create: Create workflow. Saves a new, inactive draft from a full graph with at least one node; name defaults to "Untitled workflow". Validation problems come back in errors with node detail. Needs nodes.
  • update: Save draft. Replaces the whole draft: send every node and connection, not only the changes. What is live keeps running until you publish. Validation problems come back in errors with node detail. Needs workflowId, nodes.
  • patch_meta: Rename. Changes only the name or description; the graph and what is live stay as they are. changed is false when both already match. Needs workflowId.
  • duplicate: Duplicate. Copies a workflow into a new draft named " (copy)" with fresh node ids, never published or active. The original is untouched. Needs workflowId.
  • delete: Delete. Deletes the workflow for good: draft, published versions, run history and trigger routing. set_active false stops it but keeps it; discard_draft only resets draft edits. Needs workflowId. Asks for confirmation.
  • discard_draft: Discard draft edits. Resets the draft to the last published version, throwing away edits made since. The live version is never affected; needs a published version. Needs workflowId. Asks for confirmation.
  • publish: Publish. Validates the draft, saves it as the live version and turns the workflow on, so its triggers fire and its actions run for real. Runs in progress finish on the old version. If waiting Delay steps would be re-timed the result has code WAIT_RETARGET_CONFIRMATION_REQUIRED and impacts: call again with confirmWaitRetargets and those impacts. Needs workflowId. Asks for confirmation.
  • set_active: Turn on or off. active true turns a published workflow back on. active false stops it: triggers stop firing and pending Delay steps are cancelled so they never finish. Nothing is deleted. Asks first unless it is already in that state. Needs workflowId, active. May ask for confirmation.
  • instantiate_template: Graph from template. Turns a template into a graph ready for create: { name, description, nodes, connections } with fresh node ids. Templates leave recipients, doors and times blank on purpose; fill them in first. Saves nothing. Needs templateId.
  • generate: Generate graph. Builds a graph from a plain-language prompt with the facility's AI and returns { name, description, nodes, connections } using only valid node types. Pass workflow to revise one; the full revised graph comes back. Saves nothing, but spends the facility's AI credits. Needs prompt. Asks for confirmation.

Parameters

NameTypeDescription
action*"create" | "update" | "patch_meta" | "duplicate" | "delete" | "discard_draft" | "publish" | "set_active" | "instantiate_template" | "generate"What to do; each action is described in the tool description.
namestringWorkflow name (create, update, patch_meta)
descriptionstringWhat the workflow does (create, update, patch_meta)
nodesarrayEvery node: { id, name, type, position, parameters }. Types and parameters come from workflow_definitions_read node_types. (create, update)
connectionsobjectConnections keyed by source node name; may be empty for one node (create, update)
notesarrayCanvas notes (create, update)
settingsobjectWorkflow settings (create, update)
facilityIdstringFacility ID. Optional when the connected facility is the one you mean.
workflowIdstringWorkflow id from workflow_definitions_read list (update, patch_meta, duplicate, delete, discard_draft, publish, set_active)
confirmWaitRetargetsbooleanRe-time the waiting Delay steps listed in the impacts of the previous result (publish)
confirmedWaitRetargetsarrayThe impacts from the WAIT_RETARGET_CONFIRMATION_REQUIRED result, sent back unchanged (publish)
activebooleantrue to turn it on, false to stop it (set_active)
templateIdstringTemplate id from workflow_definitions_read templates (instantiate_template)
promptstringWhat the workflow should do (generate)
workflowobjectA full workflow from workflow_definitions_read get, to revise instead of starting fresh (generate)
confirmbooleanSet only after the user confirmed the preview returned by the first call
workflow_runs_readWorkflows

A workflow's run history, newest first, and one run step by step. Use it to check whether an automation ran, follow a run started with workflow_runs_write, or find which node failed and why.

Actions:

  • list: List runs. Each run with status, mode (live or test), side effects, trigger, who started it, times, step count, the node it waits on and any error. Needs workflowId.
  • get: Get run. The run's status plus every step in order, with each node's input, output, note and error. Runs are asynchronous: one with Delays waits until its continuation comes due. Needs workflowId, executionId.

Parameters

NameTypeDescription
action*"list" | "get"What to do; each action is described in the tool description.
workflowIdstringWorkflow id from workflow_definitions_read list
limitintegerItems per page (default 25, at most 100) (list)
cursorstringnextCursor from the previous page (list)
facilityIdstringFacility ID. Optional when the connected facility is the one you mean.
executionIdstringRun id from workflow_runs_read list (get)
workflow_runs_writeWorkflows

Starts, test-runs, cancels and replays workflow runs. Prefer test, which runs the draft with side effects simulated; run executes the published workflow for real. Runs are asynchronous: follow them with workflow_runs_read get.

Actions:

  • run: Run now. Runs the published workflow from its manual trigger (custom.manualTrigger), with real side effects. Scheduled, webhook and event triggers fire on their own. Returns the run's executionId and first status. Needs workflowId. Asks for confirmation.
  • test: Test draft. Runs the saved draft without publishing it, recorded as a test run. Side effects are simulated by default: nothing is sent or switched, and each node reports what it would have done. sideEffects live asks first. Needs workflowId. May ask for confirmation.
  • cancel: Cancel waiting run. Cancels a run waiting on a Delay: its pending waits close and the steps after them never run. Finished runs and runs mid-step cannot be cancelled. Needs workflowId, executionId. Asks for confirmation.
  • retry: Replay run. Replays a finished run from its recorded trigger input, linked back through retryOf. published (default) reruns the version it used, for real, and asks first; draft-test runs the current draft simulated, the right choice while fixing a failure. Needs workflowId, executionId. May ask for confirmation.

Parameters

NameTypeDescription
action*"run" | "test" | "cancel" | "retry"What to do; each action is described in the tool description.
workflowIdstringWorkflow id from workflow_definitions_read list
nodeIdstringTrigger node id to start from; omit for the manual trigger (run, test)
payloadobjectInput for the nodes after the trigger, e.g. { "visitorName": "Ada" } (run, test)
facilityIdstringFacility ID. Optional when the connected facility is the one you mean.
sideEffects"simulate" | "live"Whether node actions really happen (test)
executionIdstringRun id from workflow_runs_read list (cancel, retry)
mode"published" | "draft-test"What to replay against (retry)
confirmbooleanSet only after the user confirmed the preview returned by the first call