LaunchWorkflow

You can use the LaunchWorkflow function to launch a workflow from another workflow and include input parameters. The function saves all data from the first action set before launching the new action set.

This function displays default input parameters that users can change when the workflow is running.

When to use

You can use this function to:

  • Launch a workflow from another workflow if certain conditions are met such as approving item when a formula is approved.
  • Launch workflows where users need to review and modify input parameters before execution
  • Trigger workflows on related objects such as launch item workflow from formula workflow.

When not to use

You cannot use this function if the workflows must start automatically without user interaction.

Note: You can use StartWorkflow function.

Syntax

int LaunchWorkflow(string actionSet, string objSymbol, string objKey, params string[] @params);

Parameters

Parameter Type Required Description
objSymbol string Optional

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objKey string Optional

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
@params [] string Optional The context attributes to which the object is assigned.
Note: The values must be defined in the attribute specific enumerated lists.
actionSet string Yes The action set (workflow) to launch.

Return Value

The application returns a value greater than zero (0) if the operation is successful.

Prerequisites

The number of parameters must match target action set input parameter configuration.

LaunchWorkflow VS StartWorkflow

Aspect LaunchWorkflow StartWorkflow
Shows parameter dialog? YES NO
User can modify parameters? YES NO
Guarantees data save first? YES YES
Includes start date? NO YES (possible)
Best for? Interactive approval workflows. Automated batch processes.
User involvement? Required Not required

Examples

Example 1
Launch Item Approval from Formula Approval.
// Check status of an item
// If status value is below specified value, start workflow to approve the item

// Launch ITEM_APPROVAL workflow for ITEM 00031
// Input parameters: VENDOR = "ACME", DENSITY = 1.75

LaunchWorkflow("ITEM_APPROVAL", "ITEM", "00031", "ACME", "1.75");
Description

This example launches the ITEM_APPROVAL workflow from the FORMULA_APPROVAL workflow. The input parameters are values for the ITEM_APPROVAL workflow. These parameters are VENDOR and DENSITY.

After the workflow starts, a dialog displays the values of the input parameters. For this example, the values are for VENDOR and DENSITY. Users can specify the values manually.