@nocobase/flow-engine
Version:
A standalone flow engine for NocoBase, managing workflows, models, and actions.
27 lines (26 loc) • 1.01 kB
TypeScript
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import { FlowEngine } from '../flowEngine';
import type { FlowModel } from '../models';
export declare class FlowExecutor {
private readonly engine;
constructor(engine: FlowEngine);
/**
* Execute a single flow on model.
*/
runFlow(model: FlowModel, flowKey: string, inputArgs?: Record<string, any>, runId?: string): Promise<any>;
/**
* Execute all auto-apply flows for model.
*/
runAutoFlows(model: FlowModel, inputArgs?: Record<string, any>, useCache?: boolean): Promise<any[]>;
/**
* Dispatch an event to flows bound via flow.on and execute them.
*/
dispatchEvent(model: FlowModel, eventName: string, inputArgs?: Record<string, any>): Promise<void>;
}