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.

workflow.step.add

Add a step to a workflow definition.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, step, add
  • File: packages/examples/workflow-system/src/workflow/workflow.operations.ts
  • field.key.label
    workflow.step.add
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    workflow.step.add
    field.description.label

    Add a step to a workflow definition.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.workflow-system
  • Tags: workflow, step, add
  • File: packages/examples/workflow-system/src/workflow/workflow.operations.ts
  • field.tags.label
    workflow,step,add
    field.owners.label
    @example.workflow-system
    field.stability.label
    stable

    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' },
    			},
    		],
    	},
    });