cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Launching a workflow using code

Launching a workflow using code

It's possible to launch a workflow from within BeanShell/Java. See below for the syntax to launch a workflow using the API.

 

Set any workflow variables that you'd like to set in your launchArgsMap and run the workflow.

import java.util.HashMap;

import sailpoint.api.sailpointContext;

import sailpoint.api.Workflower;

import sailpoint.object.Workflow;

import sailpoint.object.WorkflowLaunch;





// Create and set workflow variables. These are passed into the workflow.



HashMap launchArgsMap = new HashMap();

launchArgsMap.put("myvariable","myvalue");





// Find our workflow... replace MyWorkflow with yours



Workflow wf = (Workflow)context.getObjectByName(Workflow.class,"MyWorkflow");



// Create and Configure WorkflowLaunch object



WorkflowLaunch wflaunch = new WorkflowLaunch();

wflaunch.setWorkflowName(wf.getName());

wflaunch.setWorkflowRef(wf.getName());

wflaunch.setCaseName("MyWorkflowCaseInstance");

wflaunch.setVariables(launchArgsMap);



//Create Workflower and launch workflow from WorkflowLaunch



Workflower workflower = new Workflower(context);

WorkflowLaunch launch = workflower.launch(wflaunch);

 

Labels (1)
Version history
Revision #:
3 of 3
Last update:
‎May 17, 2026 01:11 AM
Updated by: