import { ServiceNowInstance } from "../ServiceNowInstance.js"; import { CreateWorkflowOptions, CreateWorkflowResult, CreateWorkflowVersionOptions, CreateWorkflowVersionResult, CreateActivityOptions, CreateActivityResult, CreateTransitionOptions, CreateTransitionResult, CreateConditionOptions, CreateConditionResult, PublishWorkflowOptions, CompleteWorkflowSpec, CompleteWorkflowResult } from './WorkflowModels.js'; /** * Manages ServiceNow workflow lifecycle operations including creating workflows, * versions, activities, transitions, conditions, and publishing. * Also provides a high-level orchestration method to create a complete workflow * from a single specification. */ export declare class WorkflowManager { private static readonly WF_WORKFLOW; private static readonly WF_WORKFLOW_VERSION; private static readonly WF_ACTIVITY; private static readonly WF_TRANSITION; private static readonly WF_CONDITION; private _logger; private _req; private _tableAPI; private _instance; constructor(instance: ServiceNowInstance); /** * Create a new workflow record. * * @param options Workflow creation options * @returns The sys_id and name of the created workflow * @throws Error if the API call fails */ createWorkflow(options: CreateWorkflowOptions): Promise; /** * Create a new workflow version. * * @param options Workflow version creation options * @returns The sys_id and name of the created version * @throws Error if the API call fails */ createWorkflowVersion(options: CreateWorkflowVersionOptions): Promise; /** * Create a new workflow activity. * * @param options Activity creation options * @returns The sys_id and name of the created activity * @throws Error if the API call fails */ createActivity(options: CreateActivityOptions): Promise; /** * Create a transition between two activities. * * @param options Transition creation options * @returns The sys_id of the created transition * @throws Error if the API call fails */ createTransition(options: CreateTransitionOptions): Promise; /** * Create a condition on an activity. * * @param options Condition creation options * @returns The sys_id and name of the created condition * @throws Error if the API call fails */ createCondition(options: CreateConditionOptions): Promise; /** * Publish a workflow version by setting published=true and the start activity. * * @param options Publish options including version sys_id and start activity sys_id * @throws Error if the API call fails */ publishWorkflow(options: PublishWorkflowOptions): Promise; /** * Create a complete workflow from a single specification. * Orchestrates: create workflow -> create version -> create activities -> * create transitions -> optionally publish. * * Activity references in transitions use the activity's id field (if set) or * its index in the activities array (as a string like "0", "1", etc.). * * @param spec The complete workflow specification * @param onProgress Optional progress callback * @returns The complete result including all created sys_ids * @throws Error if any step fails */ createCompleteWorkflow(spec: CompleteWorkflowSpec, onProgress?: (message: string) => void): Promise; }