ObjectStackObjectStack

Orchestration

Orchestration protocol schemas

AI Agentic Orchestration Protocol

Defines intelligent orchestration flows where AI Agents leverage cognitive skills

to automate business processes with dynamic reasoning, planning, and execution.

Distinction from Standard Workflows:

  • Standard Workflow: Deterministic (If X then Y). defined in src/data/workflow.zod.ts

  • AI Orchestration: Probabilistic & Agentic (Goal -> Plan -> Execute).

Use Cases:

  • Complex Support Triage (Analyze sentiment + intent -> Draft response -> Route)

  • Intelligent Document Processing (OCR -> Extract Entities -> Validate -> Entry)

  • Research Agent (Search Web -> Summarize -> Generate Report)

Source: packages/spec/src/ai/orchestration.zod.ts

TypeScript Usage

import { AIOrchestration, AIOrchestrationExecutionResult, AIOrchestrationTrigger, AITask, AITaskType, AgentCommunicationProtocol, AgentGroupMember, AgentGroupRole, BatchAIOrchestrationExecution, MultiAgentGroup, PostProcessingAction, WorkflowFieldCondition, WorkflowSchedule } from '@objectstack/spec/ai';
import type { AIOrchestration, AIOrchestrationExecutionResult, AIOrchestrationTrigger, AITask, AITaskType, AgentCommunicationProtocol, AgentGroupMember, AgentGroupRole, BatchAIOrchestrationExecution, MultiAgentGroup, PostProcessingAction, WorkflowFieldCondition, WorkflowSchedule } from '@objectstack/spec/ai';

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

AIOrchestration

Properties

PropertyTypeRequiredDescription
namestringOrchestration unique identifier (snake_case)
labelstringDisplay name
descriptionstringoptional
objectNamestringTarget object for this orchestration
triggerEnum<'record_created' | 'record_updated' | 'field_changed' | 'scheduled' | 'manual' | 'webhook' | 'batch'>
fieldConditionsObject[]optionalFields to monitor (for field_changed trigger)
scheduleObjectoptionalSchedule configuration (for scheduled trigger)
webhookConfigObjectoptionalWebhook configuration (for webhook trigger)
entryCriteriastringoptionalFormula condition - workflow only runs if TRUE
aiTasksObject[]AI tasks to execute in sequence
postActionsObject[]optionalActions after AI tasks complete
executionModeEnum<'sequential' | 'parallel'>How to execute multiple AI tasks
stopOnErrorbooleanStop workflow if any task fails
timeoutnumberoptionalMaximum execution time in seconds
priorityEnum<'low' | 'normal' | 'high' | 'critical'>
enableLoggingboolean
enableMetricsboolean
notifyOnFailurestring[]optionalUser IDs to notify on failure
activeboolean
versionstring
tagsstring[]optional
categorystringoptionalWorkflow category (e.g., "support", "sales", "hr")
ownerstringoptionalUser ID of workflow owner
createdAtstringoptionalISO timestamp
updatedAtstringoptionalISO timestamp

AIOrchestrationExecutionResult

Properties

PropertyTypeRequiredDescription
workflowNamestring
recordIdstring
statusEnum<'success' | 'partial_success' | 'failed' | 'skipped'>
executionTimenumberExecution time in milliseconds
tasksExecutedintegerNumber of tasks executed
tasksSucceededintegerNumber of tasks succeeded
tasksFailedintegerNumber of tasks failed
taskResultsObject[]optional
tokensObjectoptionalTotal token usage for this execution
costnumberoptionalTotal cost for this execution in USD
errorstringoptional
startedAtstringISO timestamp
completedAtstringoptionalISO timestamp

AIOrchestrationTrigger

Allowed Values

  • record_created
  • record_updated
  • field_changed
  • scheduled
  • manual
  • webhook
  • batch

AITask

Properties

