ObjectStackObjectStack

Automation Api

Automation Api protocol schemas

Automation API Protocol

Defines REST CRUD endpoint schemas for managing automation flows,

triggering executions, and querying execution history.

Base path: /api/automation

@example Endpoints

GET /api/automation — List flows

GET /api/automation/:name — Get flow

POST /api/automation — Create flow

PUT /api/automation/:name — Update flow

DELETE /api/automation/:name — Delete flow

POST /api/automation/:name/trigger — Trigger flow execution

POST /api/automation/:name/toggle — Enable/disable flow

GET /api/automation/:name/runs — List execution runs

GET /api/automation/:name/runs/:runId — Get single execution run

Source: packages/spec/src/api/automation-api.zod.ts

TypeScript Usage

import { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse } from '@objectstack/spec/api';
import type { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse } from '@objectstack/spec/api';

// Validate data
const result = AutomationApiErrorCode.parse(data);

AutomationApiErrorCode

Allowed Values

  • flow_not_found
  • flow_already_exists
  • flow_validation_failed
  • flow_disabled
  • execution_not_found
  • execution_failed
  • execution_timeout
  • node_executor_not_found
  • concurrent_execution_limit

AutomationFlowPathParams

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)

AutomationRunPathParams

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)
runIdstringExecution run ID

DeleteFlowRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)

DeleteFlowResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObject

FlowSummary

Properties

PropertyTypeRequiredDescription
namestringFlow machine name
labelstringFlow display label
typestringFlow type
statusstringFlow deployment status
versionintegerFlow version number
enabledbooleanWhether the flow is enabled for execution
nodeCountintegeroptionalNumber of nodes in the flow
lastRunAtstringoptionalLast execution timestamp

GetFlowRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)

GetRunRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)
runIdstringExecution run ID

GetRunResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObjectFull execution log with step details

ListFlowsRequest

Properties

PropertyTypeRequiredDescription
statusEnum<'draft' | 'active' | 'obsolete' | 'invalid'>optionalFilter by flow status
typeEnum<'autolaunched' | 'record_change' | 'schedule' | 'screen' | 'api'>optionalFilter by flow type
limitintegerMaximum number of flows to return
cursorstringoptionalCursor for pagination

ListFlowsResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObject

ListRunsRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)
statusEnum<'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'timed_out' | 'retrying'>optionalFilter by execution status
limitintegerMaximum number of runs to return
cursorstringoptionalCursor for pagination

ListRunsResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObject

ToggleFlowRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)
enabledbooleanWhether to enable (true) or disable (false) the flow

ToggleFlowResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObject

TriggerFlowRequest

Properties

PropertyTypeRequiredDescription
namestringFlow machine name (snake_case)
recordRecord<string, any>optionalRecord that triggered the automation
objectstringoptionalObject name the record belongs to
eventstringoptionalTrigger event type
userIdstringoptionalUser who triggered the automation
paramsRecord<string, any>optionalAdditional contextual data

TriggerFlowResponse

Properties

PropertyTypeRequiredDescription
successbooleanOperation success status
errorObjectoptionalError details if success is false
metaObjectoptionalResponse metadata
dataObject

On this page