Queries
automation(Beta) — Fetch an automation by id. Read itsscript, or open a workspace withcreateWorkspaceto change it.automationCatalog(Beta) — Read automation docs by path: one entry per path, in order, null for an unknown path. "" is the index; start with “guide/”. ThencreateWorkspaceto build one.automationRun(Beta) — Fetch a run by id, with its steps. Runs are deleted 30 days after they finish.automations(Beta) — List automations, most recently changed first.testAutomation(Beta) — Run the workspace’s current, uncommitted automation once against a scenario and return what happened. Nothing is stored and nothing real happens: no messages are sent and no records change. Null if the workspace doesn’t exist. INVALID while the document has an ERROR diagnostic or can’t run; INVALID_SCENARIO, with the failing fields, for a scenario that doesn’t matchschemas/scenarioinautomationCatalog.workspace(Beta) — Read a workspace. Null if it doesn’t exist or expired.
Mutations
commitWorkspace(Beta) — Save a workspace to its resource. STALE if the resource changed since the workspace started; INVALID while an ERROR diagnostic remains. The workspace stays open. For an automation, publish withpublishAutomationnext. Null if the workspace is gone.createWorkspace(Beta) — Open a working copy of a resource. OmitresourceIdto start a new resource; committing creates it. Null if the resource doesn’t exist. Read the resource type’s guide inautomationCatalogfirst.deleteAutomation(Beta) — Delete an automation that has never been published. A published one keeps its versions and runs: turn it off withupdateAutomationinstead. False if the automation doesn’t exist.deleteWorkspace(Beta) — Discard a workspace. The resource is unchanged. False if the workspace doesn’t exist.publishAutomation(Beta) — Publish the automation’s draft as its next version. Call withoutacknowledgedRisksfirst to see therisks; nothing is published until each one is acknowledged. The first publish turns the automation on. Null if the automation doesn’t exist.updateAutomation(Beta) — Change an automation’s settings. Its name and content are edited in a workspace. Null if the automation doesn’t exist.updateWorkspace(Beta) — Apply text edits to a workspace, in order. Edits fail only mechanically (stale revision, text not found or ambiguous, more than 100 edits or 1 MB); text that doesn’t parse is reported indiagnostics. Changes only the working copy. Null if the workspace is gone.
Objects
Automation(Beta) — An automation built in Developer › Automations: a trigger and the steps it runs. For email and SMS flows, use MarketingAutomation. To create or edit one, use a workspace (createWorkspace); readguide/inautomationCatalogfirst.AutomationCatalogEntry(Beta) — A page of the automation catalog.AutomationCatalogListing(Beta) — A catalog page, as listed under its parent.AutomationPublishImpact(Beta) — What publishing does to runs in progress. Runs on the LATEST strategy move to the new version; PINNED runs stay.AutomationRisk(Beta) — Something publishing would do that you must accept first: pass itscodeinacknowledgedRisks.AutomationRun(Beta) — One execution of an automation. Runs are deleted 30 days after they finish.AutomationRunFailure(Beta) — Why a run failed.AutomationStepRecord(Beta) — One step a run executed, in order.AutomationTestRun(Beta) — What one test run of a workspace did. Nothing it did was stored or performed.AutomationVersion(Beta) — A published version of an automation. Immutable.AutomationVersionRunCount(Beta) — Runs in progress on one version.Diagnostic(Beta) — A problem in a document. Its message names adiagnostics/<code>page inautomationCatalogthat explains it.DiagnosticFix(Beta) — A suggested fix: edits to apply withupdateWorkspace.TextEdit(Beta) — Replacefind, which occurs exactly once in the document, withreplace. Pass it toupdateWorkspaceas is.Workspace(Beta) — A working copy of one resource, as text. Edit it withupdateWorkspace, checkdiagnostics, then save it withcommitWorkspace. Expires 7 days after its last change.
Input objects
TextEditInput(Beta) — Replacefindwithreplace.findmust occur exactly once unlessallis set. Omitfindto replace the whole document.UpdateAutomationInput(Beta) — Settings to change; omitted fields are left as they are.
Enums
AutomationPublishStatus(Beta) — WhatpublishAutomationdid.AutomationRunSortKey(Beta) — A field this list can be ordered by; pass to the list’sorderByargument and pair withreverseto flip direction.AutomationRunStatus(Beta) — Where a run is in its lifecycle.AutomationSortKey(Beta) — A field this list can be ordered by; pass to the list’sorderByargument and pair withreverseto flip direction.AutomationVersionSortKey(Beta) — A field this list can be ordered by; pass to the list’sorderByargument and pair withreverseto flip direction.AutomationVersionStrategy(Beta) — Which version a run already in flight continues on.DiagnosticSeverity(Beta) — How much a diagnostic matters.WorkspaceCommitStatus(Beta) — What a commit did.WorkspaceResourceType(Beta) — A kind of resource a workspace can edit.