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.instance.pause

Pause a running workflow instance.

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

    Pause a running workflow instance.

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

    Pause a running workflow instance.

    Goal

    Temporarily halt workflow execution.

    Context

    Administrative action, emergency stop.

    Emitted Events

    `workflow.instance.paused` (v1.0.0)

    Source Definition

    import {
    	defineCommand,
    	defineQuery,
    } from '@lssm-tech/lib.contracts-spec/operations';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    import { InstanceStatusEnum } from './instance.enum';
    import {
    	StartWorkflowInputModel,
    	TransitionInputModel,
    	TransitionResultModel,
    	WorkflowInstanceModel,
    } from './instance.schema';
    
    export const PauseWorkflowContract = defineCommand({
    	meta: {
    		key: 'workflow.instance.pause',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.workflow-system'],
    		tags: ['workflow', 'instance', 'pause'],
    		description: 'Pause a running workflow instance.',
    		goal: 'Temporarily halt workflow execution.',
    		context: 'Administrative action, emergency stop.',
    	},
    	io: {
    		input: defineSchemaModel({
    			name: 'PauseResumeInput',
    			fields: {
    				instanceId: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: false,
    				},
    				reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
    			},
    		}),
    		output: WorkflowInstanceModel,
    	},
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'workflow.instance.paused',
    				version: '1.0.0',
    				when: 'Workflow is paused',
    				payload: WorkflowInstanceModel,
    			},
    		],
    		audit: ['workflow.instance.paused'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'pause-workflow-happy-path',
    				given: ['Workflow is running'],
    				when: ['Admin pauses workflow'],
    				then: ['Instance status becomes PAUSED'],
    			},
    		],
    		examples: [
    			{
    				key: 'pause-maintenance',
    				input: { instanceId: 'inst-456', reason: 'System maintenance' },
    				output: { id: 'inst-456', status: 'paused' },
    			},
    		],
    	},
    });