GlideFlow - Client
-
- UpdatedAug 1, 2024
- 4 minutes to read
- Xanadu
- API reference
The GlideFlow API provides methods for client-side interactions with actions, flows, and subflows.
You can use this API anywhere in the platform that accepts client scripts. The action, flow, or subflow must be set as client callable, and have a valid ACL using the Manage Security feature in Workflow Studio.
Some of the methods within the GlideFlow API return promise
objects. A promise
represents the eventual result of an asynchronous operation. For more information on promises, see Promise - Javascript MDN or AngularJS documentation.
- Start actions, flows, or subflows via a script.
- Get an existing execution.
- Get the status and any available outputs.
- Wait for the completion of an action, flow, or subflow.
There is no constructor for the GlideFlow API. Access GlideFlow methods using the GlideFlow
global object.
GlideFlow - execution.awaitCompletion()
Returns a completion object for the execution.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | An object that contains completion details for a flow or action execution. |
Example
In this example, an action is executed using startAction(), which returns an execution object. The code then uses awaitCompletion() on this execution object, which returns a completion object. The code uses this completion object to log the status and outputs within the execution.
GlideFlow - execution.getExecutionStatus()
Returns a string containing the execution status of the current execution.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | A string containing the execution status. |
Example
In this example, the code obtains an execution object using the getExecution method. The getExecution method requires an ID, which is returned by the method used to start the execution. The code then uses getExecutionStatus() to determine whether the execution has been completed before continuing.
GlideFlow - execution.getOutputs()
Returns an outputs object for the execution.
Use this method to access output generated by the execution of an action, flow, or subflow.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | An object containing outputs for an action, flow, or subflow. |
Example
In this example, the code obtains an execution object using the getExecution method. After the execution is complete, the code uses getOutputs() to return an outputs object, which it then logs using the console.log method.
GlideFlow - getExecution(String executionId)
Get an existing execution instance by ID.
Name | Type | Description |
---|---|---|
executionId | String | The ID of the execution to be retrieved. |
Type | Description |
---|---|
Object | A promise of an execution object. |
Example
In this example, the code gets an execution, then waits for it to be completed before logging the executions completion status and outputs using console.log.
GlideFlow - startAction(String scopedName.actionName, Map inputs)
Start an action.
Name | Type | Description |
---|---|---|
scopedName | String | The scoped name of the flow to be executed. |
inputs | Object | An object containing inputs defined for the action. |
Type | Description |
---|---|
Object | An object containing details on the action execution. |
Example
In this example, the code starts the global action_name action using arguments in the inputs input object variable. Upon completion, the example uses console.log or console.error to report on the success or failure of the flow.
GlideFlow - startFlow(String scopedName.flowName, Map inputs)
Start a flow.
Name | Type | Description |
---|---|---|
scopedName | String | The scoped name of the flow to be executed. |
inputs | Object | An object containing inputs defined for the flow. |
Type | Description |
---|---|
Object | An object containing details on the flow execution. |
Example
This example flow is normally triggered when a record on the incident table is updated. Because you are activating the flow from Client script, you must provide this information. The code creates an inputs variable that contains the current record and the table for the record
GlideFlow - startSubflow(String scopedName.subflowName, Map inputs)
Start a subflow.
Name | Type | Description |
---|---|---|
scopedName | String | The scoped name of the flow to be executed. |
inputs | Object | An object containing inputs used for the subflow. |
Type | Description |
---|---|
Object | An object containing details on the subflow execution. |
Example
In this example, the code starts the global subflow_name subflow using arguments in the inputs array variable. Upon completion, the example uses console.log or console.error to report on the success or failure of the flow.
On this page
- GlideFlow - execution.awaitCompletion()
- GlideFlow - execution.getExecutionStatus()
- GlideFlow - execution.getOutputs()
- GlideFlow - getExecution(String executionId)
- GlideFlow - startAction(String scopedName.actionName, Map inputs)
- GlideFlow - startFlow(String scopedName.flowName, Map inputs)
- GlideFlow - startSubflow(String scopedName.subflowName, Map inputs)