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.definition.update

Update an existing workflow definition.

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

    Update an existing workflow definition.

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

    Update an existing workflow definition.

    Goal

    Allow users to modify workflow blueprints.

    Context

    Workflow designer.

    Emitted Events

    `workflow.definition.updated` (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 UpdateWorkflowContract = defineCommand({
    	meta: {
    		key: 'workflow.definition.update',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.workflow-system'],
    		tags: ['workflow', 'definition', 'update'],
    		description: 'Update an existing workflow definition.',
    		goal: 'Allow users to modify workflow blueprints.',
    		context: 'Workflow designer.',
    	},
    	io: {
    		input: UpdateWorkflowInputModel,
    		output: WorkflowDefinitionModel,
    	},
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'workflow.definition.updated',
    				version: '1.0.0',
    				when: 'Workflow is updated',
    				payload: WorkflowDefinitionModel,
    			},
    		],
    		audit: ['workflow.definition.updated'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'update-workflow-happy-path',
    				given: ['Workflow definition exists'],
    				when: ['User updates definition'],
    				then: [
    					'Definition is updated',
    					'WorkflowDefinitionUpdated event is emitted',
    				],
    			},
    		],
    		examples: [
    			{
    				key: 'update-name',
    				input: { workflowId: 'def-123', name: 'New Employee Onboarding' },
    				output: { id: 'def-123', name: 'New Employee Onboarding' },
    			},
    		],
    	},
    });