OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Add a step to a workflow definition.
Goal
Build workflow structure step by step.
Context
Workflow designer.
Emitted Events
•
`workflow.step.added` (v1.0.0)
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import { WorkflowStatusEnum } from './workflow.enum';
import {
AddStepInputModel,
CreateWorkflowInputModel,
UpdateWorkflowInputModel,
WorkflowDefinitionModel,
WorkflowStepModel,
} from './workflow.schema';
export const AddStepContract = defineCommand({
meta: {
key: 'workflow.step.add',
version: '1.0.0',
stability: 'stable',
owners: ['@example.workflow-system'],
tags: ['workflow', 'step', 'add'],
description: 'Add a step to a workflow definition.',
goal: 'Build workflow structure step by step.',
context: 'Workflow designer.',
},
io: {
input: AddStepInputModel,
output: WorkflowStepModel,
},
policy: { auth: 'user' },
sideEffects: {
emits: [
{
key: 'workflow.step.added',
version: '1.0.0',
when: 'Step is added',
payload: WorkflowStepModel,
},
],
audit: ['workflow.step.added'],
},
acceptance: {
scenarios: [
{
key: 'add-step-happy-path',
given: ['Workflow definition exists'],
when: ['User adds a step'],
then: ['Step is added', 'StepAdded event is emitted'],
},
],
examples: [
{
key: 'add-approval-step',
input: {
workflowId: 'def-123',
stepKey: 'approve-contract',
type: 'approval',
},
output: { id: 'step-456', key: 'approve-contract' },
},
],
},
});