WorkflowBuilder#
Note
This is advanced documentation regarding a scope that can be accessed when executing a step of type Script.
The WorkFlowBuilder class is used to construct and manage workflows comprising automation tasks. It provides methods for adding tasks, managing workflows, and handling settings, inputs, outputs, and branches. Currently, only supports ControlFlow.
Public Methods#
reset#
reset()
Initializes a new WorkflowControlFlow instance, effectively clearing any existing workflow data.
void
loadDefaultATLs#
loadDefaultATLs()
Retrieves and stores default versions of Automation Task Libraries (ATLs), caching task metadata for later use.
Promise<void>
addRootTask#
addRootTask()
Creates and adds a root task to the workflow, generating task metadata as needed.
packageName: string- Name of the package containing the task.taskName: string- Name of the task.settings: any- Configuration settings for the task.inputs: any[]- Input ports for the task.outputs: any[]- Output ports for the task.branches?: Branch[]- (Optional) Associated branches.caption?: string- (Optional) Task caption.driver?: string- (Optional) Driver information.packageVersion?: string- (Optional) Version of the package.expressions?: Expression[]- (Optional) JSONata expressions for dynamic behavior.
Promise<Task> - The created root task.
addTask#
addTask()
Adds a task to a specific branch of a root task in the workflow.
rootTaskId: string- ID of the root task.branchName: string- Name of the branch where the task will be added.packageName: string- Name of the package containing the task.taskName: string- Name of the task.settings: any- Configuration settings for the task.inputs: any[]- Input ports for the task.outputs: any[]- Output ports for the task.branches?: Branch[]- (Optional) Associated branches.caption?: string- (Optional) Task caption.driver?: string- (Optional) Driver information.packageVersion?: string- (Optional) Version of the package.expressions?: Expression[]- (Optional) JSONata expressions for dynamic behavior.
Promise<Task> - The created task.
getWorkflow#
getWorkflow()
Retrieves the current workflow and resets the builder.
WorkflowControlFlow - The current workflow instance.
getSettings#
getSettings()
Extracts settings from the provided input and formats them for use in branches.
settings: any- Raw settings data to be processed.
any - Processed settings data.