---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideFlow - Client

# GlideFlow - Client {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read

The GlideFlow API provides methods for client-side interactions with actions, flows, and subflows.  
You can use this API with classic ServiceNow AI Platform UI experiences that accept 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.  
Note:  
This APi is incompatible with the Workspace Experience UI.

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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or [AngularJS documentation](https://docs.angularjs.org/api/ng/service/$q).  
Using this API, you can:

* 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.
{#GlideFlowAPI__ul_bdk_tf2_xs}

There is no constructor for the GlideFlow API. Access GlideFlow methods using the `GlideFlow` global object.

## GlideFlow - execution.awaitCompletion() {#ariaid-title2}

Returns a completion object for the execution.
{#execution-awaitCompletion__table_bqv_1q2_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#execution-awaitCompletion__table_bqv_1q2_ffb} {#execution-awaitCompletion__table_cqv_1q2_ffb__entry__2}

| Type | Description |
|-|-|
| Object | An object that contains completion details for a flow or action execution. |
[Table 2. Returns]

{#execution-awaitCompletion__table_cqv_1q2_ffb}  
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.


    (function() {
    	var inputs = {};

    	inputs['input1'] = 'string input'; // String

    	GlideFlow.startAction('global.action_name', inputs)
    		.then(function(execution) {
    			return execution.awaitCompletion();
    		}, errorResolver)
    		.then(function(completion) {
    			var status = completion.status;
    			console.log(status);

    			// Available Outputs:
    			var outputs = completion.outputs;
    			console.log(outputs);
    		}, errorResolver());

    	function errorResolver(error) {
    		// Handle errors in error resolver
    		console.error(error);
    	}
    })();

## GlideFlow - execution.getExecutionStatus() {#ariaid-title3}

Returns a string containing the execution status of the current execution.
{#execution-getExecutionStatus__table_utm_jp2_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#execution-getExecutionStatus__table_utm_jp2_ffb} {#execution-getExecutionStatus__table_vtm_jp2_ffb__entry__2}

| Type | Description |
|-|-|
| String | A string containing the execution status. |
[Table 4. Returns]

{#execution-getExecutionStatus__table_vtm_jp2_ffb}  
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.


    // Get an existing action, getStatus, and getOutputs if complete
    (function() {
       GlideFlow.getExecution('mamIN4Q35vmEFe744EwJV5GHrSz8fmJG')
          .then(function(execution) {
             execution.getExecutionStatus().then(
                function(status) {
                   if (status === 'COMPLETE')
                      execution.getOutputs().then(
                         function(outputs) {
                            console.log(outputs);
                         },
                         errorResolver
                      );
                },
                errorResolver
             );
          }, errorResolver);

       function errorResolver(error) {
          // Handle errors in error resolver
          console.error(error);
       }
    })();

## GlideFlow - execution.getOutputs() {#ariaid-title4}

Returns an outputs object for the execution.
Use this method to access output generated by the execution of an action, flow, or
subflow.
{#execution-getOutputs__table_jsw_f42_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#execution-getOutputs__table_jsw_f42_ffb} {#execution-getOutputs__table_ksw_f42_ffb__entry__2}

| Type | Description |
|-|-|
| Object | An object containing outputs for an action, flow, or subflow. |
[Table 6. Returns]

{#execution-getOutputs__table_ksw_f42_ffb}  
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.


    // Get an existing action, getStatus, and getOutputs if complete
    (function() {
       GlideFlow.getExecution('mamIN4Q35vmEFe744EwJV5GHrSz8fmJG')
          .then(function(execution) {
             execution.getExecutionStatus().then(
                function(status) {
                   if (status === 'COMPLETE')
                      execution.getOutputs().then(
                         function(outputs) {
                            console.log(outputs);
                         },
                         errorResolver
                      );
                },
                errorResolver
             );
          }, errorResolver);

       function errorResolver(error) {
          // Handle errors in error resolver
          console.error(error);
       }
    })();

## GlideFlow - getExecution(String executionId) {#ariaid-title5}

Get an existing execution instance by ID.
{#GlideFlow-getExecution__table_hpx_tqd_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| executionId | String | The ID of the execution to be retrieved. |
[Table 7. Parameters]

{#GlideFlow-getExecution__table_hpx_tqd_ffb} {#GlideFlow-getExecution__table_ipx_tqd_ffb__entry__2}

| Type | Description |
|-|-|
| Object | A promise of an execution object. |
[Table 8. Returns]

{#GlideFlow-getExecution__table_ipx_tqd_ffb}  
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.


    // Get an existing action and await completion
    (function() {
    	GlideFlow.getExecution('79cd437e0b202300a150a95e93673ae3')
    		.then(function(execution) {
    			return execution.awaitCompletion();
    		}, errorResolver)
    		.then(function(completion) {

    			var status = completion.status;
    			console.log(status);

    			// Available Outputs:
    			var outputs = completion.outputs;
    			console.log(outputs);
    		}, errorResolver());

    	function errorResolver(error) {
    		// Handle errors in error resolver
    		console.error(error);
    	}
    })();

## GlideFlow - startAction(String scopedName.actionName, Map inputs) {#ariaid-title6}

Start an action.
{#GlideFlow-startAction__table_q1w_r4d_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| scopedName | String | The scoped name of the flow to be executed. |
| inputs | Object | An object containing inputs defined for the action. |
[Table 9. Parameters]

{#GlideFlow-startAction__table_q1w_r4d_ffb} {#GlideFlow-startAction__table_r1w_r4d_ffb__entry__2}

| Type | Description |
|-|-|
| Object | An object containing details on the action execution. |
[Table 10. Returns]

{#GlideFlow-startAction__table_r1w_r4d_ffb}  
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.


    // Start an action and await completion.
    (function() {
    	var inputs = {};

    	inputs['input1'] = 'string input'; // String

    	GlideFlow.startAction('global.action_name', inputs)
    		.then(function(execution) {
    			return execution.awaitCompletion();
    		}, errorResolver)
    		.then(function(completion) {
    			var status = completion.status;
    			console.log(status);

    			// Available Outputs:
    			var outputs = completion.outputs;
    			console.log(outputs);
    		}, errorResolver());

    	function errorResolver(error) {
    		// Handle errors in error resolver
    		console.error(error);
    	}
    })();

## GlideFlow - startFlow(String scopedName.flowName, Map inputs) {#ariaid-title7}

Start a flow.
{#GlideFlow-startFlow__table_jl5_xqc_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| scopedName | String | The scoped name of the flow to be executed. |
| inputs | Object | An object containing inputs defined for the flow. |
[Table 11. Parameters]

{#GlideFlow-startFlow__table_jl5_xqc_ffb} {#GlideFlow-startFlow__table_kl5_xqc_ffb__entry__2}

| Type | Description |
|-|-|
| Object | An object containing details on the flow execution. |
[Table 12. Returns]

{#GlideFlow-startFlow__table_kl5_xqc_ffb}  
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


    // Start a Flow
    (function() {
          var inputs = {};
          inputs['current'] = { // GlideRecord 
            table : 'incident', 
            sys_id : '79cd437e0b202300a150a95e93673ae3'  
        };
            inputs['table_name'] = 'incident';
             GlideFlow.startFlow('global.flow_name', inputs)
    		.then(
    			function(execution) {
    				console.log('Started flow_name with execution id :' + execution.getExecutionId());
    			},
    			function(error) {
    				console.log('Unable to start flow: ' + error);
    			}
    		);
    })();

## GlideFlow - startSubflow(String scopedName.subflowName, Map inputs) {#ariaid-title8}

Start a subflow.
{#GlideFlow-startSubflow__table_ftt_5pd_ffb__entry__3}

| Name | Type | Description |
|-|-|-|
| scopedName | String | The scoped name of the flow to be executed. |
| inputs | Object | An object containing inputs used for the subflow. |
[Table 13. Parameters]

{#GlideFlow-startSubflow__table_ftt_5pd_ffb} {#GlideFlow-startSubflow__table_gtt_5pd_ffb__entry__2}

| Type | Description |
|-|-|
| Object | An object containing details on the subflow execution. |
[Table 14. Returns]

{#GlideFlow-startSubflow__table_gtt_5pd_ffb}  
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.


    // Start an action and await completion.
    (function() {
    	var inputs = {};

    	inputs['input1'] = 'string input'; // String

    	GlideFlow.startSubflow('global.subflow_name', inputs)
    		.then(function(execution) {
    			return execution.awaitCompletion();
    		}, errorResolver)
    		.then(function(completion) {
    			var status = completion.status;
    			console.log(status);

    			// Available Outputs:
    			var outputs = completion.outputs;
    			console.log(outputs);
    		}, errorResolver());

    	function errorResolver(error) {
    		// Handle errors in error resolver
    		console.error(error);
    	}
    })();