PropertyTypeRequiredDescription
idstringoptionalOptional task ID for referencing
namestringHuman-readable task name
typeEnum<'classify' | 'extract' | 'summarize' | 'generate' | 'predict' | 'translate' | 'sentiment' | 'entity_recognition' | 'anomaly_detection' | 'recommendation'>
modelstringoptionalModel ID from registry (uses default if not specified)
promptTemplatestringoptionalPrompt template ID for this task
inputFieldsstring[]Source fields to process (e.g., ["description", "comments"])
inputSchemaRecord<string, any>optionalValidation schema for inputs
inputContextRecord<string, any>optionalAdditional context for the AI model
outputFieldstringTarget field to store the result
outputSchemaRecord<string, any>optionalValidation schema for output
outputFormatEnum<'text' | 'json' | 'number' | 'boolean' | 'array'>
classesstring[]optionalValid classes for classification tasks
multiClassbooleanAllow multiple classes to be selected
extractionSchemaRecord<string, any>optionalJSON schema for structured extraction
maxLengthnumberoptionalMaximum length for generated content
temperaturenumberoptionalModel temperature override
fallbackValueanyoptionalFallback value if AI task fails
retryAttemptsinteger
conditionstringoptionalFormula condition - task only runs if TRUE
descriptionstringoptional
activeboolean

AITaskType

Allowed Values

  • classify
  • extract
  • summarize
  • generate
  • predict
  • translate
  • sentiment
  • entity_recognition
  • anomaly_detection
  • recommendation

AgentCommunicationProtocol

Allowed Values

  • message_passing
  • shared_memory
  • blackboard

AgentGroupMember

Properties

PropertyTypeRequiredDescription
agentIdstringAgent identifier (reference to AgentSchema.name)
roleEnum<'coordinator' | 'specialist' | 'critic' | 'executor'>Agent role within the group
capabilitiesstring[]optionalList of capabilities this agent contributes
dependenciesstring[]optionalAgent IDs this agent depends on for input
priorityintegeroptionalExecution priority (0 = highest)

AgentGroupRole

Allowed Values

  • coordinator
  • specialist
  • critic
  • executor

BatchAIOrchestrationExecution

Properties

PropertyTypeRequiredDescription
workflowNamestringOrchestration to execute
recordIdsstring[]Records to process
batchSizeinteger
parallelisminteger
priorityEnum<'low' | 'normal' | 'high'>

MultiAgentGroup

Properties

PropertyTypeRequiredDescription
namestringGroup unique identifier (snake_case)
labelstringGroup display name
descriptionstringoptional
strategyEnum<'sequential' | 'parallel' | 'debate' | 'hierarchical' | 'swarm'>Multi-agent orchestration strategy
agentsObject[]Agent members (minimum 2)
communicationObjectCommunication configuration
conflictResolutionEnum<'voting' | 'priorityBased' | 'consensusBased' | 'coordinatorDecides'>optionalHow conflicts between agents are resolved
timeoutintegeroptionalMaximum execution time in seconds for the group
activebooleanWhether this agent group is active

PostProcessingAction

Properties

PropertyTypeRequiredDescription
typeEnum<'field_update' | 'send_email' | 'create_record' | 'update_related' | 'trigger_flow' | 'webhook'>
namestringAction name
configRecord<string, any>Action-specific configuration
conditionstringoptionalExecute only if condition is TRUE

WorkflowFieldCondition

Properties

PropertyTypeRequiredDescription
fieldstringField name to monitor
operatorEnum<'changed' | 'changed_to' | 'changed_from' | 'is' | 'is_not'>
valueanyoptionalValue to compare against (for changed_to/changed_from/is/is_not)

WorkflowSchedule

Properties

PropertyTypeRequiredDescription
typeEnum<'cron' | 'interval' | 'daily' | 'weekly' | 'monthly'>
cronstringoptionalCron expression (required if type is "cron")
intervalnumberoptionalInterval in minutes (required if type is "interval")
timestringoptionalTime of day for daily schedules (HH:MM format)
dayOfWeekintegeroptionalDay of week for weekly (0=Sunday)
dayOfMonthintegeroptionalDay of month for monthly
timezonestring

On this page