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.list

List workflow instances with filtering.

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

    List workflow instances with filtering.

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

    List workflow instances with filtering.

    Goal

    Browse and search running workflows.

    Context

    Dashboard, monitoring.

    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 ListInstancesContract = defineQuery({
    	meta: {
    		key: 'workflow.instance.list',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.workflow-system'],
    		tags: ['workflow', 'instance', 'list'],
    		description: 'List workflow instances with filtering.',
    		goal: 'Browse and search running workflows.',
    		context: 'Dashboard, monitoring.',
    	},
    	io: {
    		input: defineSchemaModel({
    			name: 'ListInstancesInput',
    			fields: {
    				workflowKey: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: true,
    				},
    				status: { type: InstanceStatusEnum, isOptional: true },
    				referenceType: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: true,
    				},
    				referenceId: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: true,
    				},
    				triggeredBy: {
    					type: ScalarTypeEnum.String_unsecure(),
    					isOptional: true,
    				},
    				limit: {
    					type: ScalarTypeEnum.Int_unsecure(),
    					isOptional: true,
    					defaultValue: 20,
    				},
    				offset: {
    					type: ScalarTypeEnum.Int_unsecure(),
    					isOptional: true,
    					defaultValue: 0,
    				},
    			},
    		}),
    		output: defineSchemaModel({
    			name: 'ListInstancesOutput',
    			fields: {
    				instances: {
    					type: WorkflowInstanceModel,
    					isArray: true,
    					isOptional: false,
    				},
    				total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
    			},
    		}),
    	},
    	policy: { auth: 'user' },
    	acceptance: {
    		scenarios: [
    			{
    				key: 'list-instances-happy-path',
    				given: ['Workflow instances exist'],
    				when: ['User lists instances'],
    				then: ['List of instances is returned'],
    			},
    		],
    		examples: [
    			{
    				key: 'list-running',
    				input: { status: 'running', limit: 10 },
    				output: { instances: [], total: 5 },
    			},
    		],
    	},
    });