Variable WorkflowClientConst

WorkflowClient: {
    getAllModels: {
        (): Promise<WorkflowModel[]>;
        (includePermissions: boolean): Promise<WorkflowModelWithPermissions[]>;
    };
    getInstance: ((workflowAlias: string, instanceId: string) => Promise<WorkflowInstance>);
    getModelDetails: ((workflowAlias: string) => Promise<WorkflowModelDetails>);
    startModel: ((workflowAlias: string, variables: WorkflowVariable) => Promise<WorkflowInstance>);
} = ...

Namespace

Utilities for helping your app interact with Workflows.

Example

import { WorkflowClient } from @domoinc/toolkit;

const WORKFLOW_ALIAS = 'testWorkflow';
const MODEL_INSTANCE_ID = 'dc8fa95d-746f-226f-98a9-4693da393a22';

/**
* Get all models in the instance
* @param includePermissions Define is the permissions for the current user should be attached
*/
await WorkflowClient.getAllModels(true);

/**
* Get details for single workflow model. Includes information about instances of the model.
* @param workflowAlias Defined in the manifest, under `mappings`
*/
await WorkflowClient.getModelDetails(WORKFLOW_ALIAS);

/**
* Get details for single instance (i.e. an execution) of a workflow model
* @param workflowAlias Defined in the manifest, under `mappings`
* @param instanceId Unique UUID that identifies a single instance of the workflow
*/
await WorkflowClient.getInstance(WORKFLOW_ALIAS, MODEL_INSTANCE_ID);

/**
* Trigger a manual instance of the workflow model (i.e. execute it once, manually)
* @param workflowAlias Defined in the manifest, under `mappings`
* @param variables Key-pair set of inputs for the start node of the workflow
*/
await WorkflowClient.startModel(WORKFLOW_ALIAS, { exampleInput: 1000 });

Type declaration

  • getAllModels: {
        (): Promise<WorkflowModel[]>;
        (includePermissions: boolean): Promise<WorkflowModelWithPermissions[]>;
    }
      • (): Promise<WorkflowModel[]>
      • Returns Promise<WorkflowModel[]>

      • (includePermissions: boolean): Promise<WorkflowModelWithPermissions[]>
      • Parameters

        • includePermissions: boolean

        Returns Promise<WorkflowModelWithPermissions[]>

  • getInstance: ((workflowAlias: string, instanceId: string) => Promise<WorkflowInstance>)
      • (workflowAlias: string, instanceId: string): Promise<WorkflowInstance>
      • Parameters

        • workflowAlias: string
        • instanceId: string

        Returns Promise<WorkflowInstance>

  • getModelDetails: ((workflowAlias: string) => Promise<WorkflowModelDetails>)
      • (workflowAlias: string): Promise<WorkflowModelDetails>
      • Parameters

        • workflowAlias: string

        Returns Promise<WorkflowModelDetails>

  • startModel: ((workflowAlias: string, variables: WorkflowVariable) => Promise<WorkflowInstance>)
      • (workflowAlias: string, variables: WorkflowVariable): Promise<WorkflowInstance>
      • Parameters

        • workflowAlias: string
        • variables: WorkflowVariable

        Returns Promise<WorkflowInstance>

Generated using TypeDoc